/* =============================================
   products-list.css - Versión Corregida
   ============================================= */

#product-list-section {
    background: #ffffff;
    padding: 110px 20px 100px;
}

.product-list-box {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;


}

/* Grid principal */
.product-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 40px 30px;
    padding: 50px 20px 0;
}

/* ==================== TARJETA PRINCIPAL ==================== */
.product-list-item-box {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    height: auto;                    /* ← Importante: se ajusta al contenido */
    min-height: 480px;               /* Altura mínima recomendada */

    display: grid;
    grid-template-rows: auto auto 1fr auto;
    grid-template-columns: 1fr;
}

.product-list-item-box:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

/* ==================== GRID DE IMÁGENES (1:1) ==================== */
.product-list-item-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px 20px 0;
}

.product-list-item-image-box {
    aspect-ratio: 1 / 1;               /* ← Fuerza relación cuadrada */
    overflow: hidden;
    border-radius: 10px;

}

.product-list-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;

    max-width: 120px;
    height: 120px;
}

.product-list-item-image:hover {
    transform: scale(1.08);
}

/* Contenido textual */
.product-list-item-title {
    font-family: var(--title-font-family);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 0 24px;
    margin: 24px 0 12px;
    text-align: left;
}

.product-list-item-descrip {
    font-size: 1.05rem;
    line-height: 1.65;
    color: #555;
    padding: 0 24px;
    margin-bottom: 24px;
    flex-grow: 1;                    /* Empuja el botón hacia abajo */
    text-align: left;
}

/* Botón al final */
.product-list-item-box .cta-primary {
    margin: 20px 24px 28px;
    align-self: flex-start;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1200px) {
    .product-list-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

@media (max-width: 992px) {
    .product-list-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

@media (max-width: 576px) {
    .product-list-item-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-list-item-image-box {
        aspect-ratio: 1 / 1;
    }
}


/* =============================================
   PRODUCT ITEM VIEW - Modal de Vista Ampliada
   ============================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Contenedor del modal */
.product-item-view-box {
    background: white;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Imagen principal */
.product-item-view-image {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    background: #f8f9fa;
    flex-shrink: 0;
}

/* Título */
.product-item-view-title {
    font-family: var(--title-font-family);
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 24px 30px 20px;
    margin: 0;
    text-align: center;
    border-top: 1px solid #eee;
}

/* Botón cerrar */
.product-item-view-box .fa-xmark {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: 1.8rem;
    color: #333;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
}

.product-item-view-box .fa-xmark:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--accent-color);
    transform: rotate(90deg);
}

/* Responsive */
@media (max-width: 768px) {
    .product-item-view-box {
        width: 95%;
        max-height: 95vh;
    }
    
    .product-item-view-image {
        max-height: 380px;
    }
    
    .product-item-view-title {
        font-size: 1.45rem;
        padding: 20px 20px 16px;
    }
}

@media (max-width: 480px) {
    .product-item-view-image {
        max-height: 320px;
    }
}