/* css/productos.css */

.products {
    padding: 6rem 0;
    background-color: #f4f9f5;
    /* Un tono gris-verdoso súper claro y elegante */
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-top: 3rem;
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tarjeta de Producto */
.product-card {
    background-color: var(--white, #ffffff);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(76, 175, 80, 0.15);
    /* Sombra con toque verde premium */
}

/* Imagen y Overlay */
.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    /* Imagen atractiva más cuadrada/horizontal */
    overflow: hidden;
    background-color: #f0f0f0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
    /* Zoom sutil en la imagen al hacer hover */
}

/* Etiquetas (Nuevos, Oferta) */
.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: #ff9800;
    /* Naranja para top ventas */
    color: white;
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 20px;
    z-index: 2;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(255, 152, 0, 0.3);
}

.product-badge.badge-new {
    background-color: var(--primary-color, #4CAF50);
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

/* Capa oculta con botón que aparece en hover */
.product-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(44, 62, 80, 0.4);
    /* Capa oscura semitransparente */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.product-card:hover .product-overlay {
    opacity: 1;
    /* Aparece al hover */
}

.product-btn {
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease 0.1s;
    /* Retardo para un efecto fluido */
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
}

.product-card:hover .product-btn {
    transform: translateY(0);
    opacity: 1;
}

/* Información del producto (Textos debajo de la imagen) */
.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-name {
    font-size: 1.2rem;
    color: var(--text-color, #2c3e50);
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.product-desc {
    color: var(--text-light, #555555);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    /* Empuja el precio al fondo si las descripciones varían */
}

/* Fila de precio y carrito */
.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 1rem;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color, #4CAF50);
}

.btn-icon-cart {
    background-color: var(--text-color, #2c3e50);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon-cart svg {
    width: 18px;
    height: 18px;
}

.btn-icon-cart:hover {
    background-color: var(--primary-color, #4CAF50);
    transform: scale(1.1);
}

/* Efecto click carrito */
.btn-icon-cart:active {
    transform: scale(0.95);
}

/* =========================================
   MODALES DE PRODUCTO (Glassmorphism)
   ========================================= */
.product-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 1;
    visibility: visible;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.product-modal-backdrop.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.product-modal {
    background-color: var(--white);
    width: 100%;
    max-width: 900px;
    border-radius: 24px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(0) scale(1);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.product-modal-backdrop.hidden .product-modal {
    transform: translateY(40px) scale(0.95);
}

.btn-close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    transition: all 0.3s ease;
    z-index: 10;
}

.btn-close-modal:hover {
    background-color: #e53935;
    color: white;
    transform: rotate(90deg);
}

.modal-content-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
}

.modal-image {
    background-color: #f7f7f7;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-details {
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.modal-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.modal-description p {
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.modal-description h4 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.modal-features-list {
    list-style: none;
    margin-bottom: 2.5rem;
}

.modal-features-list li {
    margin-bottom: 0.8rem;
    color: var(--text-color);
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
}

.modal-btn-buy {
    background-color: var(--text-color);
    margin-top: auto;
    font-size: 1.1rem;
    padding: 1.2rem;
    text-align: center;
}

.modal-btn-buy:hover {
    background-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* Modales Responsivos */
@media (max-width: 768px) {
    .modal-content-grid {
        grid-template-columns: 1fr;
    }

    .modal-image {
        height: 250px;
    }

    .modal-details {
        padding: 2rem 1.5rem;
    }

    .modal-title {
        font-size: 1.6rem;
    }
}