﻿/* =========================================
   1. VARIABLES Y CONFIGURACIÓN BASE
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Poppins:wght@300;400;600&display=swap');

:root {
    --color-mavi: #a58eaa;
    --color-mavi-hover: #8e7792;
    --color-fondo: #fcfafc;
    --color-texto: #4a4a4a;
    --blanco: #ffffff;
    --shadow-suave: 0 4px 15px rgba(165, 142, 170, 0.1);
    --shadow-card: 0 5px 15px rgba(0,0,0,0.05);
    --color-error: #ff6b6b;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-image: url('fondo-mavi.jpg'); 
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    margin: 0;
    color: var(--color-texto);
    overflow-x: hidden;
    
    /* CAMBIO: Estructura para fijar footer */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   2. HEADER (Logo Centrado y Navegación)
   ========================================= */
.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    height: 80px;
    background-color: var(--color-mavi); /* Franja color Mavi */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-mavi {
    font-family: 'Great Vibes', cursive;
    color: var(--blanco);
    margin: 0;
    text-decoration: none;
}

/* ==========================================================================
   --- BLOQUE DE MENÚ HAMBURGUESA Y ADAPTACIÓN RESPONSIVA ---
   ========================================================================== */

/* --- Estilos Base del Botón Hamburguesa --- */
.menu-hamburguesa {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;                /* Espaciado equilibrado */
    width: 30px; 
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1010;
    position: relative;
}

.menu-hamburguesa span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--blanco);
    border-radius: 4px;
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
    transform-origin: center;
}

/* Efecto estético inicial: la línea del medio es más corta */
.menu-hamburguesa span:nth-child(2) { 
    width: 70%; 
}

/* Al pasar el mouse, la línea del medio se completa */
.menu-hamburguesa:hover span:nth-child(2) { 
    width: 100%; 
}

/* --- Animación de Transformación a "X" --- */
/* Estas clases se activarán mediante JavaScript añadiendo .active al botón */

.menu-hamburguesa.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-hamburguesa.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.menu-hamburguesa.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    width: 100%; /* Asegura que la X sea simétrica */
}

/* --- Ajustes Responsivos --- */
@media (max-width: 768px) {
    .header-main {
        height: 70px;
        padding: 0 15px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .header-left, .header-right {
        flex: 1;
        display: flex;
        align-items: center;
    }

    .header-center {
        flex: 2; /* Más espacio para el logo */
        display: flex;
        justify-content: center;
        text-align: center;
    }

    .logo-mavi {
        font-size: 2rem !important;
        white-space: nowrap;
        margin: 0;
    }

    .header-right {
        justify-content: flex-end;
        gap: 15px;
    }

    /* Iconos y elementos de acción */
    .icon-mavi {
        color: var(--blanco) !important;
        stroke: var(--blanco) !important;
        width: 24px;
        height: 24px;
        transition: transform 0.2s ease;
    }

    .icon-mavi:active {
        transform: scale(0.9); /* Feedback táctil al tocar */
    }

    #cart-icon-header {
        font-size: 1.3rem;
        color: var(--blanco);
        text-decoration: none;
        display: flex;
        align-items: center;
        position: relative;
    }
    
    /* Si tienes un contador de carrito, podrías usar esto: */
    .cart-count {
        position: absolute;
        top: -5px;
        right: -8px;
        background: red;
        font-size: 0.7rem;
        padding: 2px 5px;
        border-radius: 50%;
    }
}

#cart-icon-header {
    cursor: pointer;
    font-size: 1.6rem;
    position: relative;
    color: var(--blanco);
    text-decoration: none;
    transition: transform 0.3s ease;
}

#cart-icon-header:hover { transform: scale(1.1); }

#cart-count {
    background: var(--blanco);
    color: var(--color-mavi);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    position: absolute;
    top: -5px;
    right: -10px;
}

.btn-fav-header {
    background: none;
    border: none;
    color: var(--blanco);
    font-size: 1.4rem;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
}

.btn-fav-header:hover { transform: scale(1.1); }

#fav-count {
    background: var(--blanco);
    color: var(--color-mavi);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    position: absolute;
    top: -5px;
    right: -10px;
}

/* =========================================
   3. HERO Y CONTENIDO PRINCIPAL
   ========================================= */
main {
    padding: 2rem;
    max-width: 1100px;
    margin: 20px auto;
    background-color: rgba(255, 255, 255, 0.4); 
    backdrop-filter: blur(4px); 
    border-radius: 20px;
    flex: 1 0 auto; 
    width: 100%;
}

.hero {
    text-align: center;
    padding: 3rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero h2 { 
    font-size: 2.5rem; 
    margin-bottom: 0.5rem; 
    text-shadow: 0 2px 4px rgba(255,255,255,0.8); 
}

.hero p { 
    font-size: 1.1rem; 
    color: var(--color-texto); 
    font-weight: 400;
}

/* =========================================
   4. TIENDA Y PRODUCTOS
   ========================================= */
.grid-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.card-producto {
    background: var(--blanco); 
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1); 
    transition: transform 0.3s ease;
    text-align: center;
}

.card-producto:hover { transform: translateY(-10px); }

.card-producto img {
    width: 100%;
    height: 350px;
    object-fit: cover;
}

.info-card { padding: 1.5rem; }

.precio {
    color: var(--color-mavi);
    font-weight: 600;
    font-size: 1.2rem;
    display: block;
    margin: 10px 0;
}

button {
    background-color: var(--color-mavi);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    transition: background 0.3s;
}

button:hover { background-color: var(--color-mavi-hover); }

/* =========================================
   5. MENÚ LATERAL
   ========================================= */
#menu-lateral {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background: var(--blanco);
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    transition: 0.4s ease-in-out;
    z-index: 1100;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

#menu-lateral.menu-visible { left: 0; }

.menu-content h3 {
    color: var(--color-mavi);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-size: 1.4rem;
}

.menu-content ul { list-style: none; padding: 0; }
.menu-content li {
    padding: 12px 0;
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.3s;
    border-bottom: 1px solid #f9f9f9;
}

.menu-content li:hover {
    color: var(--color-mavi);
    padding-left: 10px;
    background-color: rgba(165, 142, 170, 0.05);
}

.link-admin {
    margin-top: auto;
    text-align: center;
    padding: 1.2rem 0;
    text-decoration: none;
    color: #bbb;
    font-size: 0.85rem;
    border-top: 1px solid #eee;
}

/* =========================================
   6. SECCIÓN LOGIN Y FORMULARIOS (CORREGIDO)
   ========================================= */
.body-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: var(--blanco);
    padding: 3rem;
    border-radius: 0; /* Tarjeta Cuadrada */
    box-shadow: var(--shadow-suave);
    text-align: center;
    
    /* Configuración para centrar contenido interno y ser cuadrado */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    width: 100%;
    max-width: 450px;
    aspect-ratio: 1 / 1; /* Mantiene la proporción cuadrada */
    
    border: 1px solid rgba(165, 142, 170, 0.1);
}

#login-form-cliente, #registro-form, .input-group {
    width: 100%;
}

#login-form-cliente input, #registro-form input, .input-group input {
    width: 100%;
    padding: 14px;
    border: 1px solid #eee;
    border-radius: 12px;
    margin-bottom: 1.2rem;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    transition: 0.3s;
}

/* =========================================
   7. ESTILO LOGIN ADMINISTRADOR
   ========================================= */
.logo-mavi-login {
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    color: var(--color-mavi);
    margin: 0 0 1rem 0;
}

.btn-login {
    width: 100%;
}

.error-text {
    color: var(--color-error);
    font-size: 0.85rem;
    margin-top: 10px;
}

/* =========================================
   8. AUTH HEADER Y NOTIFICACIONES
   ========================================= */
#auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px; 
}

.user-welcome {
    font-size: 0.85rem;
    color: white;
    font-weight: 400;
}

.btn-auth-nav {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid white;
    color: white;
    padding: 6px 16px;
    border-radius: 50px; 
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 600;
    text-transform: uppercase;
}

.btn-auth-nav:hover {
    background-color: white;
    color: var(--color-mavi);
}

.user-dropdown-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px; 
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 30px;
}

.btn-logout-small {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 500;
    text-transform: uppercase;
}

.btn-logout-small:hover {
    background-color: var(--color-error);
    border-color: var(--color-error);
    color: white;
}

.notification-bell-container {
    position: relative;
    display: flex;
    align-items: center;
}

.btn-notif {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    background-color: var(--color-error);
    color: white;
    border-radius: 50%;
    border: 2px solid var(--color-mavi);
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.notification-bell-container {
    position: relative; /* Indispensable para que el dropdown sepa dónde ubicarse */
    display: flex;
    align-items: center;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: -5px;      /* Alineado un poco hacia la izquierda del icono */
    width: 280px;
    max-width: 85vw;  /* Evita que se salga de la pantalla en móviles */
    background-color: white;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    border-radius: 12px;
    z-index: 5000;
    padding: 15px;
    margin-top: 10px;
}

/* Forzar que los iconos sean blancos si el header es color Mavi */
.header-main .icon-mavi {
    color: white !important;
    stroke: white !important;
    width: 22px;
    height: 22px;
}

/* Evitar que el botón de notificación tenga fondo */
.btn-notif {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 0;
    display: flex;
    align-items: center;
}

/* Triángulo decorativo superior (opcional, le da estética) */
.dropdown-content::before {
    content: "";
    position: absolute;
    top: -8px;
    right: 15px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.dropdown-content.show { 
    display: block; 
    animation: aparecerNotif 0.3s ease-out;
}
@media (max-width: 768px) {
    .dropdown-content {
        /* Cambiamos a posicionamiento fijo respecto a la pantalla */
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) scale(0.9); /* Centrado perfecto */
        
        width: 90vw;         /* 90% del ancho de la pantalla */
        max-width: 350px;    /* Pero que no exceda los 350px */
        height: auto;
        max-height: 70vh;    /* Que no ocupe más del 70% del alto */
        
        box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5); /* Fondo oscuro detrás */
        border-radius: 20px;
        transition: all 0.3s ease;
    }

    .dropdown-content.show {
        display: block;
        transform: translate(-50%, -50%) scale(1); /* Efecto de aumento */
    }

    /* Ocultamos el triangulito decorativo en móvil porque ya no está pegado al icono */
    .dropdown-content::before {
        display: none;
    }
}

/* Animación de entrada */
@keyframes aparecerNotif {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ajuste específico para celulares muy angostos */
@media (max-width: 400px) {
    .dropdown-content {
        width: 260px;
        right: -20px; /* Lo desplazamos un poco más a la izquierda */
    }
}

/* Estética de los items de la lista */
#lista-ofertas li {
    padding: 12px 0;
    border-bottom: 1px solid #f2f2f2;
    font-size: 0.9rem; /* Un poco más pequeño para que quepa el texto */
    line-height: 1.4;
}

#lista-ofertas li:last-child { border-bottom: none; }

.btn-borrar-notif {
    background: none !important;
    color: #ccc !important;
    padding: 0 5px !important;
    font-size: 1.2rem !important;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.btn-borrar-notif:hover { color: var(--color-error) !important; }

/* =========================================
   9. LÓGICA DE CANTIDADES (CARRITO)
   ========================================= */
.item-qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f8f8;
    padding: 5px 10px;
    border-radius: 50px;
}

.btn-qty {
    background: white !important;
    color: var(--color-mavi) !important;
    border: 1px solid #eee !important;
    width: 24px;
    height: 24px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1rem;
    transition: 0.2s;
}

.btn-qty:hover {
    background: var(--color-mavi) !important;
    color: white !important;
}

.btn-remove {
    background: none !important;
    color: var(--color-error) !important;
    font-size: 1.6rem !important;
    padding: 0 10px !important;
    transition: transform 0.2s;
}

.btn-remove:hover {
    transform: scale(1.2);
}

/* =========================================
   10. NOTIFICACIONES POPUP (TOAST)
   ========================================= */
.notification-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.toast-mavi {
    background-color: var(--color-mavi);
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    animation: slideInMavi 0.5s ease forwards;
}

@keyframes slideInMavi {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-fadeOut {
    animation: fadeOutMavi 0.5s ease forwards;
}

@keyframes fadeOutMavi {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(120%); }
}

/* =========================================
   11. CARRUSEL DE FOTOS (Slider)
   ========================================= */

.slider-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    background-color: #eee; 
    aspect-ratio: 16 / 9; 
}

.slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease;
    display: none; 
    transform: scale(1.05);
}

.slide-item.active {
    opacity: 1;
    transform: scale(1);
    z-index: 10;
    display: flex; 
    align-items: center;
    justify-content: center;
}

.slide-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; 
    display: block;
}

.prev-slide, .next-slide {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    color: var(--color-mavi);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 100;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-slide:hover, .next-slide:hover {
    background: var(--color-mavi);
    color: white;
}

.prev-slide { left: 20px; }
.next-slide { right: 20px; }

.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 100;
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.dot.active {
    background: white;
    transform: scale(1.2);
}

/* =========================================
   12. GESTIÓN ADMIN (Stock, Edición y Categorías)
   ========================================= */

.admin-prod-card {
    background: var(--blanco);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    transition: 0.3s;
    border: 1px solid #f0f0f0;
}

.admin-prod-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.admin-prod-info {
    padding: 1.2rem;
}

.badge-cat {
    background: rgba(165, 142, 170, 0.1);
    color: var(--color-mavi);
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.stock-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 10px;
    font-size: 0.9rem;
}

.stock-btns {
    display: flex;
    gap: 5px;
}

.stock-btns button {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: var(--color-mavi);
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1.1rem;
}

.stock-btns button:hover {
    background: var(--color-mavi);
    color: white;
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.btn-edit {
    flex: 1;
    background-color: #e3f2fd !important;
    color: #1976d2 !important;
    font-size: 0.8rem !important;
    padding: 8px !important;
}

.btn-delete {
    flex: 1;
    background-color: #ffebee !important;
    color: #d32f2f !important;
    font-size: 0.8rem !important;
    padding: 8px !important;
}

.btn-edit:hover { background-color: #bbdefb !important; }
.btn-delete:hover { background-color: #ffcdd2 !important; }

.tag-categoria {
    display: inline-flex;
    align-items: center;
    background: var(--color-mavi);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    margin: 5px;
    font-size: 0.85rem;
}

.tag-categoria button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    margin-left: 8px;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}

.container-foto {
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.overlay-descripcion {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(165, 142, 170, 0.95); 
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transition: all 0.4s ease-in-out;
    pointer-events: none;
    font-size: 0.9rem;
    z-index: 5;
    line-height: 1.4;
}

.overlay-descripcion.active {
    opacity: 1;
    pointer-events: auto;
}

/* Botón de Información (i) */
.btn-info-prod {
    position: absolute;
    top: 10px;
    right: 10px; /* Lo ubicamos a la izquierda para que no choque con el de Favoritos */
    
    width: 32px;
    height: 32px;
    border-radius: 50%;
    
    /* Estética Glassmorphism */
    background: rgba(255, 255, 255, 0.4); 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    
    /* Estilo del texto (la "i") */
    color: var(--color-mavi);
    font-family: 'Serif', Georgia, serif; /* Una fuente serif hace que la 'i' se vea más elegante */
    font-style: italic;
    font-weight: bold;
    font-size: 1.1rem;
    
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.3s ease;
}

/* Efecto Hover */
.btn-info-prod:hover {
    background: var(--color-mavi);
    color: white;
    transform: scale(1.1);
    border-color: var(--color-mavi);
}

/* --- ESTILOS FOOTER FINAL --- */
.main-footer {
    background-color: #fcfafc;
    border-top: 1px solid #eee;
    padding: 2rem 0 1rem 0;
    color: #666;
    margin-top: auto; 
    flex-shrink: 0;
    width: 100%;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0 1.5rem;
}

.footer-column h4 {
    color: var(--color-mavi);
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #666;
    font-size: 0.85rem;
    transition: 0.3s;
}

.footer-link:hover {
    color: var(--color-mavi);
}

.footer-icon {
    width: 18px;
    filter: grayscale(1);
    opacity: 0.7;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pay-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pay-item img {
    height: 18px;
    filter: grayscale(0.8);
    opacity: 0.7;
}

.pay-item span {
    font-size: 0.8rem;
    color: #777;
}

.ubicacion-horizontal {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ubicacion-horizontal p {
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0;
    color: #777;
}

.map-mini-container {
    flex-grow: 1;
    border-radius: 8px;
    overflow: hidden;
    height: 70px;
    border: 1px solid #eee;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.7rem;
    color: #bbb;
}

#menu-lateral {
    display: flex;
    flex-direction: column;
}

.menu-content {
    flex-grow: 1; 
}

.menu-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 10px; 
}

.btn-terminos-menu {
    background: none;
    border: 1px solid var(--color-mavi);
    color: var(--color-mavi);
    padding: 12px;
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    transition: 0.3s;
}

.btn-terminos-menu:hover {
    background: var(--color-mavi);
    color: white;
}

/* --- MODAL TÉRMINOS ACTUALIZADO --- */
.modal-mavi-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: none;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-mavi-overlay.active {
    display: flex;
}

.modal-mavi-content {
    background: white;
    width: 90%;
    max-width: 500px; 
    max-height: 90vh; 
    padding: 20px;
    border-radius: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

#popup-terminos .slider-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fdfdfd;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    min-height: 350px;
}

#popup-terminos .slide-item {
    width: 100%;
    height: 100%;
    display: none;
}

#popup-terminos .slide-item.active {
    display: flex;
}

#popup-terminos .slide-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; 
}

.card-fav-zoom {
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.card-fav-zoom:hover {
    transform: scale(1.03);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-mavi);
    z-index: 1001;
}

/* =========================================
   13. CORRECCIÓN CAJÓN FAVORITOS 
   ========================================= */

#modal-favoritos .modal-mavi-content {
    max-width: 700px; 
    padding-top: 60px; 
}

.grid-favoritos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
    gap: 15px;
    margin-top: 10px;
    overflow-y: auto; 
    max-height: 65vh;  
    padding: 10px;
}

.grid-favoritos .card-producto {
    height: auto;
    padding: 10px;
}

.grid-favoritos .card-producto img {
    height: 130px; 
    border-radius: 8px;
    object-fit: cover;
}

.grid-favoritos .info-card {
    padding: 10px 5px;
}

.grid-favoritos .info-card h4 {
    font-size: 0.85rem;
    margin: 5px 0;
}

.grid-favoritos .precio {
    font-size: 1rem;
}

.grid-favoritos button {
    padding: 8px;
    font-size: 0.7rem;
}

/* Botón de favoritos sobre la imagen */
.btn-fav {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4); /* Glassmorphism */
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
    padding: 0;
}

/* El ícono de corazón */
.icon-mavi {
    width: 23px !important;
    height: 23px !important;
    color: var(--color-mavi); /* Color de tu marca */
    transition: fill 0.3s ease, transform 0.3s ease;
}

/* Estado activo: cuando ya es favorito */
.btn-fav.active .icon-mavi {
    fill: var(--color-mavi); /* El corazón se rellena */
}

/* Efecto al pasar el mouse */
.btn-fav:hover {
    transform: scale(1.1);
    background: white;
}

/* Estilo base para las flechas de los artículos */
.nav-car-prev, .nav-car-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    opacity: 0; /* Ocultas por defecto */
    z-index: 10;
}

/* Aparecen cuando pasas el mouse por la tarjeta del producto */
.card-producto:hover .nav-car-next {
    opacity: 1;
}

.nav-car-prev { left: 10px; }
.nav-car-next { right: 10px; }

.nav-car-prev:hover, .nav-car-next:hover {
    background: white;
    color: var(--color-mavi); /* El lila de tu marca */
}

.img-principal {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: opacity 0.3s ease-in-out;
}

/* WhatsApp Float */
.whatsapp-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 15px;
}

.whatsapp-badge {
    background-color: white;
    color: var(--color-texto);
    padding: 12px 18px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    max-width: 220px;
    text-align: center;
    position: relative;
    border: 1px solid #eee;
    animation: floatingBadge 3s ease-in-out infinite;
}

.whatsapp-badge::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid white;
}

.whatsapp-float {
    width: 60px;
    height: 60px;
    background-color: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.whatsapp-float img {
    width: 35px;
    height: 35px;
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(5deg);
}

@keyframes floatingBadge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-5px); }
}

.close-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--color-mavi);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.close-badge:hover {
    background: var(--color-error);
}


/* Forzar visibilidad del slide activo en el popup */
#popup-terminos .slide-item {
    display: none !important; 
    width: 100%;
    height: 100%;
}

#popup-terminos .slide-item.active {
    display: flex !important; 
    align-items: center;
    justify-content: center;
}

#popup-terminos .slide-item img {
    display: block !important;
    max-width: 100%;
    max-height: 100%;
    height: auto; 
}

/* Contenedor con scroll suave solo si es necesario */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
    background: var(--blanco);
    padding: 15px;
    border-radius: 15px;
    box-shadow: var(--shadow-suave);
    border: 1px solid rgba(165, 142, 170, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th {
    background-color: rgba(165, 142, 170, 0.05);
    color: var(--color-mavi);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 15px;
    border-bottom: 2px solid var(--color-mavi);
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    color: var(--color-texto);
}

/* Efecto hover en las filas */
tbody tr:hover {
    background-color: rgba(165, 142, 170, 0.02);
}


th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f8f8;
    color: #333;
}

.btn-eliminar-admin {
    background: #ff4d4d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-eliminar-admin:hover {
    background: #cc0000;
}

/* Estilos para el nuevo Carrusel Superior */
.main-carousel-container {
    position: relative;
    width: 100%;
    height: 210px; 
    overflow: hidden;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-suave);
}

.main-slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-slide-item {
    min-width: 100%;
    height: 100%;
}

.main-slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
}

/* Controles y Puntos */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    color: var(--color-mavi);
    border: none;
    width: 45px;
    height: 45px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    font-size: 1.2rem;
    transition: 0.3s;
}

.carousel-control:hover { background: var(--color-mavi); color: white; }
.prev { left: 20px; }
.next { right: 20px; }

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.dot.active { 
    background: white; 
    width: 25px; 
    border-radius: 10px; 
}

@media (max-width: 768px) {
    .main-carousel-container { height: 250px; }
}

/* Estilo base para los nuevos iconos SVG */
.icon-mavi {
    width: 20px;
    height: 20px;
    stroke: #ffffff; 
    transition: all 0.3s ease;
}

/* Ajuste para los botones circulares de la imagen */
.wishlist-btn, .notify-btn {
    background: rgba(165, 142, 170, 0.5); 
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.wishlist-btn:hover, .notify-btn:hover {
    transform: scale(1.1);
    background: var(--color-mavi);
}

/* Cuando el corazón está activo (Favorito) */
.wishlist-btn.active .icon-mavi {
    fill: #ffffff; 
}

.filtros-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap; /* Para móviles */
}

.search-wrapper {
    position: relative;
    flex: 0 1 300px; /* No tan grande, máximo 300px */
}

.search-wrapper input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1.5px solid var(--color-mavi);
    border-radius: 20px; /* Estética redondeada Mavi */
    outline: none;
    font-family: 'Poppins', sans-serif;
    background: var(--blanco);
    color: var(--color-texto);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-mavi);
    pointer-events: none;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--color-texto);
}

.sort-wrapper select {
    padding: 8px 12px;
    border: 1.5px solid var(--color-mavi);
    border-radius: 15px;
    outline: none;
    cursor: pointer;
    background: var(--blanco);
    color: var(--color-texto);
}

/* Contenedor principal de las miniaturas en el formulario */
#previsualizacion-fotos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: #fdfdfd;
    border: 1px dashed #ccc;
    border-radius: 8px;
    min-height: 50px;
}

/* El cuadro pequeño de cada foto */
.foto-previa-wrapper {
    position: relative;
    width: 80px;  /* Tamaño cuadrado pequeño */
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--color-mavi);
    box-shadow: var(--shadow-card);
}

.foto-previa-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Recorta la imagen para que llene el cuadrado sin deformarse */
}

/* Botón "X" para borrar la miniatura */
.btn-borrar-foto-previa {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 107, 107, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    z-index: 5;
}

.btn-borrar-foto-previa:hover {
    background: #ff4d4d;
    transform: scale(1.1);
}

/* 1. Forzar el contenedor a ser un flexbox ordenado */
#previsualizacion-fotos.grid-previsualizacion {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    margin-top: 15px !important;
    border: 1px dashed #ccc !important;
    padding: 10px !important;
    border-radius: 12px !important;
    background: #fdfdfd !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 2. Definir el tamaño del cuadro de la foto (Wrapper) */
.foto-previa-wrapper {
    width: 90px !important;   /* Cuadrado pequeño */
    height: 90px !important;
    position: relative !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    border: 2px solid var(--color-mavi) !important;
    background: white !important;
}

/* 3. Evitar que la imagen se vea gigante */
.foto-previa-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Mantiene la proporción sin deformar */
    display: block !important;
}

/* 4. Estilo del botón de borrar sobre la imagen */
.btn-borrar-foto-previa {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    background: #ff4d4d !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 5 !important;
}


.header-icons-container {
    display: flex;
    gap: 12px;
    align-items: center;
}


/* Botones de navegación dentro de la tarjeta */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    
    /* Estética Profesional: Glassmorphism */
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    
    /* Color Mavi para la flecha */
    color: var(--color-mavi);
    
    border: 1px solid rgba(255, 255, 255, 0.4);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.carousel-btn:hover {
    background: var(--color-mavi);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev { left: 7px; }
.carousel-btn.next { right: 7px; }

/* Estética de los Dots Internos */
.carousel-dots-internos {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

.dot-interno {
    width: 7px;
    height: 7px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transition: 0.3s;
}

.dot-interno.active {
    background: var(--color-mavi);
    width: 15px; /* Efecto de píldora para el activo */
    border-radius: 4px;
}


/*boton usuario en index*/
.user-name-btn:hover .icon-mavi {
    transform: scale(1.1);
    color: var(--color-mavi) !important; /* Cambia a color Mavi si el fondo es claro */
    transition: 0.3s;
}

.btn-logout-item:hover {
    background-color: #fff5f5; /* Un fondo rosado muy tenue al señalar Salir */
}

/* --- GESTIÓN DE CATEGORÍAS ESTILIZADA --- */
#lista-categorias-admin {
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#lista-categorias-admin li {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #eee;
    transition: all 0.2s ease;
    font-weight: 500;
    color: var(--color-texto);
}

#lista-categorias-admin li:hover {
    background: #fff;
    box-shadow: var(--shadow-suave);
    transform: translateX(5px);
}

.btn-borrar-cat {
    background: #ffeded;
    color: #ff5252;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-borrar-cat:hover {
    background: #ff5252;
    color: white;
}

/* Mejora el input de nueva categoría */
.cat-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.cat-input-group input {
    flex-grow: 1;
    padding: 10px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    outline: none;
}

.cat-input-group input:focus {
    border-color: var(--color-mavi);
}

/* Asegúrate de tener esto en style.css */
.submenu-lista {
    display: none; /* Oculto por defecto */
    list-style: none;
    padding-left: 20px;
}

.menu-item-contenedor.abierto .submenu-lista {
    display: block; /* Se muestra al hacer click */
}

.menu-item-contenedor.abierto .flecha-submenu {
    transform: rotate(180deg);
}

.menu-madre-link {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
}

/* --- ESTILOS PARA EL MENÚ ACORDEÓN --- */

/* Estilo de la categoría "Madre" */
.menu-item-contenedor {
    list-style: none;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.menu-madre-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.3s;
}

.menu-madre-link:hover {
    color: var(--color-mavi);
}

/* La flecha que rota */
.flecha-submenu {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

/* El contenedor de las subcategorías (hijas) */
.submenu-lista {
    list-style: none;
    padding-left: 15px;
    background: #fdfcfd;
    max-height: 0; /* Oculto por defecto */
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.submenu-lista li {
    padding: 10px 15px;
    font-size: 0.9rem;
    color: #777;
    cursor: pointer;
}

.submenu-lista li:hover {
    color: var(--color-mavi);
    background: #f5f0f6;
}

/* Clase que activa el JS para abrir el menú */
.menu-item-contenedor.abierto .submenu-lista {
    max-height: 500px; /* Altura suficiente para desplegar */
}

.menu-item-contenedor.abierto .flecha-submenu {
    transform: rotate(180deg);
}