   @import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Inter:wght@300;400;600&display=swap');
        
 

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--navy);
            color: white;
            overflow-x: hidden;
            overflow-y: auto;
        } 

        @media (min-width:1024px){
            body{
                overflow:hidden;
            }
        }

        .logo-font { font-family: 'Playfair Display', serif; }

/* Contenedor principal para steps absolutos */
main.tienda-main {
    position: relative;
}

@media (min-width: 1024px) {
    main.tienda-main {
        overflow: hidden;
    }
}
        
       /* Estado base: oculto lógicamente pero listo para animar */
.step-view {
    display: none !important; /* Se mantiene para que no ocupen espacio */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Estado activo - DESKTOP usa flex */
@media (min-width: 1024px) {
    .step-view.active {
        display: flex !important;
        z-index: 10;
        /* Usamos un pequeño delay en la opacidad para que el navegador 
           tenga tiempo de renderizar el display:flex antes de iniciar la animación */
        animation: fadeInStep 0.6s forwards;
    }
}

/* Estado activo - MOBILE usa block */
@media (max-width: 1023px) {
    .step-view.active {
        display: block !important;
        z-index: 10;
        animation: fadeInStepMobile 0.6s forwards;
    }
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInStepMobile {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive layout para steps */
@media (max-width: 1023px) {
    body.tienda-page {
        height: auto !important;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    main.tienda-main {
        overflow: visible !important;
        min-height: auto !important;
        height: auto !important;
        flex: 1 1 auto;
    }

    .step-view {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .step-view:not(.active) {
        display: none !important;
        opacity: 0 !important;
        transform: none !important;
    }

    .step-view.active {
        transform: none !important;
    }

    /* Step 1 - Mobile */
    #step-1 .product-left {
        width: 100% !important;
        padding: 2rem 1rem !important;
        border-right: none !important;
        border-bottom: 1px solid #f3f4f6;
    }
    
    #step-1 .product-right {
        width: 100% !important;
        min-height: 60vh;
    }
    
    #step-1 .product-gallery {
        max-width: 100% !important;
    }
    
    #step-1 .main-img-container {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 4/3;
    }
    
    #step-1 .main-img-container img {
        width: 60% !important;
        height: auto !important;
    }
    
    /* Filters mobile */
    #step-1 .product-filter-toolbar {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem !important;
        width: 100%;
    }

    #step-1 .product-filter-toolbar > [id^="dropdown-"] {
        min-width: 0;
        width: 100%;
    }

    #step-1 .product-filter-toolbar > [id^="dropdown-"] > button {
        justify-content: space-between;
        width: 100%;
        min-width: 0;
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }

    #step-1 .product-filter-toolbar > [id^="dropdown-"] > div.absolute {
        left: 0;
        right: auto;
        width: 100%;
        min-width: 0;
    }

    #step-1 .product-filter-toolbar > [id^="dropdown-"]:nth-child(even) > div.absolute {
        left: auto;
        right: 0;
    }

    #step-1 .filters-row {
        display: block !important;
        width: 100% !important;
    }
    
    #step-1 .price-filters {
        display: none !important;
    }
    
    #step-1 .products-grid {
        width: 100% !important;
        padding: 1rem !important;
        max-height: none !important;
        overflow-y: visible !important;
    }

    #step-1 #product-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    #step-1 [id^="dropdown-"].filter-open > div.absolute {
        display: block !important;
    }

    #step-1 [id^="dropdown-"] > button {
        min-height: 44px;
    }
    
    /* Step 2 - Mobile */
    #step-2 .lens-left {
        width: 100% !important;
        padding: 2rem 1rem !important;
        border-right: none !important;
        border-bottom: 1px solid #f3f4f6;
    }
    
    #step-2 .lens-right {
        width: 100% !important;
        min-height: 0;
    }
    
    #step-2 .lens-img-container {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 4/3;
    }
    
    #step-2 .lens-img-container img {
        width: 70% !important;
        height: auto !important;
    }
    
    #step-2 .lens-summary {
        width: 100% !important;
        max-width: none !important;
    }
    
    /* Prescription table mobile */
    #step-2 .prescription-table {
        font-size: 9px !important;
        overflow-x: auto !important;
    }
    
    #step-2 .prescription-table th,
    #step-2 .prescription-table td {
        padding: 0.5rem 0.25rem !important;
        white-space: nowrap !important;
    }
    
    #step-2 .lifestyle-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem !important;
    }
    
    #step-2 .screen-time-buttons {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    /* Step 3 - Mobile */
    #step-3 .lens-left,
    #step-4 .summary-left {
        width: 100% !important;
        padding: 2rem 1rem !important;
        border-right: none !important;
        border-bottom: 1px solid #f3f4f6;
    }

    #step-3 .lens-right,
    #step-4 .summary-right {
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
    }

    #step-3 .lens-right,
    #step-4 .summary-right > .flex-1 {
        overflow-y: visible !important;
    }

    #step-3 .customize-left {
        width: 100% !important;
        padding: 2rem 1rem !important;
        border-right: none !important;
        border-bottom: 1px solid #f3f4f6;
        text-align: center !important;
    }
    
    #step-3 .customize-right {
        width: 100% !important;
        min-height: 60vh;
    }
    
    #step-3 .frame-preview img {
        width: 200px !important;
        height: auto !important;
    }
    
    #step-3 .lenses-options {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    #step-3 .recommended-lens {
        flex-direction: column !important;
        text-align: center !important;
        gap: 1rem !important;
    }
    
    #step-3 .recommended-lens .lens-details {
        text-align: center !important;
    }
    
    #step-3 .recommended-lens .lens-price {
        border-top: 1px solid #f3f4f6 !important;
        border-left: none !important;
        padding-top: 1rem !important;
        padding-left: 0 !important;
        text-align: center !important;
    }
    
    /* Step 4 - Mobile */
    #step-4 .summary-left {
        width: 100% !important;
        padding: 2rem 1rem !important;
        border-right: none !important;
        border-bottom: 1px solid #f3f4f6;
    }
    
    #step-4 .summary-right {
        width: 100% !important;
        min-height: 0 !important;
    }
    
    #step-4 .order-summary {
        max-width: none !important;
    }
    
    #step-4 .shipping-form {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    #step-4 .form-buttons {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    #step-4 .form-buttons button {
        width: 100% !important;
    }
    
    /* Footer mobile */
    .tienda-footer {
        flex-direction: column !important;
        gap: 1rem !important;
        text-align: center !important;
    }

    .tienda-step-indicators {
        font-size: 9px !important;
        letter-spacing: 0.06em !important;
    }

    .tienda-footer-actions button {
        min-height: 44px;
    }

    #lens-options-container .lens-card .accordion-trigger {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
        padding: 1rem 1rem 1rem 3rem !important;
    }

    #lens-options-container .lens-card .accordion-trigger > div:last-child {
        width: 100%;
        justify-content: space-between;
    }

    #customize-accordion-trigger {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

/* Pequeños ajustes para tablets */
@media (min-width: 768px) and (max-width: 1023px) {
    #step-1 #product-list {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    #step-2 .lifestyle-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    #step-3 .lenses-options {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

        /* Lens package accordions (step 4) */
        #lens-options-container {
            gap: 1rem;
        }

        #lens-options-container .lens-card {
            position: relative;
            overflow: hidden;
            border-radius: 1rem;
            border: 1px solid #e5e7eb;
            background: #ffffff;
            transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
        }

        #lens-options-container .lens-card.lens-card--recommended {
            border-color: #f3d1b5;
        }

        #lens-options-container .lens-card.is-active {
            border-color: #a67153;
            background-color: #fdf5f0;
            box-shadow: 0 4px 14px rgba(2, 12, 27, 0.08);
        }

        #lens-options-container .lens-card .lens-card-sidebar {
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 42px;
            z-index: 2;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding-top: 0.875rem;
            background: #0c2340;
            color: #fff;
            pointer-events: none;
            user-select: none;
            border-radius: 1rem 0 0 1rem;
        }

        #lens-options-container .lens-card .lens-card-body {
            position: relative;
            z-index: 1;
            display: flex;
            flex-direction: column;
            background: transparent;
        }

        #lens-options-container .lens-card .lens-card-body--with-sidebar {
            padding-left: 42px;
        }

        #lens-options-container .lens-card .accordion-trigger {
            width: 100%;
            border: 0;
            background: transparent;
            cursor: pointer;
        }

        #lens-options-container .lens-card .accordion-content {
            overflow: hidden;
            border-top: 1px solid transparent;
            background: #ffffff;
            max-height: 0;
            opacity: 0;
        }

        #lens-options-container .lens-card .accordion-content.is-open {
            opacity: 1;
            border-top-color: #f3f4f6;
            overflow-x: hidden;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        #lens-options-container .lens-card.is-active .accordion-content {
            background: rgba(255, 255, 255, 0.72);
        }

        #lens-options-container .lens-card .accordion-content-inner {
            padding: 0.25rem 1.25rem 1rem;
        }

        #step-4.step-view.active {
            min-height: 0;
        }

        #step-4 > .summary-right {
            min-height: 0;
        }

        /* Order summary modal — above SweetAlert2 (z-index 1060) */
        #order-summary-modal,
        #customize-modal {
            z-index: 1100;
        }

        body.order-summary-open #step-1.step-view.active {
            opacity: 1 !important;
            transform: none !important;
        }

        body.order-summary-open main.tienda-main {
            min-height: 55vh;
        }

        @media (min-width: 1024px) {
            body.lg\:h-screen main.tienda-main {
                flex: 1 1 0;
                min-height: 0;
            }

            body.order-summary-open main.tienda-main {
                min-height: calc(100vh - 9rem);
            }
        }

        .custom-scrollbar::-webkit-scrollbar { width: 4px; }
        .custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
        .custom-scrollbar::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 10px; }

        /* Tienda pop-out dialogs (Frames Only / Sunglasses) */
        .tienda-popout-popup {
            border-radius: 1rem !important;
            padding: 1.75rem 1.5rem 1.5rem !important;
        }

        .tienda-popout-title {
            font-family: 'Inter', sans-serif !important;
            font-size: 1.05rem !important;
            font-weight: 600 !important;
            color: #020c1b !important;
            padding: 0 0.25rem !important;
        }

        .tienda-popout-html {
            font-family: 'Inter', sans-serif !important;
            margin: 0.75rem 0 1.25rem !important;
            padding: 0 0.25rem !important;
        }

        .tienda-popout-confirm,
        .tienda-popout-cancel {
            font-size: 0.7rem !important;
            letter-spacing: 0.08em !important;
            text-transform: uppercase !important;
            font-weight: 600 !important;
            border-radius: 0.5rem !important;
            padding: 0.65rem 1.25rem !important;
        }

/* Referral intro — before store appears */
.referral-intro {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(165deg, #020c1b 0%, #0a2744 55%, #020c1b 100%);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.referral-intro.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.referral-intro__inner {
    width: 100%;
    max-width: 28rem;
    text-align: center;
    color: #fff;
}

.referral-intro__content {
    margin-bottom: 2rem;
}

.referral-intro__avatar {
    width: 5.5rem;
    height: 5.5rem;
    margin: 0 auto 1.25rem;
    border-radius: 9999px;
    object-fit: cover;
    border: 2px solid rgba(243, 209, 181, 0.45);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.referral-intro__avatar-fallback {
    width: 5.5rem;
    height: 5.5rem;
    margin: 0 auto 1.25rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(243, 209, 181, 0.35);
    color: #f3d1b5;
}

.referral-intro__badge {
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #f3d1b5;
    background: rgba(243, 209, 181, 0.12);
    border: 1px solid rgba(243, 209, 181, 0.25);
}

.referral-intro__heading {
    font-size: clamp(1.65rem, 4vw, 2.15rem);
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.referral-intro__store {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.75rem;
}

.referral-intro__message {
    font-size: 0.72rem;
    line-height: 1.7;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    max-width: 22rem;
    margin: 0 auto;
}

.referral-intro__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 12rem;
    padding: 0.9rem 1.75rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(243, 209, 181, 0.35);
    background: #f3d1b5;
    color: #020c1b;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.referral-intro__btn:hover {
    background: #e8c4a3;
    transform: translateY(-1px);
}

.referral-intro__tagline {
    margin-top: 1.25rem;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.referral-intro__loader {
    padding: 2rem 0;
}

.tienda-main.referral-intro-pending {
    visibility: hidden;
    pointer-events: none;
}

.tienda-main.referral-intro-ready {
    visibility: visible;
    pointer-events: auto;
}