/* Variables de colores Blanro */
:root {
    --azul-marino: #0b1560;
    --amarillo: #f9d000;
    --blanco: #ffffff;
    --fondo-app: #f8f9fa;
    --texto-oscuro: #2d2d2d;
    --sombra: 0 4px 12px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--fondo-app);
    color: var(--texto-oscuro);
    padding-bottom: 80px;
}

/* --- HEADER TIPO APP --- */
.app-header {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 70px;
    background-color: var(--azul-marino);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 15px; z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.header-left { display: flex; align-items: center; }
.app-logo { width: 50px; height: 50px; border-radius: 12px; background: var(--blanco); padding: 3px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.header-right { text-align: right; }
.header-right h1 { color: var(--amarillo); font-size: 1.8rem; font-weight: 900; line-height: 1; text-transform: uppercase; font-style: italic; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); letter-spacing: 1px; }
.header-right span { color: var(--blanco); font-size: 0.8rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }

.main-content { margin-top: 75px; }

/* --- CARRUSEL --- */
.carousel-wrapper { width: 95%; margin: 15px auto; height: 200px; border-radius: 15px; overflow: hidden; position: relative; box-shadow: var(--sombra); background: var(--azul-marino); }
.carousel-track { display: flex; height: 100%; transition: transform 0.5s ease-in-out; }
.carousel-slide { min-width: 100%; height: 100%; position: relative; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-text { position: absolute; top: 50%; left: 20px; transform: translateY(-50%); color: var(--blanco); z-index: 2; text-shadow: 2px 2px 4px rgba(0,0,0,0.8); pointer-events: none; }
.slide-text h2 { font-size: 1.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 5px; }
.slide-text span { display: inline-block; background-color: var(--amarillo); color: var(--azul-marino); padding: 4px 12px; border-radius: 20px; font-weight: 800; font-size: 1rem; }
.carousel-slide::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(90deg, rgba(11,21,96,0.8) 0%, rgba(11,21,96,0.2) 100%); z-index: 1; pointer-events: none; }

/* --- TÍTULO Y CATEGORÍAS --- */
.section-title { padding: 10px 20px 5px; font-size: 1.5rem; font-weight: 800; color: var(--texto-oscuro); position: relative; display: inline-block; margin-left: 10px; }
.section-title::after { content: ""; position: absolute; bottom: 0; left: 20px; width: 50%; height: 4px; background-color: var(--amarillo); border-radius: 2px; }

.category-scroll { display: flex; overflow-x: auto; gap: 10px; padding: 15px 20px; scrollbar-width: none; -ms-overflow-style: none; }
.category-scroll::-webkit-scrollbar { display: none; }

.nav-btn { white-space: nowrap; background-color: var(--blanco); border: 2px solid var(--azul-marino); color: var(--azul-marino); padding: 8px 16px; border-radius: 30px; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.nav-btn.active { background-color: var(--azul-marino); color: var(--amarillo); border-color: var(--azul-marino); }

/* --- TARJETAS DE PRODUCTO --- */
main { max-width: 1200px; margin: 0 auto; padding: 0 15px 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.product-card { background-color: var(--blanco); border-radius: 15px; overflow: hidden; box-shadow: var(--sombra); display: flex; flex-direction: column; cursor: pointer; transition: transform 0.2s; }
.product-card:active { transform: scale(0.98); }

.card-image { width: 100%; height: 120px; object-fit: contain; background-color: #f9f9f9; padding: 10px; }
.card-info { padding: 10px; display: flex; flex-direction: column; flex-grow: 1; text-align: center; }
.card-info h3 { font-size: 0.95rem; font-weight: 700; color: var(--texto-oscuro); margin-bottom: 8px; line-height: 1.2; }
.price-tag { font-weight: 800; color: var(--azul-marino); font-size: 1.1rem; margin-bottom: 5px; }
.price-label { font-size: 0.75rem; color: #888; display: block; margin-bottom: 2px; }

.card-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee; }
.btn-qty { width: 30px; height: 30px; border-radius: 50%; border: none; background: var(--azul-marino); color: var(--blanco); font-size: 1.2rem; cursor: pointer; display: flex; justify-content: center; align-items: center; }
.btn-qty:active { background: #1a2b8a; }
.qty-display { font-weight: 700; font-size: 1rem; }

/* --- MODAL DE PRODUCTO --- */
.product-modal .modal-content { background-color: var(--blanco); padding: 0; border-radius: 20px; width: 90%; max-width: 400px; text-align: center; position: relative; overflow: hidden; }
.pm-image { width: 100%; height: 220px; object-fit: cover; border-bottom: 1px solid #eee; }
.pm-body { padding: 20px; }
.pm-body h2 { font-size: 1.4rem; color: var(--texto-oscuro); margin-bottom: 10px; }
.pm-desc { font-size: 0.9rem; color: #666; margin-bottom: 15px; line-height: 1.4; }
.pm-price-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; background: #f9f9f9; padding: 8px 15px; border-radius: 8px; }
.pm-price-label { font-weight: 600; color: #777; font-size: 0.9rem; }
.pm-price { font-weight: 800; color: var(--azul-marino); font-size: 1.2rem; }
.btn-add-cart { display: block; width: 100%; background: var(--azul-marino); color: var(--blanco); border: none; padding: 15px; border-radius: 10px; font-weight: 700; font-size: 1rem; margin-top: 15px; cursor: pointer; }
.btn-add-cart:active { background: #1a2b8a; }

/* --- MODAL DE DELIVERY (INFO) --- */
.delivery-options-content { background-color: var(--blanco); padding: 25px 20px; border-radius: 20px; width: 90%; max-width: 400px; text-align: center; position: relative; }
.delivery-options-content h2 { font-size: 1.3rem; color: var(--texto-oscuro); margin-bottom: 20px; }
.delivery-img { width: 100%; height: 150px; object-fit: cover; border-radius: 10px; margin-bottom: 15px; }
.delivery-options-content p { font-size: 0.9rem; color: #555; margin-bottom: 10px; }

/* --- MODAL DEL CARRITO --- */
.cart-content { background-color: var(--blanco); padding: 20px; border-radius: 20px; width: 95%; max-width: 450px; text-align: left; position: relative; max-height: 85vh; overflow-y: auto; }
.cart-content h2 { text-align: center; color: var(--azul-marino); margin-bottom: 20px; }

/* Toggle de Delivery/Pickup */
.delivery-toggle-group { display: flex; gap: 10px; margin-bottom: 20px; }
.delivery-opt {
    flex: 1; padding: 12px; border: 2px solid #ddd; background: var(--blanco);
    border-radius: 10px; font-weight: 600; color: #666; cursor: pointer;
    transition: all 0.2s; font-size: 0.9rem;
}
.delivery-opt.active { border-color: var(--azul-marino); color: var(--azul-marino); background: #f0f4ff; }

.cart-datos { background: #f9f9f9; padding: 15px; border-radius: 10px; margin-bottom: 20px; }
.cart-datos h3 { font-size: 1rem; margin-bottom: 10px; color: var(--texto-oscuro); }
.cart-datos input { width: 100%; padding: 12px; margin-bottom: 10px; border: 1px solid #ddd; border-radius: 8px; font-family: inherit; font-size: 0.9rem; background: #fff;}
.cart-datos input:last-child { margin-bottom: 0; }

.pickup-box { background: #e3f2fd; padding: 15px; border-radius: 10px; margin-top: 10px; text-align: center; color: #0d47a1; }
.pickup-box p { font-size: 0.9rem; margin-bottom: 5px; }
.pickup-box p:last-child { font-size: 0.8rem; margin-bottom: 0; }

.cart-items-container { margin-bottom: 15px; }
.cart-item-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #eee; }
.cart-item-info { flex-grow: 1; }
.cart-item-info h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.cart-item-price { color: var(--azul-marino); font-weight: 800; font-size: 1.05rem; }
.btn-delete-item { background: #ffebee; border: none; color: #e53935; width: 35px; height: 35px; border-radius: 8px; display: flex; justify-content: center; align-items: center; cursor: pointer; margin-left: 10px; }

.cart-total-row { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 800; color: var(--texto-oscuro); margin: 20px 0; padding-top: 15px; border-top: 2px solid var(--azul-marino); }
.btn-checkout { display: block; width: 100%; background: #25D366; color: var(--blanco); border: none; padding: 15px; border-radius: 10px; font-weight: 700; font-size: 1rem; cursor: pointer; text-align: center; }
.btn-checkout:active { background: #1ebe5d; }

/* --- MODALES GENERALES --- */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(11, 21, 96, 0.85); align-items: center; justify-content: center; }
.close-btn { position: absolute; top: 10px; right: 15px; font-size: 30px; color: #888; cursor: pointer; z-index: 10; background: rgba(255,255,255,0.8); border-radius: 50%; width: 35px; height: 35px; line-height: 30px; text-align: center;}

/* --- MENÚ EXPLORAR --- */
.explore-modal { display: none; position: fixed; z-index: 2000; left: 0; bottom: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); align-items: flex-end; }
.explore-content { background-color: var(--blanco); width: 100%; border-radius: 25px 25px 0 0; padding: 15px 20px 30px; animation: slideUp 0.3s ease-out; max-height: 85vh; overflow-y: auto; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.explore-drag-handle { width: 40px; height: 5px; background-color: #ddd; border-radius: 5px; margin: 0 auto 15px; }
.explore-view { display: none; }
.explore-view.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.view-header { display: flex; align-items: center; margin-bottom: 20px; }
.back-btn { background: #f0f0f0; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 1.2rem; color: var(--texto-oscuro); cursor: pointer; display: flex; justify-content: center; align-items: center; margin-right: 15px; transition: background 0.2s; }
.back-btn:active { background: #ddd; }
.view-header h2 { font-size: 1.3rem; margin: 0; }
.explore-content > h2 { text-align: center; font-size: 1.5rem; margin-bottom: 20px; }
.explore-list { display: flex; flex-direction: column; gap: 12px; }
.explore-item { display: flex; align-items: center; background-color: var(--blanco); border: 1px solid #eee; border-radius: 15px; padding: 15px; text-decoration: none; color: var(--texto-oscuro); box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: background 0.2s; }
.explore-item:active { background-color: #f0f0f0; }
.explore-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; justify-content: center; align-items: center; margin-right: 15px; }
.explore-icon svg { width: 24px; height: 24px; }
.bg-azul { background-color: var(--azul-marino); }
.bg-amarillo { background-color: var(--amarillo); }
.bg-verde { background-color: #34c759; }
.explore-text { flex-grow: 1; }
.explore-text h3 { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.explore-text p { font-size: 0.8rem; color: #777; }
.explore-arrow { color: #ccc; font-size: 1.5rem; font-weight: bold; }

.catalog-toggle { display: flex; background: #f0f0f0; border-radius: 10px; padding: 4px; margin-bottom: 15px; }
.catalog-toggle button { flex: 1; border: none; background: transparent; padding: 10px; border-radius: 8px; font-weight: 600; color: #777; cursor: pointer; transition: all 0.3s; }
.catalog-toggle button.active { background: var(--blanco); color: var(--azul-marino); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.catalog-list { display: flex; flex-direction: column; gap: 10px; }
.catalog-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border-bottom: 1px solid #eee; background: #fafafa; border-radius: 10px; }
.catalog-item-name { font-weight: 600; font-size: 0.95rem; }
.catalog-item-price { font-weight: 800; color: var(--azul-marino); background: var(--amarillo); padding: 4px 10px; border-radius: 10px; }

.payment-content { text-align: center; }
.payment-content p { margin-bottom: 15px; color: #555; }
.qr-image { width: 200px; height: 200px; margin-bottom: 20px; border: 2px solid var(--amarillo); border-radius: 10px; padding: 5px; }
.payment-details p { margin-bottom: 5px; font-size: 1rem; }
.payment-details strong { color: var(--azul-marino); }

.map-content iframe { margin-bottom: 15px; box-shadow: var(--sombra); }
.btn-open-maps { display: block; background: var(--azul-marino); color: var(--blanco); text-align: center; text-decoration: none; padding: 12px; border-radius: 10px; font-weight: 600; }

/* --- FOOTER --- */
footer { background-color: var(--azul-marino); color: var(--blanco); text-align: center; padding: 30px 20px; border-top: 5px solid var(--amarillo); }
.footer-content h3 { color: var(--amarillo); margin-bottom: 10px; }
.footer-content p { font-size: 0.85rem; margin-bottom: 5px; }
.footer-content a { color: var(--blanco); text-decoration: none; }
.copyright { margin-top: 15px; opacity: 0.6; font-size: 0.75rem !important; }

/* --- BARRA INFERIOR --- */
.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; background-color: var(--blanco); display: flex; justify-content: space-around; align-items: center; padding: 8px 0 12px; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); z-index: 1000; }
.nav-item { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #777; font-size: 0.75rem; font-weight: 600; transition: color 0.3s; width: 33%; }
.nav-item svg { width: 24px; height: 24px; margin-bottom: 4px; stroke: #777; }
.nav-item:active, .nav-item.active-nav { color: var(--azul-marino); }
.nav-item:active svg, .nav-item.active-nav svg { stroke: var(--azul-marino); }

.cart-icon-wrapper { position: relative; display: inline-block; }
.cart-badge { position: absolute; top: -5px; right: -10px; background-color: #ff3b30; color: white; font-size: 0.65rem; font-weight: bold; width: 18px; height: 18px; border-radius: 50%; display: flex; justify-content: center; align-items: center; border: 2px solid var(--blanco); }

/* Ajustes PC */
@media (min-width: 768px) {
    main { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); padding: 20px; }
    .carousel-wrapper { height: 300px; max-width: 1000px; }
    .bottom-nav { display: none; }
    body { padding-bottom: 0; }
    .card-image { height: 180px; }
    .explore-modal { align-items: center; justify-content: center; }
    .explore-content { width: 450px; border-radius: 25px; max-height: 90vh; }
}