/* ==========================================================================
   CONFIGURADOR DE PEDIDOS - CANTIDAD CON INPUT NUMÉRICO DIRECTO
   ========================================================================== */

:root {
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    
    /* Clean Light Theme Palette */
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-subtle: #f1f5f9;
    
    /* Borders & Lines */
    --border-light: #e2e8f0;
    --border-card: #cbd5e1;
    --border-accent: #2563eb;
    
    /* Typography */
    --text-title: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    
    /* Accents */
    --primary: #2563eb;
    --primary-bg: #eff6ff;
    --price-green: #059669;
    --price-bg: #ecfdf5;
    --whatsapp: #25d366;
    
    /* Shadows */
    --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
    --shadow-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.12);
    --shadow-sticky: 0 -4px 25px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-page);
    color: var(--text-body);
    min-height: 100vh;
    padding-bottom: 120px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.quote-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    padding: 2.2rem 0 1.8rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.badge-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: var(--primary);
    background: var(--primary-bg);
    border: 1px solid rgba(37, 99, 235, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.company-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-title);
    letter-spacing: -0.5px;
}

.quote-meta-grid {
    display: flex;
    gap: 1.5rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.meta-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-title);
}

/* Main Section */
.quote-main {
    padding-top: 2.5rem;
}

.section-intro {
    margin-bottom: 2rem;
}

.section-intro h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-title);
}

.section-intro p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.quote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Product Card */
.quote-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
}

.quote-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-accent);
}

/* Photo Box */
.card-photo-frame {
    position: relative;
    width: 100%;
    height: 250px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    overflow: hidden;
}

.card-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.quote-card:hover .card-photo-frame img {
    transform: scale(1.06);
}

.photo-zoom-hint {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.85);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.card-photo-frame:hover .photo-zoom-hint {
    opacity: 1;
}

/* Card Content Details */
.card-info {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    flex: 1;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.card-item-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-title);
    line-height: 1.3;
}

.unit-price-badge {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--price-green);
    background: var(--price-bg);
    padding: 0.25rem 0.65rem;
    border-radius: 8px;
    white-space: nowrap;
}

/* Selectors Group */
.selector-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.selector-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Color Pills Selection */
.color-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.color-pill {
    padding: 0.35rem 0.75rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--text-body);
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-pill:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.color-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Direct Quantity Input Field (Sin + / -) */
.qty-direct-field {
    width: 100px;
    padding: 0.55rem 0.85rem;
    background: var(--bg-subtle);
    border: 2px solid var(--border-card);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-title);
    outline: none;
    transition: all 0.2s ease;
}

.qty-direct-field:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Notes Text Field */
.notes-input-field {
    width: 100%;
    padding: 0.55rem 0.8rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-title);
    outline: none;
}

.notes-input-field:focus {
    border-color: var(--primary);
    background: white;
}

/* Card Bottom Subtotal */
.card-bottom-actions {
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-subtotal-display {
    text-align: right;
}

.subtotal-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.subtotal-amount {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--price-green);
}

/* Customer Contact Card */
.customer-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-card);
}

.customer-info-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-title);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.customer-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.form-group input {
    padding: 0.7rem 1rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
    background: white;
}

/* Sticky Total Footer */
.quote-total-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-light);
    padding: 1.1rem 0;
    z-index: 100;
    box-shadow: var(--shadow-sticky);
}

.bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.total-summary {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.total-label-box {
    display: flex;
    flex-direction: column;
}

.total-label {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.total-items-badge {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

.total-amount {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--price-green);
    letter-spacing: -0.5px;
}

.action-buttons {
    display: flex;
    gap: 0.85rem;
}

.btn-secondary {
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    color: var(--text-title);
    padding: 0.75rem 1.4rem;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-whatsapp {
    background: var(--whatsapp);
    color: white;
    border: none;
    padding: 0.75rem 1.6rem;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
}

/* Lightbox Modal HD */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
}

.lightbox-dialog {
    position: relative;
    z-index: 1001;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-dialog img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    margin-top: 1.25rem;
    background: white;
    border: 1px solid var(--border-light);
    padding: 0.75rem 1.75rem;
    border-radius: 30px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-title);
}

.lightbox-close-btn {
    position: absolute;
    top: -45px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .quote-grid {
        grid-template-columns: 1fr;
    }
    .bar-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .total-summary {
        justify-content: center;
    }
    .action-buttons {
        justify-content: center;
    }
}
