/* ============================================================================
 * MEGA DEPÓSITO LA FUENTE - TEMA BLANCO LUMINOSO Y ANIMACIONES 60FPS (KIOSCO 9:16)
 * ============================================================================ */

:root {
    --brand-gold: #f59e0b;
    --brand-amber: #d97706;
    --brand-red: #dc2626;
    --bg-kiosk: #f8fafc;
    --bg-white: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-light: #e2e8f0;
    --ice-cyan: #0284c7;
    --ice-blue: #0ea5e9;
    --emerald-pos: #059669;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    background-color: #e2e8f0;
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    touch-action: manipulation;
}

/* Contenedor Principal Kiosco Vertical 9:16 en Blanco */
.kiosk-viewport-wrapper {
    width: 100%;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.kiosk-shell {
    position: relative;
    width: 100%;
    height: 100dvh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: max-width 0.35s cubic-bezier(0.22, 1, 0.36, 1), height 0.35s ease, border-radius 0.35s ease;
}

/* Modo marco simulador 9:16 en pantallas horizontales de escritorio */
@media (min-aspect-ratio: 11/16) {
    .kiosk-shell.framed-9-16 {
        max-width: 56.25dvh;
        min-width: 480px;
        height: 98dvh;
        border-radius: 32px;
        border: 4px solid #cbd5e1;
        box-shadow: 0 25px 70px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.9);
    }
}

/* Scrollbars táctiles limpias */
.kiosk-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.kiosk-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.kiosk-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.kiosk-scroll::-webkit-scrollbar-thumb:hover {
    background: #f59e0b;
}

/* ============================================================================
 * 1. PRELOADER Y PANTALLA DE BIENVENIDA (ATTRACT SCREEN + KEN BURNS + SHIMMER)
 * ============================================================================ */
@keyframes kenBurns {
    0% {
        transform: scale(1) translate3d(0, 0, 0);
    }
    50% {
        transform: scale(1.1) translate3d(-1.5%, -1%, 0);
    }
    100% {
        transform: scale(1) translate3d(0, 0, 0);
    }
}

.ken-burns-img {
    animation: kenBurns 18s ease-in-out infinite;
    will-change: transform;
}

@keyframes floatCard {
    0%, 100% {
        transform: translate3d(0, 0px, 0);
    }
    50% {
        transform: translate3d(0, -8px, 0);
    }
}

.floating-card-1 {
    animation: floatCard 4.2s ease-in-out infinite;
}
.floating-card-2 {
    animation: floatCard 4.8s ease-in-out 0.7s infinite;
}
.floating-card-3 {
    animation: floatCard 5.2s ease-in-out 1.4s infinite;
}

/* Botón gigante con pulso y brillo Shimmer */
@keyframes shimmerSwipe {
    0% {
        transform: translateX(-120%) skewX(-20deg);
    }
    55%, 100% {
        transform: translateX(220%) skewX(-20deg);
    }
}

@keyframes ctaPulseRing {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55), 0 14px 30px rgba(217, 119, 6, 0.35);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(245, 158, 11, 0), 0 14px 30px rgba(217, 119, 6, 0.35);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0), 0 14px 30px rgba(217, 119, 6, 0.35);
    }
}

.cta-attract-btn {
    position: relative;
    overflow: hidden;
    animation: ctaPulseRing 2.2s infinite;
    will-change: transform, box-shadow;
}

.cta-attract-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 45%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.55) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmerSwipe 2.8s infinite;
    pointer-events: none;
}

/* ============================================================================
 * 2. FEEDBACK TÁCTIL UNIVERSAL (RIPPLE WAVE + SPRING BOUNCE)
 * ============================================================================ */
.ripple-target {
    position: relative;
    overflow: hidden;
    transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    will-change: transform;
}

.ripple-target:active {
    transform: scale(0.96) !important;
}

.touch-ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: radial-gradient(circle, rgba(245, 158, 11, 0.35) 0%, rgba(245, 158, 11, 0.15) 70%, transparent 100%);
    pointer-events: none;
    animation: rippleExpand 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    z-index: 30;
}

@keyframes rippleExpand {
    to {
        transform: scale(3.5);
        opacity: 0;
    }
}

/* ============================================================================
 * 3. NAVEGACIÓN DE CATEGORÍAS Y STAGGER ANIMATION DE TARJETAS
 * ============================================================================ */
@keyframes staggerFadeUp {
    0% {
        opacity: 0;
        transform: translate3d(0, 20px, 0) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.product-card-stagger {
    opacity: 0;
    animation: staggerFadeUp 0.36s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--stagger-index, 0) * 40ms);
    will-change: transform, opacity;
}

.category-btn {
    position: relative;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.category-btn.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    font-weight: 800;
    border-color: #d97706;
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
}

.category-btn.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 25%;
    width: 50%;
    height: 3.5px;
    border-radius: 999px;
    background: #d97706;
}

/* ============================================================================
 * 4. SELECTORES UNIDAD / CAJA (PÍLDORA DESLIZANTE) Y DESTELLO AZUL HIELO (FRÍA ❄️)
 * ============================================================================ */
.pack-switch-container {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 3px;
    isolation: isolate;
}

.pack-switch-pill {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 10px;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
    box-shadow: 0 3px 10px rgba(217, 119, 6, 0.28);
}

.pack-switch-container[data-mode="CAJA"] .pack-switch-pill {
    transform: translateX(100%);
}

.pack-switch-btn {
    position: relative;
    z-index: 2;
    padding: 7px 5px;
    font-size: 0.76rem;
    font-weight: 800;
    text-align: center;
    border-radius: 10px;
    transition: color 0.2s ease;
    line-height: 1.15;
}

.pack-switch-container[data-mode="UNIDAD"] .pack-btn-unidad,
.pack-switch-container[data-mode="CAJA"] .pack-btn-caja {
    color: #ffffff;
}

.pack-switch-container[data-mode="UNIDAD"] .pack-btn-caja,
.pack-switch-container[data-mode="CAJA"] .pack-btn-unidad {
    color: #475569;
}

/* Switch Temperatura: Al Tiempo vs Fría ❄️ en Tema Blanco */
.temp-switch-container {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 14px;
    padding: 3px;
    isolation: isolate;
    overflow: hidden;
}

.temp-switch-pill {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.28s ease, box-shadow 0.28s ease;
    z-index: 1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.temp-switch-container[data-temp="FRIA"] .temp-switch-pill {
    transform: translateX(100%);
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    border-color: #0284c7;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

/* Animación de Destello Azul Hielo / Escarcha sobre tarjeta blanca */
@keyframes iceFrostFlash {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7), inset 0 0 30px rgba(186, 230, 253, 0.9);
        border-color: #0ea5e9;
    }
    50% {
        box-shadow: 0 0 24px 6px rgba(14, 165, 233, 0.3), inset 0 0 18px rgba(186, 230, 253, 0.6);
        border-color: #0284c7;
    }
    100% {
        box-shadow: 0 10px 25px rgba(2, 132, 199, 0.14), inset 0 0 10px rgba(224, 242, 254, 0.7);
        border-color: #38bdf8;
    }
}

.card-frost-active {
    animation: iceFrostFlash 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border-color: #38bdf8 !important;
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%) !important;
}

@keyframes floatIceParticle {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.7) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-42px) scale(1.25) rotate(45deg);
    }
}

.ice-particle {
    position: absolute;
    pointer-events: none;
    z-index: 40;
    font-size: 1.15rem;
    animation: floatIceParticle 0.75s ease-out forwards;
}

/* ============================================================================
 * 5. FLY-TO-CART Y REBOTE DEL CONTADOR DE CARRITO
 * ============================================================================ */
.flying-product-clone {
    position: fixed;
    z-index: 9999;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
    border: 3px solid #f59e0b;
    box-shadow: 0 12px 30px rgba(217, 119, 6, 0.45);
    pointer-events: none;
    transition: transform 0.58s cubic-bezier(0.2, 0.85, 0.35, 1), opacity 0.58s ease;
    will-change: transform, opacity;
}

@keyframes cartBadgeBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.42) rotate(-6deg); }
    60% { transform: scale(0.92) rotate(4deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.cart-bounce-anim {
    animation: cartBadgeBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================================
 * 6. MODALES BOTTOM-SHEET EN BLANCO (ESTILO APP NATIVA / MCDONALD'S)
 * ============================================================================ */
.modal-backdrop-blur {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(15, 23, 42, 0.55);
    transition: opacity 0.28s ease;
}

.bottom-sheet-panel {
    transform: translateY(100%);
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.bottom-sheet-open .bottom-sheet-panel {
    transform: translateY(0);
}

@keyframes cartItemSlideOut {
    to {
        opacity: 0;
        transform: translateX(85px) scale(0.92);
    }
}

.cart-item-removing {
    animation: cartItemSlideOut 0.26s ease-in forwards;
}

/* ============================================================================
 * 7. ANIMACIÓN DE IMPRESIÓN DE TICKET TÉRMICO Y CONFETI DE CONFIRMACIÓN
 * ============================================================================ */
@keyframes ticketPrintEject {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
    100% {
        transform: translateY(0%);
        opacity: 1;
    }
}

.ticket-eject-anim {
    animation: ticketPrintEject 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes checkPop {
    0% {
        transform: scale(0) rotate(-30deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.15) rotate(5deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.success-check-anim {
    animation: checkPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes confettiFall {
    0% {
        transform: translate3d(0, -20px, 0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate3d(var(--dx, 30px), 260px, 0) rotate(540deg);
        opacity: 0;
    }
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 14px;
    border-radius: 3px;
    pointer-events: none;
    animation: confettiFall 1.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
