:root {
    --primary: #ff6b81;
    --secondary: #a29bfe;
    --dark: #2d3436;
    --light: #f5f6fa;
    --success: #00b894;
    --ai-color: #6c5ce7;
    --shadow: rgba(0, 0, 0, 0.08);
    --gradient: linear-gradient(135deg, #ff6b81 0%, #a29bfe 100%);
    --ai-gradient: linear-gradient(135deg, #a8c0ff 0%, #3f2b96 100%);
    --shadow-soft: 0 10px 40px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
}

/* FIX: Permitir selección de texto en inputs en iOS (iPhone) */
input, textarea, select {
    -webkit-user-select: text !important;
    user-select: text !important;
}

/* Aplicar la fuente elegante a Títulos y Precios */
h1, h2, h3, .price, .logo-text {
    font-family: 'Playfair Display', serif;
    letter-spacing: -0.5px; /* Un toque más compacto y elegante */
}

/* El resto del texto se queda en Poppins para que sea legible */
body, p, button, input {
    font-family: 'Poppins', sans-serif;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding-bottom: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* HEADER MEJORADO */
header {
    background: white;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--primary);
}

/* --- COMPONENTE DE NAVEGACIÓN INTEGRADO --- */
.nav-search-wrapper {
    display: flex;
    flex: 1;
    max-width: 650px;
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
    overflow: visible; /* Permitir que el dropdown flote */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.dropdown-categories {
    position: relative;
    border-right: 1px solid #eee;
}

.dropbtn {
    background-color: #E64A6A;
    color: white;
    padding: 12px 20px;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    border-radius: 7px 0 0 7px;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    font-weight: 600;
    height: 100%;
    transition: background 0.3s;
}

.dropbtn:hover {
    background-color: #d43f5e;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 220px;
    box-shadow: 0px 15px 35px rgba(0,0,0,0.15);
    z-index: 1100;
    border-radius: 8px;
    top: calc(100% + 5px);
    left: 0;
    padding: 10px 0;
    border: 1px solid #eee;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    color: var(--dark);
    padding: 10px 20px;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    transition: background 0.2s;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: var(--light);
    color: var(--primary);
}

.dropdown-item.active {
    font-weight: 700;
    color: var(--primary);
    background: var(--gradient-light);
}

.header-search {
    flex: 1;
    margin: 0 !important;
}

#buscador {
    border: none !important;
    border-radius: 0 8px 8px 0 !important;
    height: 100%;
    padding: 12px 20px;
    box-shadow: none !important;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 25px;
}

.phone-number {
    font-weight: 600;
    color: var(--dark);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.phone-number:hover {
    color: var(--primary);
}

/* Contenedor del logo */
.logo {
    height: 50px; /* Altura fija para el header */
    display: flex;
    align-items: center;
}

/* Estilos para la imagen del logo */
.logo-img {
    height: 100%; /* La imagen ocupa toda la altura del contenedor */
    width: auto; /* Mantiene la proporción */
    object-fit: contain;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
    margin-left: 10px;
    display: none;
    white-space: nowrap;
}

#cart-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(162, 155, 254, 0.3);
}

#cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(162, 155, 254, 0.4);
}

/* Ajuste del contador dentro del carrito */
#cart-count {
    background: var(--primary); /* Mantenemos el rosa para el badge */
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Botones de navegación en header */
.nav-buttons {
    display: flex;
    gap: 10px;
    margin-left: 10px;
}

.nav-btn {
    background: #f0f0f0;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--dark);
    transition: all 0.3s;
    text-decoration: none;
}

.nav-btn:hover {
    background: var(--primary);
    color: white;
}

/* --- BOTÓN SCROLL TO TOP --- */
.scrollToTop {
    position: fixed;
    bottom: 160px; /* Encima del chatbot */
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 995;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    font-size: 1.2rem;
}

.scrollToTop.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scrollToTop:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(255, 107, 129, 0.3);
}


/* --- MEJORA: BUSCADOR CON ICONO --- */
.search-container {
    position: relative;
}

.search-container::after {
    display: none; /* Limpiamos el icono tosco */
}

#buscador {
    padding: 10px 20px;
    background: var(--light);
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 0.9rem;
}

/* GRID DE PRODUCTOS MEJORADO */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px;
}

.product-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    /* Animación de entrada */
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* --- LISTA DE DESEOS (CORAZÓN) --- */
.btn-wishlist {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    font-size: 1.1rem;
    color: #ccc;
}
.btn-wishlist.active { color: #ff6b81; transform: scale(1.1); }

.product-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover::after {
    opacity: 1;
}

.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover; /* Cambiado a cover para un look más moderno */
    background-color: #f8f9fa;
    transition: transform 0.5s ease;
    border-bottom: 1px solid #f0f0f0;
}

.product-card:hover img {
    transform: scale(1.05);
}

.product-info {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    font-size: 1rem;
    margin: 0 0 8px 0;
    color: var(--dark);
    font-weight: 600;
    min-height: 2.4em;
}

.product-info p {
    font-size: 0.8rem;
    color: #636e72;
    margin: 0 0 10px 0;
    min-height: 3.2em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.4rem; /* Un poco más grande para destacar el valor */
    display: block;
    margin: 10px 0;
}

/* --- CONTENEDOR DE PRECIO Y BOTÓN --- */
.price-container {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* --- STOCK AGOTADO --- */
.sold-out-badge {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: rgba(255, 107, 129, 0.9);
    color: white;
    padding: 10px 20px;
    font-weight: 800;
    font-size: 1.2rem;
    border: 2px solid white;
    z-index: 10;
    text-transform: uppercase;
    pointer-events: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-add {
    width: 100%;
    background: linear-gradient(135deg, #ff6b81 0%, #ff879a 100%);
    color: white;
    border: none;
    padding: 14px;
    cursor: pointer;
    margin-top: 10px;
    border-radius: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-add:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none !important;
}

.btn-add:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Animación de click */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Indicador de categoría en productos */
.category-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}

/* --- CARRITO SLIDE-OVER (DESLIZANTE) --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Fondo más oscuro para enfoque */
    backdrop-filter: blur(4px); /* Blur sutil en el fondo */
    z-index: 2000;
    opacity: 0; /* Para animación de entrada */
    transition: opacity 0.3s ease;
}

/* Clase para activar la animación de opacidad mediante JS (opcional) o CSS hover */
.modal[style*="display: block"] {
    opacity: 1;
}

/* CLASE ROBUSTA PARA ACTIVAR MODALES */
.modal.active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.modal-content {
    background: white;
    position: absolute;
    top: 0;
    right: 0; /* Pegado a la derecha */
    width: 100%;
    max-width: 450px; /* Ancho máximo elegante */
    height: 100vh; /* Fallback */
    height: 100dvh; /* Altura dinámica para móviles (Solución al problema) */
    margin: 0;
    padding: 30px;
    border-radius: 20px 0 0 20px; /* Solo borde redondeado a la izquierda */
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    
    /* Animación de entrada desde la derecha */
    transform: translateX(100%);
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- MODAL CENTRADO (Para Extras, Políticas, etc.) --- */
.modal-content.centered {
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) !important;
    height: auto !important;
    width: 90% !important;
    max-width: 500px !important;
    border-radius: 20px !important;
    animation: fadeIn 0.3s ease forwards !important;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Header del carrito más limpio */
.modal-content h2 {
    font-size: 2rem;
    margin-top: 0;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
    color: var(--dark);
}

.close {
    position: absolute;
    top: 25px;
    right: 25px;
    background: #f0f0f0;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--dark);
    transition: all 0.2s;
}

.close:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg);
}

.cart-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    animation: fadeIn 0.5s ease;
}

.cart-item:last-child {
    border-bottom: none;
}

/* --- CUPONES --- */
.coupon-section {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}
.coupon-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
}
.btn-coupon {
    background: var(--dark);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 8px;
    cursor: pointer;
}

/* EXTRAS Y ENVÍO MEJORADOS */
.extras-section, .shipping-info {
    background: #f8f9fa;
    padding: 15px;
    margin-top: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.extras-section h3, .shipping-info h3 {
    color: var(--dark);
    margin-top: 0;
    font-size: 1.1rem;
}

label {
    display: flex;
    align-items: center;
    margin: 8px 0;
    cursor: pointer;
    font-weight: 500;
}

input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.location-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.btn-location {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-location:hover {
    background: #8a80f7;
    transform: translateY(-2px);
}

input[type="text"], textarea {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    border: 2px solid #eee;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 129, 0.1);
}

/* FOOTER DEL CARRITO */
.cart-footer {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #eee;
    flex-shrink: 0; /* Evita que se encoja */
    background: white; /* Fondo sólido */
    padding-bottom: calc(15px + env(safe-area-inset-bottom)); /* Espacio extra para barras de navegación */
}

.cart-footer h3 {
    color: var(--dark);
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.btn-whatsapp {
    width: 100%;
    background: var(--success);
    color: white;
    border: none;
    padding: 16px;
    font-size: 1.1rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

.btn-whatsapp:hover {
    background: #00a085;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4);
}

/* LOADING STATE */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notificaciones */
.notificacion {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    max-width: 400px;
    z-index: 3000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notificacion.success {
    background: linear-gradient(135deg, #00b894, #00cec9);
}

.notificacion.error {
    background: linear-gradient(135deg, #ff6b81, #fd79a8);
}

.notificacion button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-left: 15px;
}

/* --- ESTILOS DE IA (NUEVO) --- */
.ai-dedication-box {
    margin-top: 15px;
    background: #f0f3ff;
    padding: 10px;
    border-radius: 8px;
    border: 1px dashed var(--ai-color);
    animation: fadeIn 0.5s ease;
}

.btn-ai-helper {
    width: 100%;
    background: var(--ai-gradient);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    margin-top: 8px;
    transition: all 0.3s;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.btn-ai-helper:hover {
    box-shadow: 0 0 15px rgba(108, 92, 231, 0.4);
    transform: translateY(-2px);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        padding: 15px;
    }
    
    .modal-content {
        max-width: 100%; /* Pantalla completa en móvil */
        border-radius: 0;
    }
    
    .filters {
        margin: 10px;
        padding: 15px;
    }
    
    .filter-btn {
        min-width: 100px;
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    

    /* --- HEADER COMPACTO MOBILE (REFACTORIZADO) --- */
    header {
        padding: 6px 12px !important;
        flex-direction: column !important;
        gap: 4px !important;
        align-items: center !important;
    }

    .logo {
        height: auto !important;
        width: 100% !important;
        max-width: max-content !important;
        margin: 0 auto !important;
        justify-content: center !important;
    }

    .logo-img {
        height: 32px !important;
    }

    .logo-text {
        display: block !important;
        font-size: 0.9rem !important;
        margin-left: 5px !important;
    }

    .header-info {
        width: 100% !important;
        justify-content: center !important;
        gap: 8px !important;
        margin: 0 !important;
    }

    .phone-number {
        padding: 4px 10px !important;
    }

    #cart-btn {
        padding: 4px 12px !important;
        font-size: 0.8rem !important;
        border-radius: 15px !important;
    }

    .nav-search-wrapper {
        width: 100% !important;
        height: 38px !important;
        margin-top: 2px !important;
        border-radius: 6px !important;
    }

    .dropbtn {
        width: 40px !important;
        height: 38px !important;
        padding: 0 !important;
        justify-content: center !important;
        border-radius: 6px 0 0 6px !important;
    }

    .dropbtn-text {
        display: none !important; /* Elimina el texto 'Categorías' */
    }

    .dropbtn i {
        margin: 0 !important;
        font-size: 1rem !important;
    }

    #buscador {
        height: 38px !important;
        padding: 0 10px !important;
        font-size: 14px !important;
    }

    #buscador::placeholder {
        font-size: 14px !important;
    }
}

@media (min-width: 768px) {
    .logo-text {
        display: block;
    }
}

/* --- PIN MODAL MODERNO (Teclado Numérico) --- */
.pin-content {
    text-align: center;
    max-width: 350px !important;
}

.pin-display {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.pin-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #eee;
    transition: all 0.2s;
    border: 1px solid #ddd;
}

.pin-dot.active {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 107, 129, 0.4);
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 260px;
    margin: 0 auto;
}

.pin-key {
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.2s;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.pin-key:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.pin-key:active {
    transform: scale(0.95);
    background: #eee;
}

/* --- GESTIÓN DE CATEGORÍAS (ADMIN) --- */
.category-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid #eee;
}

.category-list-item:hover {
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-color: var(--secondary);
}

/* --- MEJORA: BOTÓN FLOTANTE WHATSAPP --- */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    left: 30px; /* A la izquierda para no estorbar al scroll del pulgar derecho en móvil */
    background-color: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1500; /* Por encima de todo, menos del modal */
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(10deg);
}

.whatsapp-float img {
    width: 35px;
    height: 35px;
}

/* --- MEJORA: SKELETON LOADING (Carga Elegante) --- */
.skeleton {
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
}

.skeleton::after {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* Estructura de la tarjeta skeleton */
.skeleton-card {
    background: white;
    border-radius: 15px;
    padding: 0;
    box-shadow: none;
    border: 1px solid #eee;
}

.skeleton-img {
    width: 100%;
    height: 180px; /* Misma altura que tus imágenes */
    background: #e0e0e0;
}

.skeleton-text {
    height: 15px;
    margin: 10px 15px;
    background: #e0e0e0;
    border-radius: 4px;
}

.skeleton-text.short { width: 60%; }
.skeleton-btn {
    height: 35px;
    margin: 15px;
    border-radius: 8px;
    background: #e0e0e0;
}

/* --- MEJORA: FLOATING LABELS (Inputs Animados) --- */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 10px; /* Más espacio arriba */
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    background: transparent;
    font-size: 1rem;
    margin-top: 0; /* Resetear margen para evitar conflictos de posición */
}

.input-group label {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: #999;
    font-size: 0.9rem;
    pointer-events: none; /* Para poder hacer click "a través" del label */
    transition: all 0.3s ease;
    background: white; /* Para tapar la línea del borde si cruza */
    padding: 0 5px;
}

/* Cuando el input tiene el foco O no está vacío */
.input-group input:focus,
.input-group input:not(:placeholder-shown) {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 129, 0.1);
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label,
.input-group input:-webkit-autofill + label {
    top: 0;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

/* --- CHATBOT TOOLTIP --- */
.chat-tooltip {
    position: fixed;
    bottom: 90px; /* Arriba del botón flotante */
    right: 20px;
    background: white;
    padding: 10px 15px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    font-size: 0.9rem;
    color: var(--dark);
    z-index: 10000;
    border-right: 4px solid var(--primary);
    animation: bounceIn 0.5s ease;
    cursor: pointer;
}

@keyframes bounceIn {
    from { opacity: 0; transform: scale(0.5) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* --- OPTIMIZACIÓN MÓVIL CARRITO Y TOOLTIP --- */
@media (max-width: 768px) {
    .chat-tooltip {
        bottom: 85px; /* Ajuste para móvil */
        right: 15px;
        font-size: 0.85rem;
        padding: 8px 12px;
        z-index: 10001; /* Asegurar que esté encima */
        max-width: 220px;
    }

    .modal-content {
        padding: 15px 15px 0 15px !important; /* Quitamos padding inferior para que el footer controle el espacio */
    }

    .modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .extras-section, .shipping-info, .payment-info {
        padding: 15px; /* Más compacto */
        margin-top: 15px;
    }

    .input-group {
        margin-bottom: 15px;
    }
    
    .input-group input, .input-group textarea {
        padding: 12px; /* Inputs más pequeños */
    }

    /* Fix crítico: Espacio extra para evitar que la barra del navegador tape el botón */
    .cart-footer {
        padding-bottom: calc(120px + env(safe-area-inset-bottom)); /* Espacio extra grande para móviles */
        box-shadow: 0 -4px 20px rgba(0,0,0,0.05); /* Sombra para separar del contenido */
        z-index: 10;
    }
}

/* Estilos para Secciones Colapsables del Carrito */
.cart-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.cart-section-header i.fa-chevron-down {
    transition: transform 0.3s ease;
}

.cart-section-header.collapsed i.fa-chevron-down {
    transform: rotate(-90deg);
}

.cart-section-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

/* --- BANNER DE EVENTO --- */
.event-banner {
    background: linear-gradient(90deg, #ff6b81 0%, #ff8e9e 50%, #a29bfe 100%);
    color: white;
    text-align: center;
    padding: 0 20px;
    height: 30px; /* Altura máxima solicitada */
    font-weight: 400;
    font-family: 'Playfair Display', serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.75rem; /* Fuente más pequeña */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    z-index: 900;
    animation: slideDown 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- MODAL DETALLE PRODUCTO (NUEVO) --- */
.product-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.product-modal-content {
    background: white;
    width: 90%;
    max-width: 900px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    position: relative;
    animation: zoomIn 0.3s ease;
    max-height: 90vh;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.product-modal-image {
    flex: 1.2;
    background: #f8f9fa;
    position: relative;
    min-height: 300px;
}

.product-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-modal-info {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow-y: auto;
}

.product-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: white;
    border: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
}

.product-modal-close:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg);
}

.product-category-badge {
    display: inline-block;
    background: var(--light);
    color: var(--secondary);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
    align-self: flex-start;
}

.product-modal-info h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--dark);
    line-height: 1.2;
    font-family: 'Playfair Display', serif;
}

.product-modal-info p {
    color: #666;
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.6;
}

.modal-price-row {
    margin-bottom: 25px;
}

.modal-price-row .price {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 700;
}

.btn-share {
    background: #f8f9fa;
    border: 1px solid #eee;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    transition: all 0.3s;
    align-self: flex-start;
}

.btn-share:hover {
    background: #eee;
    transform: translateY(-2px);
}

.btn-share-card {
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-share-card:hover {
    background: var(--light);
    color: var(--primary);
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .product-modal-content {
        flex-direction: column;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .product-modal-image {
        flex: none;
        height: 300px;
    }
    
    .product-modal-info {
        padding: 25px;
    }
    
    .product-modal-info h2 {
        font-size: 1.5rem;
    }
}

/* --- CARRUSEL DE PRODUCTOS EN CHATBOT --- */
.chat-product-carousel {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 10px 5px;
    margin-top: 10px;
    scrollbar-width: thin;
    width: 100%;
}

.chat-product-carousel::-webkit-scrollbar {
    height: 4px;
}

.chat-product-carousel::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 10px;
}

.chat-product-card {
    min-width: 140px;
    max-width: 140px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #f0f0f0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.chat-product-card:hover {
    transform: translateY(-2px);
}

.chat-product-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    background-color: #f9f9f9;
}

.chat-product-info {
    padding: 8px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.chat-product-title {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
}

.chat-product-price {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 8px;
}

.chat-product-btn {
    margin-top: auto;
    background: var(--gradient);
    color: white;
    border: none;
    padding: 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
}

.chat-product-btn:hover {
    opacity: 0.9;
}

/* --- MODERN UPSELL SELECTORS (EXTRAS) --- */
.upsell-extra-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.upsell-extra-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.upsell-extra-img {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    object-fit: cover;
    margin-right: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.2s;
}

.upsell-extra-img:hover {
    transform: scale(1.1);
}

.upsell-extra-img.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #cbd5e0;
    font-size: 1.2rem;
}

.upsell-extra-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.upsell-extra-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
    line-height: 1.2;
    margin-bottom: 4px;
}

.upsell-extra-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    background: rgba(255, 107, 129, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
    width: fit-content;
}

.quantity-selector {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 50px;
    padding: 4px;
    border: 1px solid #eee;
}

.btn-qty {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.8rem;
}

.btn-qty:hover {
    transform: scale(1.1);
}

.btn-qty:active {
    transform: scale(0.9);
}

.btn-qty.plus {
    color: var(--success);
    background: #e6fffa;
}

.btn-qty.minus {
    color: var(--danger);
    background: #fff5f5;
}

.upsell-extra-qty {
    width: 35px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 700;
    color: var(--dark);
    font-size: 1rem;
    padding: 0;
    margin: 0 2px;
    pointer-events: none;
}

/* Ocultar flechas input number */
.upsell-extra-qty::-webkit-outer-spin-button,
.upsell-extra-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}