/* public/css/frontend.css */

/* Variables de Color y Estilo */
:root {
    --color-background: #000000;
    --color-text-primary: #ffffff;
    --color-text-secondary: #a0a0a0;
    --color-border: #333;
    --font-primary: 'Inter', sans-serif;
    --header-height: 80px;
}

/* Reseteo y Estilos Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-primary); color: var(--color-text-primary); background-color: var(--color-background); line-height: 1.6; }
body::before { content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-image: url('../img/logo-fondo.png'); background-attachment: fixed; background-position: center center; background-repeat: no-repeat; background-size: 35vw; opacity: 0.08; z-index: -1; }

/* === HEADER Y NAVEGACIÓN (ESTILOS BASE PARA ESCRITORIO) === */
.main-header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 5%; height: var(--header-height); border-bottom: 1px solid var(--color-border); background-color: rgba(0, 0, 0, 0.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; }
.header-left, .header-right { display: flex; align-items: center; gap: 1.5rem; flex: 1; }
.header-left { justify-content: flex-start; }
.header-right { justify-content: flex-end; }
.header-center { flex-grow: 1; text-align: center; display: flex; align-items: center; justify-content: center; gap: 3rem; }
.header-logo { height: 60px; width: auto; display: block; }

.main-nav ul { list-style: none; display: flex; gap: 2rem; padding: 0; }
.main-nav a { text-decoration: none; color: var(--color-text-primary); font-weight: bold; font-size: 0.9rem; }

.hamburger-menu { display: none; } /* Oculto en escritorio */
.search-form { display: flex; border: 1px solid #444; border-radius: 5px; background-color: #333; }
.search-form input { border: none; padding: 0.5rem; background-color: transparent; color: var(--color-text-primary); }
.search-form input::placeholder { color: #888; }
.search-form button { background: none; border: none; padding: 0 0.5rem; cursor: pointer; color: var(--color-text-primary); }
.header-icon { text-decoration: none; color: var(--color-text-primary); position: relative; display: flex; align-items: center; }
.header-icon i { margin-right: 8px; font-size: 1.2rem; }
#cart-count { background-color: var(--color-text-primary); color: var(--color-background); border-radius: 50%; padding: 0.1em 0.5em; font-size: 0.8rem; font-weight: bold; margin-left: 8px; }

/* === MAIN CONTENT, HERO, BOTONES, etc. === */
main { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; position: relative; z-index: 5; padding-top: var(--header-height); }
.hero-carousel { position: relative; width: 100%; height: 75vh; overflow: hidden; padding-top: var(--header-height); }
.hero-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; display: flex; justify-content: center; align-items: center; text-align: center; opacity: 0; transition: opacity 1s ease-in-out; z-index: 1; }
/* --- INICIO DE LA CORRECCIÓN --- */
.hero-slide:first-child, .hero-slide.active { opacity: 1; z-index: 2; }
/* --- FIN DE LA CORRECCIÓN --- */
.hero-slide::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); }
.hero-content { position: relative; z-index: 3; color: var(--color-text-primary); }
.hero-content h1 { font-size: 4rem; font-weight: 300; letter-spacing: 2px; }
.carousel-dots { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; transition: background 0.3s ease; }
.dot.active { background: #fff; }
.btn { padding: 0.8rem 2rem; border: 1px solid var(--color-text-primary); cursor: pointer; text-decoration: none; display: inline-block; margin-top: 1rem; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; transition: all 0.3s ease; }
.btn-primary { background-color: transparent; color: var(--color-text-primary); }
.btn-primary:hover { background-color: var(--color-text-primary); color: var(--color-background); }

/* === SECCIÓN DE CATEGORÍAS DESTACADAS === */
.featured-categories { display: flex; width: 100vw; position: relative; left: 50%; transform: translateX(-50%); margin: 3rem 0; }
.category-card { flex: 1 1 50%; position: relative; min-height: 70vh; overflow: hidden; display: flex; justify-content: center; align-items: center; text-decoration: none; color: var(--color-text-primary); }
.category-card .card-background-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; filter: brightness(0.8); transition: transform 0.5s ease-in-out, filter 0.5s ease-in-out; }
.category-card:hover .card-background-image { transform: scale(1.05); filter: brightness(0.6); }
.category-card .card-content { position: relative; z-index: 2; text-align: center; padding: 1rem; }
.category-card h3 { font-size: 2.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; text-shadow: 2px 2px 8px rgba(0,0,0,0.7); }

/* === SECCIÓN PRODUCTOS DESTACADOS Y GRID === */
.featured-products { text-align: center; margin-bottom: 3rem; padding-top: 3rem; }
.featured-products h2 { font-size: 1.8rem; margin-bottom: 1.5rem; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem 1.5rem; }
.product-card .product-link { text-decoration: none; color: inherit; display: block; }
.product-card .product-image-wrapper { overflow: hidden; }
.product-card img { width: 100%; height: 400px; object-fit: cover; display: block; transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.product-card:hover img { transform: scale(1.05); }
.product-card .product-info-wrapper { padding-top: 1rem; text-align: left; }
.product-card h4 { font-size: 1rem; font-weight: 400; margin-bottom: 0.25rem; color: var(--color-text-secondary); transition: color 0.3s ease; }
.product-card:hover h4 { color: var(--color-text-primary); }
.product-card .price { font-weight: 700; font-size: 1.1rem; color: var(--color-text-primary); }

/* === PÁGINA DE PRODUCTO Y VARIANTES === */
.product-detail-container { display: flex; gap: 3rem; align-items: flex-start; }
.product-gallery { flex: 0 0 55%; position: sticky; top: 100px; }
.product-info { flex: 1 1 45%; }
#main-product-image { width: 100%; height: auto; display: block; object-fit: cover; }
.product-info h1 { font-size: 2.8rem; font-weight: 700; text-transform: uppercase; }
.product-info .price { font-size: 1.8rem; color: var(--color-text-secondary); margin-bottom: 2rem; }
.thumbnail-gallery { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
.thumbnail-image { width: 80px; height: 80px; object-fit: cover; cursor: pointer; border: 2px solid transparent; transition: border-color 0.3s ease; }
.thumbnail-image:hover, .thumbnail-image.active-thumb { border-color: var(--color-text-primary); }
.variant-selector, .size-selector { margin-bottom: 1.5rem; }
.variant-selector label, .size-selector label { display: block; font-weight: 700; margin-bottom: 0.5rem; text-transform: uppercase; font-size: 0.9rem; }
.variant-swatches, .size-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.variant-swatch, .size-swatch { padding: 0.5rem 1rem; border: 1px solid var(--color-border); background-color: transparent; color: var(--color-text-secondary); cursor: pointer; transition: all 0.2s ease; font-family: var(--font-primary); }
.size-swatch { min-width: 50px; text-align: center; }
.variant-swatch:hover, .size-swatch:hover:not(:disabled) { border-color: var(--color-text-primary); color: var(--color-text-primary); }
.variant-swatch.active, .size-swatch.active { background-color: var(--color-text-primary); color: var(--color-background); border-color: var(--color-text-primary); }
.size-swatch:disabled { color: #555; border-color: #333; cursor: not-allowed; position: relative; overflow: hidden; }
.size-swatch:disabled::after { content: ''; position: absolute; top: 50%; left: -5%; width: 110%; height: 1px; background: #555; transform: rotate(-20deg); }

/* --- INICIO DE NUEVOS ESTILOS PARA LA PÁGINA DE CATÁLOGO --- */
.catalog-container h1, .category-page-container h1 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 2rem;
}

.category-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--color-border);
    background-color: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-primary);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.9rem;
}

.filter-btn:hover {
    border-color: var(--color-text-primary);
    color: var(--color-text-primary);
}

.filter-btn.active {
    background-color: var(--color-text-primary);
    color: var(--color-background);
    border-color: var(--color-text-primary);
}
/* --- FIN DE NUEVOS ESTILOS --- */

/* === CARRITO Y FOOTER === */
.cart-container h1 { font-size: 2.2rem; margin-bottom: 2rem; text-align: center; }
.cart-item { display: flex; align-items: center; gap: 1.5rem; padding: 1.5rem 0; border-bottom: 1px solid var(--color-border); }
.cart-item-image { width: 100px; height: auto; }
.footer-social a { color: var(--color-text-secondary); font-size: 1.5rem; margin: 0 0.5rem; transition: color 0.3s ease; }
.footer-social a:hover { color: var(--color-text-primary); }
.main-footer { text-align: center; padding: 2rem 5%; border-top: 1px solid var(--color-border); }


/* ============================================================= */
/* === ESTILOS RESPONSIVE (TABLET Y MÓVIL) - Punto de quiebre 992px === */
/* ============================================================= */

@media (max-width: 992px) {
    .header-center {
        /* En móvil, el centro es solo para el logo */
        flex-grow: 0;
        gap: 0;
    }
    
    .header-center .main-nav {
        /* Transformamos el menú en un panel deslizable */
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background-color: #111;
        padding-top: var(--header-height);
        transition: transform 0.3s ease-in-out;
        z-index: 1001;
    }
    
    .main-nav.is-active {
        transform: translateX(0); /* <-- Esta clase la activa el JS */
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        padding-top: 2rem;
    }

    .hamburger-menu {
        display: flex; /* Mostramos el menú hamburguesa */
        flex-direction: column;
        justify-content: space-around;
        width: 2rem;
        height: 2rem;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1002;
    }

    .hamburger-menu .bar {
        display: block;
        width: 2rem;
        height: 3px;
        background-color: var(--color-text-primary);
        border-radius: 10px;
        transition: all 0.3s linear;
    }

    /* Otros ajustes para móvil */
    .featured-categories { flex-direction: column; width: 100%; left: 0; transform: none; }
    .category-card { min-height: 50vh; }
    .product-detail-container { flex-direction: column; }
    .product-gallery { position: static; }
    .header-right .search-form, .header-icon span { display: none; }
}

@media (max-width: 768px) {
    .main-header { display: grid; grid-template-columns: 1fr auto 1fr; padding: 0 1rem; }
    .header-left { justify-self: start; }
    .header-center { justify-self: center; }
    .header-right { justify-self: end; }
    .header-logo { height: 50px; }

    .category-card { min-height: 40vh; }
    .category-card h3 { font-size: 1.8rem; }
    
    body::before { background-size: 80vw; }
    .hero-carousel { height: 60vh; }
    .hero-content h1 { font-size: 2.5rem; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .product-card img { height: 250px; }
}