/* =========================================
   1. HERO SECTION (PORTADA PRINCIPAL)
   ========================================= */
.image-container {
    width: 100%;
    /* Altura: Pantalla completa menos el header (aprox 80px) */
    height: calc(100vh - 80px);
    position: relative;
    overflow: hidden;
}

.responsive-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cubre todo sin deformarse */
    object-position: center;
}

/* Texto sobre la portada */
.overlay-text {
    position: absolute;
    top: 50%;
    right: 5%; /* Alineado a la derecha en escritorio */
    transform: translateY(-50%);
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    text-align: right;
    z-index: 2;
}

.overlay-text p {
    font-size: 1.5em;
    margin: 0 0 10px 0;
    font-family: var(--font-primary), serif;
}

.overlay-text h1 {
    font-size: 3em;
    margin: 0 0 25px 0;
    font-weight: bold;
    font-family: var(--font-primary), serif;
}

/* Botón "Ver más" */
.buy-button {
    background: transparent;
    color: white;
    padding: 12px 35px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    font-family: var(--font-primary), serif;
    border: 2px solid white;
    display: inline-block;
    transition: all 0.3s ease;
}

.buy-button:hover {
    color: #333; /* Un gris oscuro para contraste */
    text-decoration: none;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* =========================================
   2. TÍTULO DE SECCIÓN
   ========================================= */
.container-comprar {
    margin: 1.5rem 0;
}

.h2-texto-comprar {
    color: var(--color-text-primary) !important;
    letter-spacing: 1px;
    font-family: var(--font-primary), sans-serif;
    font-weight: bold;
}

/* =========================================
   3. GRILLA DE CATEGORÍAS (GRID CUADRADO)
   ========================================= */

a.category-card {
    text-decoration: none; /* Quita subrayado del enlace general */
    display: block;
}

.category-image-wrapper {
    position: relative;
    width: 100%;

    /* --- AQUÍ ESTÁ LA SOLUCIÓN --- */
    /* Esto fuerza que sea un CUADRADO PERFECTO siempre */
    aspect-ratio: 1 / 1;
    /* Ya no usamos height fija */

    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.category-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Rellena el cuadrado sin estirar la foto */
    transition: transform 0.5s ease;
}

/* Efecto Zoom al pasar el mouse */
.category-card:hover .category-image-wrapper img {
    transform: scale(1.1);
}

/* Etiqueta de texto sobre la categoría */
.category-label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 10px;
    /* Degradado más suave para leer mejor */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.category-label h3 {
    color: white;
    margin: 0;
    font-size: 1.3em;
    font-weight: bold;
    font-family: var(--font-primary), sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1text-center 1px 3px rgba(0, 0, 0, 0.8);
}


/*Los mas vendidos*/

.mas-vendidos {
    display: flex;
    justify-content: center;
    align-items: center;
}

.enlace-vendido {
    text-decoration: none !important;
    display: block;
    margin: 0 10px;
    padding: 1rem;
    color: var(--color-text-primary) !important;
    font-family: var(--font-primary), sans-serif;
    font-size: 1.5rem;
}

.enlace-vendido:hover {
    color: var(--color-five) !important;
    text-decoration: none !important;
}

/*Los mas vendidos*/


/* =========================================
   4. RESPONSIVE (MÓVIL)
   ========================================= */
@media (max-width: 768px) {
    /* Ajustes del Hero en móvil */
    .overlay-text {
        right: auto;
        left: 50%;
        width: 90%; /* Para que no se pegue a los bordes */
        transform: translate(-50%, -50%);
        text-align: center;
    }

    .overlay-text h1 {
        font-size: 2.2em; /* Texto un poco más chico en móvil */
    }

    /* Ajustes de Categorías en móvil */
    .category-label h3 {
        font-size: 0.9em; /* Texto más pequeño para que quepa en el cuadro */
        letter-spacing: 0.5px;
    }

    .category-label {
        padding: 10px 5px; /* Menos relleno en móvil */
    }
}
