/* =========================================
   ESTILOS CONSOLIDADOS (principal.css)
   ========================================= */

/* =========================================
   1. VARIABLES Y RESET
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #011d3f;
    --primary-dark: #095985;
    --accent: #90caf9;
    --error: #e63946;
    --dark: #222;
    --texto-claro: #fff;
    --fondo-claro: #f8f9fb;
    --gris-borde: #ddd;
    --gris-claro: #f1f5f9;
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --transition: all 0.3s ease;
    --primary-rgb: 13, 110, 167;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    background: var(--fondo-claro);
    line-height: 1.6;
    padding-top: 80px;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: #333;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

body.account-page .navbar .cart .cart-group {
    display: none;
}

/* =========================================
   2. NAVBAR Y ENCABEZADO FIJO
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--texto-claro);
}

.logo span {
    color: var(--accent);
}
.navbar .logo {
    /* Asegura que el contenedor del enlace maneje bien la imagen */
    display: flex;
    align-items: center;
    text-decoration: none; /* Si tenía subrayado por defecto */
}

.navbar .logo .logo-img {
    /* Define el tamaño de la imagen del logo */
    height: 40px; /* Ajusta este valor según tu diseño */
    width: auto; /* Mantiene la proporción */
    display: block;
}


/* =======================================
   BOTÓN HAMBURGUESA (MÓVIL)
   ======================================= */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
}

.hamburger-icon {
    display: block;
    position: relative;
    width: 100%;
    height: 3px;
    background-color: var(--texto-claro);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--texto-claro);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-icon::before {
    top: -8px;
}

.hamburger-icon::after {
    top: 8px;
}

/* Animación cuando el menú está abierto */
.menu-toggle[aria-expanded="true"] .hamburger-icon {
    background-color: transparent;
}

.menu-toggle[aria-expanded="true"] .hamburger-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger-icon::after {
    transform: rotate(-45deg);
    top: 0;
}

/* =======================================
   NAVEGACIÓN
   ======================================= */
.nav-links ul {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links > ul > li > a {
    margin: 0 1rem;
    text-decoration: none;
    color: var(--texto-claro);
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--accent);
}

/* Área de carrito / búsqueda / login */
.cart {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar .cart .cart-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart input {
    border: 1px solid var(--gris-borde);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    transition: border-color 0.2s ease;
}

.cart input:focus {
    border-color: var(--accent);
    outline: none;
}

.cart-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
    transition: transform 0.15s ease;
}

.cart-btn:hover {
    transform: scale(1.06);
}

.cart-btn i {
    font-size: 1.2rem;
    color: var(--texto-claro);
}

.cart-count {
    background: var(--error);
    color: var(--texto-claro);
    border-radius: 50%;
    font-size: 0.75rem;
    padding: 2px 6px;
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 18px;
    text-align: center;
    transition: transform 0.25s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.cart-count.animate {
    transform: scale(1.2);
}

.btn-login-wrapper {
    display: flex;
    align-items: center;
    margin-left: 5px;
}

.btn-login {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .9rem;
    border-radius: 8px;
    color: var(--texto-claro);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    text-decoration: none;
    font-weight: 600;
    transition: background .18s ease, transform .12s ease;
    white-space: nowrap;
}

.btn-login i {
    font-size: .95rem;
}

.btn-login:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}

/* =========================================
   3. MENÚS DESPLEGABLES (DROPDOWN)
   ========================================= */
.nav-links ul li {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--texto-claro);
    min-width: 220px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    padding: 0.25rem 0;
    border-radius: var(--radius);
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

@media (hover: hover) and (pointer: fine) {
    .dropdown:hover > .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.dropdown-menu li a {
    display: block;
    padding: 0.6rem 1rem;
    color: #333;
    font-size: 0.95rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-menu li a:hover {
    background: var(--gris-claro);
    color: var(--primary);
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu-list {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background: var(--texto-claro);
    min-width: 200px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    padding: 0.25rem 0;
    border-radius: var(--radius);
    z-index: 1250;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

@media (hover: hover) and (pointer: fine) {
    .dropdown-submenu:hover > .dropdown-submenu-list {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }
}

.dropdown > a,
.dropdown-submenu > a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* =========================================
   4. ESTILOS DE PÁGINA: INICIO
   ========================================= */
.hero {
    display: flex;
    align-items: center;
    min-height: 85vh;
    background: var(--gris-claro);
    overflow: hidden;
}


.hero-content {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    width: 100%;
    align-items: center;
}


.hero-text {
    padding: 4rem 5% 4rem 10%;
}

.hero-text h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #555;
}


.btn, .banner-btn, .newsletter-form button {
    display: inline-block;
    background: var(--primary);
    color: var(--texto-claro);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover, .banner-btn:hover, .newsletter-form button:hover {
    background: var(--primary-dark);
    transform: scale(1.03);
}

.hero-images {
    position: relative;
    width: 100%;
    max-width: 780px;
    height: 560px;
    overflow: hidden;
    border-radius: 26px;
    box-shadow: 0 30px 80px rgba(0,0,0,.18);
}

.hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-slide-img.active {
    opacity: 1;
}


.btn, .banner-btn, .newsletter-form button {
    display: inline-block;
    background: var(--primary);
    color: var(--texto-claro);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover, .banner-btn:hover, .newsletter-form button:hover {
    background: var(--primary-dark);
    transform: scale(1.03);
}

.hero-img img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.banner {
    background-image: url('../imagenes/Oferta.jpg');
    background-size: cover;
    background-position: center;
    padding: 5rem 10%;
    color: var(--texto-claro);
    text-align: center;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;
}

.banner-content h3 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.banner-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* =========================================
   5. ESTRUCTURA DE PÁGINA: TIENDA Y FILTROS
   ========================================= */
.tienda-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    padding: 30px 5% 50px;
    min-height: 100vh;
}

.sidebar {
    background: var(--texto-claro);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    height: fit-content;
    transition: var(--transition);
}

.sidebar h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--dark);
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.filtro-precio {
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--gris-borde);
}

.filtro-precio h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark);
    border-bottom: none;
    padding-bottom: 0;
}

.rango-precio {
    position: relative;
    height: 30px;
    margin-top: 20px;
}

.rango-precio input[type='range'] {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    position: absolute;
    width: 100%;
    height: 100%;
    background: none;
    margin: 0;
    z-index: 2;
}

.rango-precio input[type='range']::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--texto-claro);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    pointer-events: all;
    transition: background 0.2s ease, transform 0.1s ease;
}

.rango-precio input[type='range']::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--texto-claro);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    pointer-events: all;
    transition: background 0.2s ease;
}

.rango-precio input[type='range']::-webkit-slider-runnable-track {
    background: none;
}

.rango-precio input[type='range']::-moz-range-track {
    background: none;
}

.slider-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 6px;
    background: var(--gris-borde);
    border-radius: 5px;
    z-index: 1;
}

.slider-range {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background-color: var(--primary);
    border-radius: 5px;
}

.rango-valores {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
}

.rango-valores span {
    color: var(--primary);
}

.filtro-categorias ul {
    list-style: none;
    padding: 0;
}

.filtro-categorias li {
    margin-bottom: 0.2rem;
}

.filtro-categorias a {
    display: block;
    padding: 0.6rem 0.8rem;
    text-decoration: none;
    color: var(--dark);
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 0.95rem;
}

.filtro-categorias a:hover {
    background: var(--gris-claro);
}

.filtro-categorias a.active, .filtro-categorias a.cat-filter.active {
    background: var(--primary);
    color: var(--texto-claro);
    font-weight: 600;
}

#btnFiltrar {
    background: var(--primary);
    color: var(--texto-claro);
    border: none;
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-radius: var(--radius);
    margin-top: 1rem;
    width: 100%;
    font-weight: 600;
    transition: var(--transition);
}

#btnFiltrar:hover {
    background: var(--primary-dark);
}

.productos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gris-borde);
}

.productos h2 {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.8rem;
    color: var(--dark);
}

.productos-info {
    color: #555;
    font-size: 0.95rem;
}

.productos-orden {
    display: flex;
    align-items: center;
    gap: 10px;
}

.productos-orden label {
    font-size: 0.95rem;
    color: var(--dark);
    font-weight: 500;
}

#ordenar {
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--gris-borde);
    background-color: var(--texto-claro);
    cursor: pointer;
    font-size: 0.95rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
}

/* =========================================
   6. PRODUCTOS Y TARJETAS
   ========================================= */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--texto-claro);
    padding: 0.8rem;
    border-radius: var(--radius);
    position: relative;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-top: 6px solid;
    border-image: linear-gradient(90deg, var(--primary), var(--accent)) 1;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.product-card:hover img {
    transform: scale(1.03);
}

.product-card a.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.3rem 0;
    transition: color 0.2s ease;
}

.product-card a.product-link:hover h4 {
    color: var(--primary-dark);
}

.product-card .precio {
    font-size: 1rem;
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.tallas {
    margin-bottom: 0.8rem;
}

.tallas button, .talla-btn {
    background: var(--gris-claro);
    border: 1px solid #ccc;
    margin: 0.1rem;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: var(--transition);
}

.tallas button:hover:not(.agotada), .talla-btn:hover:not(.agotada) {
    background: var(--primary);
    color: var(--texto-claro);
}

.tallas button.selected, .talla-btn.selected {
    background: var(--primary);
    color: var(--texto-claro);
    font-weight: bold;
    border-color: var(--primary);
}

.tallas button.agotada, .talla-btn.agotada {
    color: #999;
    background-color: #f5f5f5;
    text-decoration: line-through;
    cursor: not-allowed;
    border-color: #eee;
}

.add-to-cart-btn {
    background: var(--primary);
    border: none;
    color: var(--texto-claro);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.add-to-cart-btn:hover:not(:disabled) {
    background: var(--primary-dark);
}

.add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* =========================================
   ESTILOS DE BADGES - ACTUALIZADOS
   ========================================= */

/* Mover badges DEBAJO de la imagen */
.product-badges {
    position: relative; /* Cambio de absolute a relative */
    top: auto;
    left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    z-index: 10;
    margin: 8px 0; /* Espacio arriba y abajo */
    justify-content: center; /* Centrar badges */
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--texto-claro);
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-oferta {
    background-color: #e63946; /* Rojo para ofertas */
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.badge-destacado {
    background-color: #0d6ea7; /* Azul oscuro para destacado */
}

.badge-destacado i {
    color: #ffd700; /* Estrella dorada */
}

.badge-agotado {
    background-color: #6c757d; /* Gris para agotado */
}

.badge-bajo-stock {
    background-color: #ffc107; /* Amarillo para bajo stock */
    color: #343a40;
    animation: parpadeo 1.5s ease-in-out infinite;
}

@keyframes parpadeo {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Ajustar estructura de la tarjeta de producto */
.product-card {
    background: var(--texto-claro);
    padding: 0.8rem;
    border-radius: var(--radius);
    position: relative;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-top: 6px solid;
    border-image: linear-gradient(90deg, var(--primary), var(--accent)) 1;
    display: flex;
    flex-direction: column;
}

/* La imagen va primero */
.product-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    order: 1; /* Primer elemento */
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius);
    transition: transform 0.3s ease;
}

.product-card:hover img {
    transform: scale(1.03);
}

/* Badges van después de la imagen */
.product-badges {
    order: 2; /* Segundo elemento */
}

/* Link y título */
.product-card a.product-link {
    text-decoration: none;
    color: inherit;
    display: contents; /* Permite que los hijos mantengan el orden */
}

.product-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.3rem 0;
    transition: color 0.2s ease;
    order: 3; /* Tercer elemento */
}

/* Contenedor de precio */
.precio-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
    height: 25px;
    order: 4; /* Cuarto elemento */
}
/* Precio normal (cuando NO hay oferta) */
.precio {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

/* Precio original TACHADO (cuando hay oferta) */
.precio-original-tachado {
    font-size: 1.1rem;
    font-weight: 500;
    color: #95a5a6;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: #e74c3c;
    margin: 0;
    opacity: 0.7;
}

/* Precio de OFERTA (precio con descuento) */
.precio-oferta {
    font-size: 1.5rem;
    font-weight: 800;
    color: #e74c3c;
    margin: 0;
    animation: pulse-price 2s ease-in-out infinite;
}

/* Animación sutil para el precio de oferta */
@keyframes pulse-price {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Badge de oferta mejorado */
.badge-oferta {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    }
    50% {
        box-shadow: 0 4px 12px rgba(231, 76, 60, 0.5);
    }
}

/* Responsive: ajustar tamaños en móviles */
@media (max-width: 768px) {
    .precio-container {
        gap: 8px;
    }
    
    .precio-original-tachado {
        font-size: 1rem;
    }
    
    .precio-oferta {
        font-size: 1.3rem;
    }
    
    .precio {
        font-size: 1.2rem;
    }
}

/* Variante alternativa: Precios en columna */
.precio-container.vertical {
    flex-direction: column;
    gap: 4px;
}

.precio-container.vertical .precio-original-tachado {
    font-size: 0.95rem;
    order: 1;
}

.precio-container.vertical .precio-oferta {
    font-size: 1.4rem;
    order: 2;
}

/* Ahorro visible */
.ahorro-badge {
    background: #27ae60;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 5px;
}

/* Estilo para el carrito también */
.cart-item-info .precio-original-tachado {
    font-size: 0.9rem;
    text-decoration: line-through;
    color: #95a5a6;
}

.cart-item-info .precio-oferta {
    font-size: 1.1rem;
    color: #e74c3c;
    font-weight: 700;
}
/* Tallas */
.tallas {
    margin-bottom: 0.8rem;
    order: 5; /* Quinto elemento */
}

/* Botón de agregar */
.add-to-cart-btn {
    background: var(--primary);
    border: none;
    color: var(--texto-claro);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    order: 6; /* Sexto elemento */
}

/* Estado agotado - Mantener overlay en la imagen */
.product-card.producto-agotado {
    border-image: none;
    border-top: 6px solid var(--gris-borde);
    opacity: 0.7;
}

.product-image-wrapper.image-agotado img {
    filter: grayscale(100%);
}

.overlay-agotado {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--texto-claro);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    pointer-events: none;
}

/* Ocultar badge AGOTADO cuando hay overlay (evitar duplicación) */
.product-card.producto-agotado .badge-agotado {
    display: none;
}

/* =========================================
   RESPONSIVE - Badges en móvil
   ========================================= */
@media (max-width: 768px) {
    .product-badges {
        gap: 3px;
        margin: 5px 0;
    }
    
    .badge {
        padding: 3px 7px;
        font-size: 0.7rem;
    }
    
    .product-card img {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .badge {
        padding: 2px 5px;
        font-size: 0.65rem;
    }
}
/* =========================================
   7. MODALES Y PANEL DE CARRITO
   ========================================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.open, .modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--texto-claro);
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content, .modal.open .modal-content {
    transform: translateY(0);
}

.modal-title {
    font-size: 1.8em;
    color: var(--dark);
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
    margin: 15px 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--gris-borde);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--primary);
}

#checkoutOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

#checkoutOverlay.show {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 10px;
}

.checkout-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.checkout-form .form-group {
    margin-bottom: 0;
}

.checkout-form .full-width {
    grid-column: 1 / -1;
}

.checkout-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.checkout-form label.required::after {
    content: " *";
    color: var(--error);
}

.checkout-form input[type="text"],
.checkout-form input[type="email"],
.checkout-form input[type="tel"],
.checkout-form select,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radius);
    transition: border-color 0.2s ease;
    font-size: 1rem;
    box-sizing: border-box;
}

.checkout-form input:focus,
.checkout-form select:focus,
.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.btn-pagar, .btn-submit, .btn-primary {
    background: var(--primary);
    color: var(--texto-claro);
    padding: 12px 25px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 15px;
    font-size: 1.1rem;
}

.btn-pagar:hover, .btn-submit:hover, .btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.login-form .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-form .input-wrapper i {
    position: absolute;
    left: 15px;
    color: #999;
    font-size: 1rem;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 0.8rem 0.8rem 0.8rem 45px;
    border: 1px solid var(--gris-borde);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--dark);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.login-form .text-links {
    margin-top: 1.5rem;
    font-size: 0.95rem;
}

.login-form .text-links a {
    color: var(--primary);
    font-weight: 500;
    transition: color 0.2s ease;
}

.login-form .text-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.modal-logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.modal-logo span {
    color: var(--dark);
}

/* Panel de Carrito */
.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--texto-claro);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s ease-in-out, visibility 0s 0.3s;
}

.cart-panel.open, .cart-panel.active {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.3s ease-in-out, visibility 0s;
}

.cart-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    border-bottom: 2px solid #ddd;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.cart-panel-header h3 {
    font-size: 1.2rem;
    margin: 0;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #555;
    padding: 5px;
    transition: color 0.3s ease;
}

.close-cart:hover {
    color: var(--primary);
}

.cart-items {
    flex-grow: 1;
    padding: 0;
    overflow-y: auto;
    list-style: none;
    margin: 0;
}

.cart-item-with-image {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-details {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
}

.cart-item-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    line-height: 1.3;
}

.item-name {
    font-weight: 500;
    color: var(--dark);
}

.item-price-subtotal {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85em;
}

.remove-item {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
    transition: color 0.2s;
    height: 1.2rem;
    line-height: 1;
}

.remove-item:hover {
    color: #c00;
}

.empty-cart {
    text-align: center;
    color: #888;
    margin-top: 2rem;
    padding: 20px 0;
}

.cart-footer {
    padding: 15px 0 0;
    border-top: 2px solid #ddd;
    text-align: center;
}

.cart-total {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

.checkout-btn {
    width: 100%;
    padding: 12px;
    margin-top: 0;
    background: var(--primary);
    color: var(--texto-claro);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.checkout-btn:hover:not([disabled]) {
    background: var(--primary-dark);
}

.checkout-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* =========================================
   8. TOASTS Y FOOTER
   ========================================= */
/* =========================================
8. TOASTS Y FOOTER - MODIFICADO PARA INFERIOR DERECHA
========================================= */
.toast-container {
 position: fixed;
 bottom: 20px; /* <-- CAMBIO CLAVE: Fija la posición a 20px del borde INFERIOR */
 right: 20px; /* Mantiene la posición derecha */
 top: auto; /* Asegura que 'top' no interfiera */
 z-index: 1000;
 display: flex;
 /* Esto hace que el elemento más nuevo (añadido al final) se muestre ABAJO de los anteriores, fluyendo hacia arriba */
 flex-direction: column-reverse;
 gap: 10px;
}

.toast {
 background: #333;
 color: var(--texto-claro);
 padding: 1rem 1.5rem;
 border-radius: 8px;
 margin-bottom: 10px;
 box-shadow: 0 4px 8px rgba(0,0,0,0.1);
 opacity: 0;
 /* También debes actualizar la transición para que se deslice desde la derecha */
 transform: translateX(100%); 
 transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.toast.show {
 opacity: 1;
 transform: translateX(0);
}

.toast.success {
 background-color: #28a745;
}

.toast.error {
 background-color: var(--error);
}

.toast.info {
 background-color: #007bff;
}

footer {
    background: #1c2331;
    color: #ccc;
    padding: 3rem 10%;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-content h4 {
    color: var(--texto-claro);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-content ul li {
    margin-bottom: 0.5rem;
}

.footer-content a {
    color: #ccc;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: var(--primary);
}

.social-icons a {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 1rem;
    font-size: 0.9rem;
    color: #888;
}

/* =========================================
   9. PAGINACIÓN (CORREGIDA)
   ========================================= */
.paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 20px 0;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    background: var(--texto-claro);
    border: 2px solid var(--gris-borde);
    border-radius: 6px;
    color: var(--dark);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background: var(--gris-claro);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: var(--primary);
    color: var(--texto-claro);
    border-color: var(--primary);
    pointer-events: none;
}

/* =========================================
   10. ESTILOS DE BOLD
   ========================================= */
.bold-payment-wrapper {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bold-loading-message {
    text-align: center;
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-back-to-form {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
    max-width: 200px;
}

.btn-back-to-form:hover {
    background: #5a6268;
}

.btn-retry {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.btn-retry:hover {
    background: #0056b3;
}

/* =========================================
   11. MEDIA QUERIES (RESPONSIVE)
   ========================================= */

/* Tablets */
@media (max-width: 992px) {
    .navbar {
        padding: 1rem 3%;
    }
    
    .nav-links > ul > li > a {
        margin: 0 0.5rem;
    }
    
    .hero {
        padding: 3rem 5%;
    }
}

/* Móviles */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    /* MOSTRAR BOTÓN HAMBURGUESA */
    .menu-toggle {
        display: flex;
    }

    /* MENÚ DE NAVEGACIÓN MÓVIL */
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--primary);
        flex-direction: column;
        padding: 1rem 0;
        z-index: 999;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .nav-links > ul > li {
        width: 100%;
        text-align: left;
    }

    .nav-links > ul > li > a {
        display: block;
        padding: 1rem 1.5rem;
        margin: 0;
        color: var(--texto-claro);
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    /* Dropdowns en móvil */
    .dropdown-menu, .dropdown-submenu-list {
        position: static;
        min-width: 100%;
        box-shadow: none;
        padding: 0;
        border-radius: 0;
        background: var(--primary-dark);
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }

    .dropdown.open > .dropdown-menu,
    .dropdown-submenu.open > .dropdown-submenu-list {
        display: block;
    }

    .dropdown-menu li a, 
    .dropdown-submenu-list li a {
        padding: 0.8rem 2rem;
        background: var(--primary-dark);
        color: var(--texto-claro);
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .dropdown-menu li a:hover, 
    .dropdown-submenu-list li a:hover {
        background: rgba(255,255,255,0.1);
    }

    /* Bloquear scroll cuando menu abierto */
    body.menu-open {
        overflow: hidden;
    }

    /* Ocultar búsqueda en móvil */
    .cart input {
        display: none;
    }

    .cart {
        gap: 0.5rem;
    }

    /* Tienda en móvil */
    .tienda-container {
        grid-template-columns: 1fr;
        padding: 10px 5% 50px;
        gap: 1.5rem;
    }

    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .productos-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Hero en móvil */
    .hero, .hero-slide.show {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 2rem 5%;
    }

    .hero-img {
        order: -1;
    }

    .hero-img img {
        max-height: 250px;
        width: auto;
        margin: 0 auto;
    }

    .banner {
        padding: 3rem 5%;
    }

    /* Carrito en móvil */
    .cart-panel {
        max-width: 90%;
    }

    /* Checkout en móvil */
    .checkout-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .checkout-form .form-group {
        margin-bottom: 15px;
    }

    .checkout-form .full-width {
        grid-column: 1 / 1;
    }

    .modal-content {
        max-width: 95%;
        padding: 1.5rem;
    }

    /* Paginación en móvil */
    .paginacion {
        gap: 4px;
        flex-wrap: wrap;
    }

    .pagination-btn {
        min-width: 35px;
        height: 35px;
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}

/* Estilos para el resumen del carrito */
.cart-subtotal-line,
.cart-envio-line {
    padding: 12px 15px;
    border-top: 1px solid #eee;
    list-style: none;
}

.cart-subtotal-line {
    background-color: #f8f9fa;
}

.cart-envio-line {
    background-color: #e8f4f8;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #333;
}

.cart-envio-line .cart-summary-row {
    color: #0066cc;
}

/* Ajustar el footer del carrito */
.cart-footer {
    border-top: 2px solid #333;
    padding-top: 15px;
}

.cart-total {
    font-size: 1.3rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 15px;
}
/* Móviles pequeños */
@media (max-width: 480px) {
    .product-card {
        padding: 0.5rem;
    }

    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .product-card img {
        height: 140px;
    }

    .hero-text h1 {
        font-size: 1.8rem;
    }

    .banner-content h3 {
        font-size: 1.8rem;
    }
}
/* Estados de Pedidos */
.estado-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.estado-badge.pendiente,
.estado-select.pendiente {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

.estado-badge.procesando,
.estado-select.procesando {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #17a2b8;
}

.estado-badge.enviado,
.estado-select.enviado {
    background: #cfe2ff;
    color: #084298;
    border-color: #0d6efd;
}

.estado-badge.entregado,
.estado-select.entregado {
    background: #d1e7dd;
    color: #0f5132;
    border-color: #198754;
}

.estado-badge.cancelado,
.estado-select.cancelado {
    background: #f8d7da;
    color: #842029;
    border-color: #dc3545;
}

/* Estilos para select de estado */
.estado-select {
    padding: 0.5rem;
    border: 2px solid;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.estado-select:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.estado-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 110, 167, 0.25);
}

/* Badges de clientes */
.badge-cliente {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.badge-vip {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.badge-nuevo {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.badge-inactivo {
    background: #95a5a6;
    color: white;
}

/* Botón filtrar */
.btn-filtrar {
    padding: 0.7rem 1.5rem;
    background: #0d6ea7;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-filtrar:hover {
    background: #095a8a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 167, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .filtros-grid {
        grid-template-columns: 1fr !important;
    }
    
    .detalle-container {
        grid-template-columns: 1fr !important;
    }
    
    .producto-card {
        flex-direction: column;
    }
    
    .acciones-rapidas {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-accion {
        width: 100%;
        justify-content: center;
    }
}