/* ==========================================
   0. FUENTES EXTERNAS (MONTSERRAT COMPLETA)
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ==========================================
   1. VARIABLES Y RESET GLOBAL (NUEVO BRANDING)
   ========================================== */
:root {
    --bg-dark: #0B0D12;
    --surface: #171D26;
    --primary: #C7F000;                   /* Verde lima neón unificado */
    --primary-glow: rgba(199, 240, 0, 0.35);
    --card-border: #263b55;               /* Borde azul grafito */
    --header-bg: rgba(11, 13, 18, 0.75);
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    padding-top: 80px;
    padding-bottom: 40px;
    overflow-x: hidden;
    width: 100%;
}

/* ==========================================
   2. HEADER GLASSMORPHISM Y BOTÓN CARRITO
   ========================================== */
.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    border-bottom: 1px solid var(--card-border);
}

.logo h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #F8FAFC 20%, #C7F000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.cart-fab {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 14px;
    background: var(--primary);
    color: #0B0D12;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.35rem;
    box-shadow: 0 4px 15px var(--primary-glow);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-fab:active {
    transform: scale(0.95);
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #0B0D12;
    color: var(--primary);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--primary);
}

/* ==========================================
   3. CONTENEDORES Y BANNERS
   ========================================== */
.categories-container {
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ==========================================
   4. KIOSCO INTERACTIVO (TOSTADAS EL PRIMO)
   ========================================== */
.tostada-builder {
    background: var(--surface);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--card-border);
}

.sprite-viewer {
    width: 100%;
    max-width: 350px;
    aspect-ratio: 1 / 1;
    margin-bottom: 15px;
    border-radius: 15px;
    background-color: rgba(11, 13, 18, 0.7);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--card-border);
}

.sprite-image {
    width: 100%;
    height: 100%;
    background-image: url('/tostadaselprimo/imagenes/tostada-sprite.webp'); 
    background-size: 800% 800%; 
    background-repeat: no-repeat;
    transition: opacity 0.15s ease-in-out, filter 0.15s ease-in-out, transform 0.15s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sprite-image.updating {
    opacity: 0.6;
    filter: blur(6px);
    transform: scale(0.96);
}

.tostada-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 15px;
}

.tostada-actions .price { 
    font-size: 1.7rem; 
    font-weight: 800; 
    color: var(--primary); 
    letter-spacing: -0.3px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.btn-agregar { 
    background: var(--primary); 
    color: #0B0D12; 
    padding: 10px 20px; 
    border-radius: 12px; 
    border: none; 
    font-weight: 800; 
    font-size: 0.95rem; 
    letter-spacing: -0.2px;
    cursor: pointer; 
    box-shadow: 0 4px 15px var(--primary-glow); 
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-agregar:hover {
    box-shadow: 0 0 18px var(--primary-glow);
}

.btn-agregar:active { 
    transform: scale(0.95); 
}

.btn-agregar.disabled {
    background: #334155 !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none;
}

/* Controles del Kiosco */
.builder-controls { 
    width: 100%; 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
}

.control-section h4 { 
    color: var(--text-muted); 
    font-size: 0.85rem; 
    margin-bottom: 10px; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    font-weight: 600;
}

.combos-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 8px; 
}

.combo-btn {
    background: rgba(255, 255, 255, 0.04); 
    border: 1px solid var(--card-border); 
    color: var(--text-main); 
    padding: 10px 5px; 
    border-radius: 10px; 
    font-size: 0.85rem; 
    font-weight: 600; 
    text-align: center; 
    cursor: pointer; 
    transition: all 0.2s ease;
}

.combo-btn.active { 
    background: var(--primary); 
    border-color: var(--primary); 
    color: #0B0D12;
    font-weight: 800;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.graphic-radios-3 { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px; 
}

.graphic-radios-2 { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px; 
}

.graphic-btn {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    background: rgba(255, 255, 255, 0.04); 
    border: 2px solid transparent; 
    border-radius: 12px; 
    padding: 10px 5px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    text-align: center;
}

.graphic-btn img { 
    width: 100%; 
    max-width: 65px; 
    height: 65px; 
    object-fit: contain; 
    margin-bottom: 8px; 
    border-radius: 8px; 
    filter: grayscale(40%) opacity(0.8); 
    transition: all 0.2s ease; 
}

.graphic-btn span { 
    font-size: 0.85rem; 
    font-weight: 600; 
    color: var(--text-muted); 
}

.graphic-btn.active { 
    border-color: var(--primary); 
    background: rgba(199, 240, 0, 0.1); 
}

.graphic-btn.active img { 
    filter: grayscale(0%) opacity(1); 
    transform: scale(1.05); 
}

.graphic-btn.active span { 
    color: var(--primary); 
    font-weight: 700;
}

.checkbox-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px; 
}

.checkbox-grid.dos-col { 
    grid-template-columns: repeat(2, 1fr); 
}

.builder-checkbox {
    display: flex; 
    align-items: center; 
    gap: 8px; 
    background: rgba(0, 0, 0, 0.3); 
    padding: 10px; 
    border-radius: 8px; 
    cursor: pointer; 
    border: 1px solid var(--card-border); 
    font-size: 0.85rem;
    font-weight: 500;
}

.builder-checkbox input[type="checkbox"] { 
    accent-color: var(--primary); 
    width: 18px; 
    height: 18px; 
}

/* ==========================================
   5. GRID DE MENÚ Y TARJETAS DE PLATOS (RESPONSIVE)
   ========================================== */
.menu-grid {
    padding: 0 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 25px;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 600px) {
    .menu-grid { 
        grid-template-columns: repeat(2, minmax(0, 1fr)); 
    }
}

@media (min-width: 992px) {
    .menu-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-width: 1200px;
        margin: 0 auto;
    }
}

.dish-card {
    background: var(--surface);
    border-radius: 24px;
    padding: 15px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.dish-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 15px var(--primary-glow);
}

.media-container {
    width: 100%;
    aspect-ratio: 4 / 3; 
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    margin-bottom: 15px;
    position: relative;
    border: 1px solid var(--card-border);
}

.media-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    transition: transform 0.5s ease;
}

.dish-card:active .media-container video { 
    transform: scale(1.1); 
}

.dish-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dish-info h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 6px;
    word-break: break-word;
    letter-spacing: -0.3px;
    color: var(--text-main);
}

.dish-info p {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 400;
    margin-bottom: 16px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dish-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; 
    padding-top: 10px;
}

.price {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

.btn-add {
    background: var(--primary);
    color: #0B0D12;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 14px;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px var(--primary-glow);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0; 
}

.btn-add:hover {
    box-shadow: 0 0 15px rgba(199, 240, 0, 0.45);
    transform: scale(1.05);
}

.btn-add:active { 
    transform: scale(0.92); 
}

/* ==========================================
   6. BOTTOM SHEET Y CONTENEDOR DEL CARRITO
   ========================================== */
.cart-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85vh;
    background: var(--surface);
    border-radius: 30px 30px 0 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
    border-top: 1px solid var(--card-border);
}

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

.sheet-indicator {
    width: 40px; 
    height: 5px; 
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 5px; 
    margin: 15px auto;
}

.cart-header {
    padding: 0 25px 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid var(--card-border);
}

.cart-header h2 {
    color: var(--text-main);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.close-btn {
    background: rgba(255, 255, 255, 0.08); 
    color: var(--text-main); 
    border: 1px solid var(--card-border); 
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    font-size: 1.2rem; 
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.cart-items { 
    flex: 1; 
    overflow-y: auto; 
    padding: 20px 25px; 
}

/* ==========================================
   7. ÍTEMS DEL CARRITO Y SUBMENÚ PERSONALIZADO
   ========================================== */
.cart-item {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
    background: rgba(11, 13, 18, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 12px;
    box-sizing: border-box;
    overflow: hidden;
}

.cart-item-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
    user-select: none;
    gap: 10px;
}

.cart-item-info { 
    flex: 1; 
    min-width: 0; 
}

.cart-item-info h4 { 
    margin: 0 0 4px 0; 
    font-size: 0.95rem; 
    font-weight: 600; 
    color: var(--text-main); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.cart-item-info span { 
    font-size: 0.88rem; 
    color: var(--primary); 
    font-weight: 700; 
}

.toggle-custom-label { 
    display: inline-block; 
    font-size: 0.72rem; 
    color: var(--primary); 
    margin-top: 3px; 
    font-weight: 600; 
}

.qty-controls {
    display: flex; 
    align-items: center; 
    gap: 8px; 
    background: rgba(0, 0, 0, 0.4); 
    padding: 4px 8px; 
    border-radius: 20px; 
    border: 1px solid var(--card-border); 
    flex-shrink: 0;
}

.qty-btn {
    width: 26px; 
    height: 26px; 
    border-radius: 50%; 
    border: none; 
    background: rgba(255, 255, 255, 0.12); 
    color: #fff; 
    font-weight: 700; 
    font-size: 0.9rem; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer;
    transition: background 0.2s ease;
}

.qty-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.ingredients-submenu {
    display: none !important;
    width: 100%;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
}

.ingredients-submenu.open { 
    display: block !important; 
    animation: fadeInSubmenu 0.25s ease-out forwards; 
}

@keyframes fadeInSubmenu {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.ingredients-submenu h5 { 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    margin: 0 0 8px 0; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    font-weight: 600;
}

.ingredient-checkbox {
    display: flex; 
    align-items: center; 
    gap: 6px; 
    font-size: 0.78rem; 
    font-weight: 500;
    color: var(--text-main); 
    cursor: pointer; 
    background: rgba(0, 0, 0, 0.3); 
    padding: 8px; 
    border-radius: 8px; 
    border: 1px solid var(--card-border); 
    box-sizing: border-box;
}

.ingredient-checkbox input[type="checkbox"],
.ingredient-checkbox input[type="radio"] { 
    accent-color: var(--primary); 
    width: 16px; 
    height: 16px; 
    flex-shrink: 0; 
    cursor: pointer; 
}

.ing-name { 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

/* ==========================================
   8. FOOTER DEL CARRITO Y TOTALES
   ========================================== */
.glass-footer { 
    padding: 22px 25px; 
    background: var(--surface); 
    border-top: 1px solid var(--card-border); 
}

.total-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    font-size: 1.15rem; 
    font-weight: 700; 
    margin-bottom: 6px; 
}

.total-price { 
    color: var(--primary); 
    font-size: 1.45rem; 
    font-weight: 800;
    letter-spacing: -0.3px;
}

.disclaimer { 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    text-align: center; 
    margin-bottom: 14px; 
}

.btn-checkout {
    width: 100%; 
    padding: 16px; 
    background: var(--primary); 
    color: #0B0D12 !important; 
    border: none; 
    border-radius: 14px; 
    font-size: 1.15rem; 
    font-weight: 800; 
    letter-spacing: -0.3px;
    box-shadow: 0 4px 15px var(--primary-glow); 
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-checkout:active {
    transform: scale(0.98);
}

/* ==========================================
   9. FORMULARIO DE CHECKOUT Y PAGO MÓVIL / GPS
   ========================================== */
.checkout-form { 
    padding: 20px 25px; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    overflow-y: auto; 
    flex: 1; 
}

.form-group { 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
}

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

.form-group input { 
    background: rgba(11, 13, 18, 0.6); 
    border: 1px solid var(--card-border); 
    padding: 12px 15px; 
    border-radius: 12px; 
    color: var(--text-main); 
    font-size: 0.95rem; 
    outline: none; 
    transition: border-color 0.2s ease; 
}

.form-group input:focus { 
    border-color: var(--primary); 
    background: rgba(11, 13, 18, 0.8); 
}

.btn-gps {
    background: rgba(199, 240, 0, 0.08); 
    border: 1px dashed var(--primary); 
    color: var(--primary); 
    padding: 12px; 
    border-radius: 12px; 
    font-weight: 700; 
    cursor: pointer; 
    text-align: center; 
    transition: all 0.25s ease;
}

.btn-gps:active { 
    background: rgba(199, 240, 0, 0.18); 
}

.gps-status { 
    font-size: 0.75rem; 
    color: var(--primary); 
    text-align: center; 
    margin-bottom: 10px;
}

/* Detalles del Banco y Resumen */
.payment-section h3 {
    margin-bottom: 15px;
    color: var(--primary);
    font-weight: 700;
}

.bank-details {
    background: rgba(11, 13, 18, 0.6);
    border: 1px solid var(--card-border);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    text-align: center;
}

.bank-details p {
    margin-bottom: 4px;
    color: var(--text-main);
    font-size: 0.9rem;
}

/* ==========================================
   10. CARRUSEL HORIZONTAL TÁCTIL
   ========================================== */
.carousel-container { 
    display: flex; 
    overflow-x: auto; 
    scroll-snap-type: x mandatory; 
    scrollbar-width: none; 
    -webkit-overflow-scrolling: touch; 
    width: 100%; 
}

.carousel-container::-webkit-scrollbar { 
    display: none; 
}

.carousel-slide { 
    flex: 0 0 100%; 
    height: 100%; 
    scroll-snap-align: center; 
    position: relative; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    background-color: #000; 
}

.carousel-slide img, 
.carousel-slide video { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    object-position: center; 
    display: block; 
}

.swipe-indicator { 
    position: absolute; 
    bottom: 10px; 
    right: 10px; 
    background: rgba(0, 0, 0, 0.6); 
    color: #fff; 
    padding: 4px 10px; 
    border-radius: 12px; 
    font-size: 0.72rem; 
    font-weight: 500; 
    pointer-events: none; 
    backdrop-filter: blur(4px); 
    z-index: 10; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); 
}

/* ==========================================
   11. OPTIMIZACIÓN RESPONSIVA EN MÓVIL
   ========================================== */
@media (max-width: 480px) {
    .tostada-actions {
        gap: 12px;
        padding: 10px 0;
    }

    .tostada-actions .price { 
        font-size: 1.45rem;
    }

    .btn-agregar { 
        padding: 9px 16px;
        font-size: 0.88rem;
        border-radius: 10px;
        min-height: 42px;
    }
}

@media (max-width: 360px) {
    .tostada-actions {
        gap: 8px;
    }

    .tostada-actions .price { 
        font-size: 1.25rem; 
    }

    .btn-agregar { 
        padding: 8px 12px; 
        font-size: 0.82rem; 
    }
}