/* --- ESTILOS GLOBALES --- */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* Añadimos un box-sizing global para un manejo de tamaño más fácil */
    box-sizing: border-box; 
}

*, *:before, *:after {
    box-sizing: inherit;
}

/* --- ENCABEZADO (OPCIONES) --- */
#opciones {
    display: flex; /* Usamos Flexbox */
    align-items: center; /* Centramos verticalmente */
    justify-content: space-between; /* Espaciamos los elementos */
    padding: 10px 20px; /* Añadimos padding */
    border-bottom: 1px solid #f0f0f0;
    /* margin-bottom: 20px; (Eliminado) */
}

#opciones button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-width: 1.3px;
    background-color: transparent;
    cursor: pointer;
}

#opciones #menu {
    /* margin-right: 40%; (Eliminado) */
}

#opciones b {
    font-size: 35px;
    /* margin-right: 35%; (Eliminado) */
    /* Centramos el título (truco con flexbox) */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Contenedor para los iconos de la derecha */
#opciones .iconos-derecha {
    display: flex;
    gap: 10px;
}

/* Movemos los botones al contenedor en el HTML
   (Si no puedes cambiar el HTML, esta es la segunda mejor opción) */
#opciones #cuenta {
    margin-left: auto; /* Empuja los iconos a la derecha */
    /* float: right; (Eliminado) */
}

#opciones #carrito {
    margin-left: 10px;
    /* float: right; (Eliminado) */
}

/* --- BARRA DE ACCESOS/FILTROS --- */
#accesos {
    display: flex; /* Usamos Flexbox */
    align-items: center;
    overflow-x: auto; /* ¡CLAVE! Permite scroll horizontal en móvil */
    white-space: nowrap; /* Evita que los botones salten de línea */
    padding: 10px 20px;
    margin-left: 0; /* margin-left: 30px; (Eliminado) */
    border-bottom: 1px solid black;
}

#accesos button {
    height: 30px;
    border-radius: 15px;
    border-width: 1.3px;
    background-color: transparent;
    margin: 0 5px; /* Espacio simple entre botones */
    cursor: pointer;
    flex-shrink: 0; /* Evita que los botones se encojan */
    /* margin-bottom: 20px; (Eliminado, el padding está en el padre) */
}

#accesos #hombres {
    margin-left: 5px; /* (Eliminamos el margin-left: 60%) */
}

/* --- SECCIÓN CENTRAL (HERO) --- */
#centro {
    width: 100%; /* Usamos 100% en lugar de 100vw para evitar overflow */
    padding: 20px 0;
    text-align: center;
}

#centro h2 {
    margin: 0;
    padding: 0 5%;
    text-align: right;
    /* margin-bottom: -90px; (Eliminado) */
    /* margin-left: 70%; (Eliminado) */
}

#centro h1 {
    font-size: 150px;
    margin: -60px 0; /* Ajustamos el negativo */
    text-align: center;
}

#centro img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 50%;
    height: auto; /* Mejor para responsividad */
}

/* --- TÍTULO "LO MAS POPULAR" --- */
h2 {
    font-size: 24px;
    padding-left: 20px;
    margin-top: 40px;
}

/* --- TARJETAS DE PRODUCTO (Ya estaba casi perfecto) --- */
.product-grid {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 20px; /* Añadido padding horizontal */
}

.product-card {
    flex: 0 0 auto;
    width: 250px;
    background-color: transparent;
    border-radius: 8px;
    overflow: hidden;
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-image-container {
    position: relative;
    padding-top: 100%;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorite-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    font-size: 14px;
    transform: rotate(45deg);
}

.product-info {
    margin-top: 6px;
    margin-bottom: 10px;
    top: 15px;
    left: 15px;
    z-index: 10;
}

.product-price {
    background-color: black;
    color: white;
    padding: 5px 10px;
    border-radius: 9999px;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
}


/* ############################################### */
/* ---               RESPONSIVO                  --- */
/* --- Estilos para pantallas de 600px o menos --- */
/* ############################################### */

@media (max-width: 600px) {

    /* --- ENCABEZADO MÓVIL --- */
    #opciones {
        padding: 10px;
    }

    #opciones b {
        font-size: 24px; /* Título más pequeño */
        /* Quitamos el centrado absoluto para que fluya */
        position: static;
        transform: none;
        margin-left: 15px; 
    }

    #opciones button {
        width: 35px;
        height: 35px;
    }

    /* --- BARRA ACCESOS MÓVIL --- */
    /* (Ya es responsiva gracias a overflow-x: auto) */
    #accesos {
        padding: 10px;
    }

    /* --- SECCIÓN CENTRAL MÓVIL --- */
    #centro h2 {
        text-align: center; /* Centramos el h2 */
        padding: 0 10px;
        font-size: 18px;
    }

    #centro h1 {
        font-size: 80px; /* Reducimos drásticamente el h1 */
        margin: 10px 0; /* Margen normal */
    }

    #centro img {
        width: 90%; /* Hacemos la imagen más grande */
    }

    /* --- TÍTULO "LO MAS POPULAR" MÓVIL --- */
    h2 {
        font-size: 20px;
        padding-left: 10px;
    }

    /* --- TARJETAS MÓVIL --- */
    .product-grid {
        padding: 10px;
        gap: 15px;
    }

    .product-card {
        width: 200px; /* Tarjetas un poco más pequeñas */
    }
}
