/* --- CONFIGURACIÓN GENERAL Y VARIABLES --- */
:root {
    --color-dark: #121212;
    --color-light: #FFFFFF;
    --color-gray: #f5f5f7;
    --font-main: 'Manrope', sans-serif;
    --header-height: 80px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-light);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }


/* ================== COMPONENTES REUTILIZABLES ================== */

/* --- Separador de Sección con Degradado --- */
.section-separator {
    position: relative;
    padding-bottom: 4rem;
}

.section-separator::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 1200px;
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
}


/* ================== ENCABEZADO Y MENÚ ================== */
.main-header {
    background-color: var(--color-light);
    border-bottom: 1px solid #e5e5e5;
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav ul { display: flex; align-items: center; gap: 2rem; height: 100%; }
.main-nav a {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    padding: 5px 0;
    position: relative;
    text-decoration: none;
    transition: color 0.3s ease;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-dark);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}
.main-nav a:hover::after {
    transform: scaleX(1);
}
.main-nav a:hover {
    color: var(--color-dark);
}

.logo { font-size: 1.8rem; font-weight: 800; letter-spacing: 2px; }
.header-icons { display: flex; align-items: center; gap: 1.5rem; }
.mobile-header-right { display: none; align-items: center; gap: 1rem; }
.hamburger-menu { background: none; border: none; font-size: 2rem; cursor: pointer; }

/* --- Menú Desplegable --- */
.dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}
.dropdown-menu {
    opacity: 0; visibility: hidden; position: absolute; top: 100%; left: 0;
    transform: translateY(10px); background-color: var(--color-light);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); border: 1px solid #e5e5e5;
    border-top: 2px solid var(--color-dark); padding: 0.5rem 0; min-width: 220px;
    z-index: 1001; display: flex; flex-direction: column;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
.dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu li { opacity: 0; transform: translateX(-15px); transition: opacity 0.3s ease, transform 0.3s ease; }
.dropdown:hover .dropdown-menu li:nth-child(1) { transition-delay: 0.05s; }
.dropdown:hover .dropdown-menu li:nth-child(2) { transition-delay: 0.10s; }
.dropdown:hover .dropdown-menu li:nth-child(3) { transition-delay: 0.15s; }
.dropdown:hover .dropdown-menu li:nth-child(4) { transition-delay: 0.20s; }
.dropdown:hover .dropdown-menu li:nth-child(5) { transition-delay: 0.25s; }
.dropdown:hover .dropdown-menu li:nth-child(6) { transition-delay: 0.30s; }
.dropdown-menu a { font-weight: 400; font-size: 1rem; color: #444; display: block; padding: 0.8rem 1.5rem; transition: color 0.2s ease, background-color 0.2s ease; }
.dropdown-menu a:hover { color: var(--color-dark); background-color: var(--color-gray); }

/* ================== SECCIÓN DE CATEGORÍAS (ESTILO FINAL CON <img> Y ZOOM CORRECTO) ================== */
.category-grid-section {
    padding: 4rem 0; /* Espacio vertical para la sección */
    background-color: var(--color-gray); /* Fondo gris claro como en la imagen de referencia */
}

.category-grid-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem; /* El espacio entre las imágenes */
}

/* El panel (<a>) actúa como el contenedor y el marco */
.category-grid-panel {
    position: relative; /* Base para el contenido superpuesto */
    display: block; /* Comportamiento de bloque para el enlace */
    overflow: hidden; /* ¡CLAVE! Recorta la imagen que se agranda */
}

/* La imagen es la que se agranda */
.category-grid-panel img {
    display: block; /* Elimina espacios extra debajo de la imagen */
    width: 100%;
    height: 100%;
    object-fit: cover; /* Rellena el espacio sin deformarse */
    aspect-ratio: 18 / 12; /* Proporción de aspecto, controla la altura */

    /* TRANSICIÓN DE SALIDA: Rápida al quitar el cursor */
    transition: transform 0.5s ease-out;
}

/* El efecto de hover */
.category-grid-panel:hover img {
    /* TRANSICIÓN DE ENTRADA: Lenta al poner el cursor */
    transition-duration: 8s;
    transform: scale(1.05); /* Zoom sutil del 5% */
}

/* El contenido (texto y botón) se superpone a la imagen */
.category-grid-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    z-index: 2;
    /* Degradado sutil para asegurar que el texto sea legible sobre cualquier imagen */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 80%);
}

.category-grid-content h3 {
    color: var(--color-light);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.category-grid-button {
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--color-dark);
    padding: 0.8rem 2.5rem;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
    display: inline-block;
    transition: all 0.3s ease;
}

.category-grid-panel:hover .category-grid-button {
    background-color: var(--color-light);
}

/* --- Responsividad --- */
@media (max-width: 900px) {
    .category-grid-container {
        grid-template-columns: 1fr; /* Una columna para tablet y móvil */
    }
}

/* ================== SLIDER ================== */
@keyframes kenBurnsZoomOut { from { transform: scale(1.1); } to { transform: scale(1); } }
.slider-section { width: 100%; height: calc(100vh - var(--header-height)); position: relative; }
.slider-container { width: 100%; height: 100%; overflow: hidden; position: relative; }
.slider-track { display: flex; height: 100%; transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1); }
.slide { width: 100%; height: 100%; flex-shrink: 0; display: flex; justify-content: center; align-items: center; text-align: center; color: var(--color-light); position: relative; overflow: hidden; }
.slide::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.4); z-index: 1; }
.slide::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; background-image: inherit; z-index: 0; }
.slide.active-slide::after { animation: kenBurnsZoomOut 7s ease-out forwards; }
.slide-content { position: relative; z-index: 2; }
.slide-content h1, .slide-content h2 { font-size: 3.5rem; font-weight: 800; margin-bottom: 1.5rem; text-shadow: 2px 2px 8px rgba(0,0,0,0.5); }
.cta-button { background-color: var(--color-light); color: var(--color-dark); padding: 1rem 2.5rem; font-weight: 700; border: 2px solid var(--color-light); transition: all 0.3s ease; }
.cta-button:hover { background-color: transparent; color: var(--color-light); }
.slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); background-color: rgba(255, 255, 255, 0.7); border: none; border-radius: 50%; width: 50px; height: 50px; font-size: 2rem; font-weight: bold; color: var(--color-dark); cursor: pointer; z-index: 10; transition: background-color 0.3s ease; }
.slider-arrow:hover { background-color: var(--color-light); }
.prev { left: 2rem; }
.next { right: 2rem; }


/* ================== SECCIÓN "LO MÁS VENDIDO" ================== */
.product-showcase { background-color: var(--color-gray); padding: 4rem 0; }
.section-title { text-align: center; font-size: 1.5rem; letter-spacing: 4px; font-weight: 700; margin-bottom: 3rem; color: #555; }
.showcase-container { position: relative; max-width: 1400px; margin: 0 auto; }
.product-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 1.5rem; padding: 1rem 2rem; scrollbar-width: none; }
.product-grid::-webkit-scrollbar { display: none; }
.product-card { flex: 0 0 auto; width: 90%; max-width: 344px; aspect-ratio: 344 / 460; display: flex; flex-direction: column; background-color: var(--color-light); scroll-snap-align: start; overflow: hidden; }
.product-card a { display: flex; flex-direction: column; height: 100%; text-align: center; }
.product-card img { width: 100%; height: 100%; object-fit: cover; flex-grow: 1; min-height: 0; background-color: #e9e9e9; transition: transform 0.4s ease-out; }
.product-card:hover img { transform: scale(1.1); }
.product-info { padding: 1rem; }
.product-category { font-size: 0.8rem; color: #888; }
.product-name { font-size: 1rem; font-weight: 700; margin: 0.25rem 0; }
.product-price { font-size: 0.9rem; color: #555; }
.showcase-arrow { position: absolute; top: 50%; transform: translateY(-50%); background-color: var(--color-light); border: 1px solid #ddd; border-radius: 50%; width: 45px; height: 45px; font-size: 1.8rem; cursor: pointer; z-index: 10; box-shadow: 0 2px 5px rgba(0,0,0,0.1); display: flex; justify-content: center; align-items: center; }
.showcase-prev { left: 0; }
.showcase-next { right: 0; }

/* ================== PÁGINA DE PRODUCTO ================== */
.product-page-container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 4rem; max-width: 1400px; margin: 4rem auto; padding: 0 2rem; }
.product-gallery { display: flex; flex-direction: column; gap: 1rem; }
.main-image-container { overflow: hidden;}
.main-image-container img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background-color: #f0f0f0; cursor: pointer;transition: transform 0.5s ease;}
.main-image-container:hover img { transform: scale(1.1);}
.thumbnail-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 0.75rem; }
.thumbnail-image { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; cursor: pointer; border: 2px solid transparent; transition: border-color 0.3s ease; }
.thumbnail-image.active { border-color: var(--color-dark); }
.product-details h1 { font-size: 2rem; font-weight: 800; letter-spacing: 1px; margin-bottom: 0.5rem; }
.product-price { font-size: 1.5rem; color: #444; margin-bottom: 1rem; }
.product-subtext { font-size: 0.9rem; color: #666; }
.separator { border-top: 1px solid #e0e0e0; margin: 1.5rem 0; }
.variant-selector { margin-bottom: 1.5rem; }
.variant-selector label { display: block; margin-bottom: 0.75rem; font-weight: 700; font-size: 0.9rem; }
.variant-selector label span { font-weight: 400; }
.color-swatches-pdp { display: flex; gap: 0.75rem; }
.swatch-pdp { width: 35px; height: 35px; border: 1px solid #ccc; cursor: pointer; transition: transform 0.2s ease; }
.swatch-pdp.active { outline: 2px solid var(--color-dark); outline-offset: 3px; transform: scale(1.1); }
.size-buttons { display: flex; gap: 0.75rem; }
.size-btn { padding: 0.8rem 1.2rem; background-color: var(--color-light); border: 1px solid #ccc; cursor: pointer; font-weight: 700; transition: all 0.2s ease; }
.size-btn.active, .size-btn:hover { background-color: var(--color-dark); color: var(--color-light); border-color: var(--color-dark); }
.add-to-cart-btn { width: 100%; padding: 1rem; background-color: var(--color-dark); color: var(--color-light); border: none; font-weight: 700; font-size: 1rem; letter-spacing: 1px; cursor: pointer; margin-top: 1rem; transition: opacity 0.3s ease; }
.add-to-cart-btn:hover { opacity: 0.8; }
.product-description { font-size: 0.9rem; line-height: 1.6; color: #555;}
.product-description strong { color: #222; margin-bottom: 5px;}


/* ================== MODAL DE AUTENTICACIÓN ================== */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); z-index: 1100; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.auth-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -40%); background-color: var(--color-light); width: 90%; max-width: 400px; border-radius: 8px; box-shadow: 0 5px 25px rgba(0,0,0,0.2); z-index: 1110; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.auth-modal.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }
.close-modal-btn { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 2rem; color: #aaa; cursor: pointer; transition: color 0.2s; }
.close-modal-btn:hover { color: var(--color-dark); }
.auth-modal-content { padding: 2.5rem; }
.auth-modal-content h2 { text-align: center; margin-bottom: 2rem; font-size: 1.5rem; letter-spacing: 1px; }
.auth-form-group { margin-bottom: 1.25rem; }
.auth-form-group label { display: block; font-size: 0.9rem; font-weight: 700; margin-bottom: 0.5rem; }
.auth-form-group input { width: 100%; padding: 0.8rem; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; font-family: var(--font-main); }
.auth-form-group input:focus { outline: none; border-color: var(--color-dark); box-shadow: 0 0 0 2px rgba(18, 18, 18, 0.2); }
.auth-btn { width: 100%; padding: 1rem; background-color: var(--color-dark); color: var(--color-light); border: none; border-radius: 4px; font-weight: 700; font-size: 1rem; letter-spacing: 1px; cursor: pointer; margin-top: 1rem; transition: opacity 0.3s ease; }
.auth-btn:hover { opacity: 0.85; }
.form-toggler { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; }
.form-toggler a { color: var(--color-dark); font-weight: 700; text-decoration: underline; }
.hidden { display: none; }


/* ================== ESTILOS DEL CARRITO Y CHECKOUT ================== */
.cart-message { margin-top: 1rem; padding: 0.8rem; border-radius: 4px; text-align: center; font-weight: 700; }
.cart-message.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.cart-message.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.cart-icon-wrapper { position: relative; }
.cart-item-count { position: absolute; top: -8px; right: -8px; background-color: red; color: white; width: 20px; height: 20px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 0.75rem; font-weight: bold; }
.cart-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 1050; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.cart-overlay.active { opacity: 1; visibility: visible; }
.cart-panel { position: fixed; top: 0; right: 0; width: 100%; max-width: 450px; height: 100%; background-color: #f9f9f9; z-index: 1060; display: flex; flex-direction: column; box-shadow: -5px 0 15px rgba(0,0,0,0.1); transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1); }
.cart-panel.active { transform: translateX(0); }
.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem; border-bottom: 1px solid #e0e0e0; }
.cart-header h2 { font-size: 1.2rem; letter-spacing: 2px; }
.close-cart-btn { background: none; border: none; font-size: 2rem; cursor: pointer; color: #888; }
.cart-body { flex-grow: 1; overflow-y: auto; padding: 1.5rem; }
.cart-empty { text-align: center; margin-top: 5rem; color: #888; }
.cart-item { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.cart-item-image { width: 90px; height: 100%; object-fit: cover; background-color: #fff; }
.cart-item-details { flex-grow: 1; display: flex; flex-direction: column; }
.cart-item-details h4 { font-size: 0.9rem; margin: 0 0 0.25rem; }
.cart-item-details .item-meta { font-size: 0.8rem; color: #888; margin-bottom: 0.5rem; }
.cart-item-actions { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 0.5rem; }
.quantity-selector { display: flex; align-items: center; border: 1px solid #ccc; width: fit-content; }
.quantity-btn { background: none; border: none; padding: 0.3rem 0.8rem; font-size: 1.2rem; cursor: pointer; }
.quantity-input { width: 30px; text-align: center; border: none; border-left: 1px solid #ccc; border-right: 1px solid #ccc; padding: 0.3rem 0; }
.remove-item-btn { background: none; border: none; cursor: pointer; padding: 0.5rem; line-height: 0; opacity: 0.6; transition: opacity 0.2s ease; }
.remove-item-btn:hover { opacity: 1; }
.remove-item-btn svg { stroke: #555; }
.cart-footer { padding: 1.5rem; border-top: 1px solid #e0e0e0; background-color: #fff; }
.cart-subtotal { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.checkout-btn { display: block; width: 100%; padding: 1rem; background-color: var(--color-dark); color: var(--color-light); text-align: center; font-weight: 700; transition: opacity 0.3s; }
.checkout-btn:hover { opacity: 0.85; }
body.checkout-page { background-color: var(--color-light); }
.checkout-container { display: flex; flex-wrap: wrap; min-height: 100vh; }
.checkout-form-section { flex: 1 1 55%; padding: 3rem 5%; border-right: 1px solid #e0e0e0; }
.checkout-summary-section { flex: 1 1 45%; padding: 3rem 5%; background-color: #fafafa; }
.checkout-logo { text-align: center; font-size: 2rem; letter-spacing: 2px; margin-bottom: 3rem; }
.checkout-title { font-size: 1.2rem; margin-bottom: 1.5rem; }
#checkout-form h3 { margin-top: 2rem; margin-bottom: 1rem; font-size: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group-row { display: flex; gap: 1rem; }
.form-group-row .form-group { flex: 1; }
.form-group label { display: block; font-size: 0.8rem; margin-bottom: 0.5rem; color: #555; }
.form-group input { width: 100%; padding: 0.8rem; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; }
.form-group input:read-only { background-color: #eee; cursor: not-allowed; }
.checkout-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }
.return-link { color: var(--color-dark); text-decoration: none; font-size: 0.9rem; }
.checkout-submit-btn { padding: 1rem 1.5rem; background-color: var(--color-dark); color: var(--color-light); border: none; border-radius: 4px; font-weight: 700; cursor: pointer; }
.summary-item { display: flex; align-items: center; gap: 1rem; padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid #e0e0e0; position: relative; }
.summary-item:last-child { border-bottom: none; }
.summary-item-image { position: relative; }
.summary-item-image img { width: 65px; height: 80px; object-fit: cover; border-radius: 4px; }
.summary-item-quantity { position: absolute; top: -8px; right: -8px; background-color: #555; color: white; width: 22px; height: 22px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 0.8rem; }
.summary-item-info { flex-grow: 1; }
.summary-item-info h4 { font-size: 0.9rem; }
.summary-item-info span { font-size: 0.8rem; color: #666; }
.summary-item-price { font-weight: 700; }
.summary-remove-btn { background: none; border: none; font-size: 1.5rem; color: #aaa; cursor: pointer; padding: 0 0.5rem; margin-left: 0.5rem; transition: color 0.2s; }
.summary-remove-btn:hover { color: var(--color-dark); }
.summary-totals { border-top: 1px solid #ddd; padding-top: 1rem; margin-top: 1rem; }
.total-row { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.total-row.grand-total { font-size: 1.2rem; font-weight: 700; margin-top: 1rem; }


/* ================== FOOTER ================== */
.main-footer { background-color: var(--color-dark); color: #a0a0a0; padding: 4rem 2rem 2rem; font-size: 0.9rem; }
.footer-container { max-width: 1400px; margin: 0 auto 3rem auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.footer-column h4 { color: var(--color-light); font-size: 1rem; margin-bottom: 1.5rem; letter-spacing: 1px; }
.footer-column ul { list-style: none; padding: 0; }
.footer-column li { margin-bottom: 0.75rem; }
.footer-column a { text-decoration: none; color: #a0a0a0; transition: color 0.3s ease; }
.footer-column a:hover { color: var(--color-light); text-decoration: underline; }
.footer-column p { line-height: 1.6; }
.social-icons { display: flex; gap: 1.5rem; margin-top: 1.5rem; }
.social-icons a { color: #a0a0a0; }
.social-icons a:hover { color: var(--color-light); }
.newsletter-form { display: flex; margin-top: 1.5rem; border: 1px solid #555; border-radius: 4px; overflow: hidden; }
.newsletter-form input { flex-grow: 1; border: none; background: transparent; padding: 0.8rem; color: var(--color-light); min-width: 0; }
.newsletter-form input:focus { outline: none; background-color: #333; }
.newsletter-form button { background: #555; color: var(--color-light); border: none; padding: 0.8rem 1rem; cursor: pointer; font-size: 1.5rem; transition: background-color 0.3s; }
.newsletter-form button:hover { background-color: #777; }
.footer-bottom { max-width: 1400px; margin: 0 auto; padding-top: 2rem; border-top: 1px solid #444; text-align: center; font-size: 0.8rem; color: #777; }


/* ================== DISEÑO RESPONSIVO ================== */
@media (max-width: 900px) {
    .product-page-container { grid-template-columns: 1fr; gap: 2rem; margin-top: 2rem; }
    .category-grid-container { grid-template-columns: 1fr; }
    .category-grid-panel { height: 400px; }
    .footer-container { grid-template-columns: repeat(2, 1fr); gap: 3rem; }
    .checkout-container { flex-direction: column-reverse; }
    .checkout-form-section { border-right: none; }
}

@media (max-width: 768px) {
    .main-nav, .header-icons { display: none; }
    .mobile-header-right { display: flex; }
    .logo { margin-right: auto; }
    .header-container { justify-content: flex-end; position: relative; }
    .logo { position: absolute; left: 50%; transform: translateX(-50%); }
    .main-nav.active { display: block; position: absolute; top: var(--header-height); left: 0; width: 100%; background-color: var(--color-light); border-bottom: 1px solid #e5e5e5; }
    .main-nav.active ul { flex-direction: column; align-items: flex-start; padding: 1rem; height: auto; }
    .dropdown { height: auto; }
    .dropdown-menu { display: none !important; position: static; border: none; box-shadow: none; padding: 0.5rem 0 0 1rem; opacity: 1; visibility: visible; transform: none; flex-direction: column; gap: 0.8rem; background-color: transparent; transition: none; }
    .dropdown.active .dropdown-menu { display: flex !important; }
    .dropdown-menu li { opacity: 1; transform: none; transition: none; }
    .product-card { width: 80%; }
    .showcase-arrow { display: none; }
}

@media (max-width: 600px) {
    .footer-container { grid-template-columns: 1fr; }
    .footer-column { text-align: center; }
    .social-icons { justify-content: center; }
}
/* ================== PÁGINA DE CATEGORÍAS Y FILTROS ================== */
.category-page-container {
    display: grid;
    grid-template-columns: 280px 1fr; /* Columna fija para filtros, el resto para productos */
    gap: 2rem;
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* --- Sidebar de Filtros --- */
.filters-sidebar {
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    align-self: start; /* Evita que el sidebar se estire */
}
.filters-sidebar h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}
.filter-group {
    margin-bottom: 2rem;
}
.filter-group h4 {
    margin-bottom: 1rem;
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}
.filter-option input[type="checkbox"] {
    margin-right: 0.5rem;
}

.size-filter {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}
.filter-option-size label {
    display: block;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid #ccc;
    cursor: pointer;
    transition: all 0.2s ease;
}
.filter-option-size input[type="checkbox"] {
    display: none; /* Ocultamos el checkbox real */
}
.filter-option-size input[type="checkbox"]:checked + label {
    background-color: var(--color-dark);
    color: var(--color-light);
    border-color: var(--color-dark);
}

#apply-filters-btn {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--color-dark);
    color: var(--color-light);
    border: none;
    font-weight: 700;
    cursor: pointer;
}

/* --- Cuadrícula de Productos --- */
.products-grid-section {
    width: 100%;
}
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
}
.products-header h1 {
    font-size: 1.8rem;
}
.products-header span {
    color: #888;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card-category {
    background-color: var(--color-light);
    text-align: center;
    overflow: hidden;
}
.product-card-category img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.product-card-category:hover img {
    transform: scale(1.05);
}
.product-card-category .product-info {
    padding: 1rem;
}
.product-colors {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.5rem;
    display: block;
}

/* --- Responsividad para la página de categorías --- */
@media (max-width: 900px) {
    .category-page-container {
        grid-template-columns: 1fr; /* Una sola columna */
    }
    .filters-sidebar {
        /* En un futuro, esto podría ser un modal o un acordeón colapsable */
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}
/* ================== PÁGINA DE CONTACTO ================== */
.contact-page-wrapper {
    max-width: 800px;
    margin: 4rem auto;
    padding: 2rem;
}
.contact-container {
    background-color: #fff;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.contact-container h1 {
    text-align: center;
    margin-bottom: 1rem;
}
.contact-container p {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}
.contact-form .form-group {
    margin-bottom: 1.5rem;
}
.contact-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.btn-submit-contact {
    width: 100%;
    padding: 1rem;
    background: var(--color-dark);
    color: var(--color-light);
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}
.form-message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    text-align: center;
    font-weight: 700;
}
.form-message.success {
    background-color: #d4edda;
    color: #155724;
}
.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
}
/* ================== SECCIÓN DE PRODUCTOS RELACIONADOS Y VISTOS ================== */
.related-products-section {
    max-width: 1600px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.tabs-container {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 2.5rem; /* Aumentamos el espacio */
}

.tab-button {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    color: #888;
    transform: translateY(1px);
    transition: all 0.3s ease;
}

.tab-button.active {
    border-bottom-color: var(--color-dark);
    color: var(--color-dark);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- ESTA ES LA REGLA CLAVE QUE CORRIGE EL DISEÑO --- */
.product-grid-related {
    display: grid;
    /* Creamos 4 columnas en pantallas grandes */
    grid-template-columns: repeat(4, 1fr); 
    gap: 1.5rem;
}

/* Hacemos la cuadrícula responsiva */
@media (max-width: 1200px) {
    .product-grid-related {
        grid-template-columns: repeat(3, 1fr); /* 3 columnas en tablet */
    }
}
@media (max-width: 768px) {
    .product-grid-related {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en móvil */
    }
}
/* --- Estilos para los Mensajes del Newsletter Footer --- */
.form-message-footer {
    padding-top: 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    min-height: 1.2em; /* Para evitar que el layout salte */
}
.form-message-footer.success {
    color: #28a745; /* Verde */
}
.form-message-footer.error {
    color: #dc3545; /* Rojo */
}
@media (max-width: 530px) {
    .tab-button{
        font-size: 0.8rem;
    }
}
@media (max-width: 459px) {
    .tab-button{
        font-size: 0.7rem;
    }
}
/* ================== GUÍA DE TALLAS ================== */
.size-guide-wrapper {
    margin-top: 1rem;
    text-align: left;
}
.size-guide-btn {
    background: none;
    border: none;
    color: var(--color-dark);
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    font-size: 0.9rem;
}
.size-guide-btn svg {
    stroke: var(--color-dark);
}

#size-guide-modal .modal-body {
    padding: 1.5rem 2rem;
}

.size-guide-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}
.size-guide-table th, .size-guide-table td {
    border: 1px solid #e0e0e0;
    padding: 0.8rem;
}
.size-guide-table th {
    background-color: #f8f8f8;
    font-weight: 700;
}
/* ================== ESTILOS GLOBALES PARA MODALES ================== */

/* El fondo oscuro */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    
    /* ESTADO INICIAL: Oculto */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* El contenedor principal del modal */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%); /* Empieza un poco arriba para la animación */
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 1001;
    width: 90%;
    max-width: 600px; /* Ancho por defecto para modales */
    
    /* ESTADO INICIAL: Oculto */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* --- ESTADOS ACTIVOS --- */
.modal-overlay.active,
.modal.active {
    opacity: 1;
    visibility: visible;
}
.modal.active {
    transform: translate(-50%, -50%); /* Termina perfectamente centrado */
}


/* --- Partes internas del modal (Header, Body, Footer) --- */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}
.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
}
.close-modal-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
}
.modal-body {
    padding: 1.5rem;
    max-height: 70vh; /* Para que el contenido sea scrollable si es muy largo */
    overflow-y: auto;
}
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

/* Hacemos el modal de variantes más ancho */
#variants-modal {
    max-width: 900px;
}