/* ========================================== */
/* ESTILOS DE LA VENTANA EMERGENTE      */
/* ========================================== */

/* Fondo oscuro semitransparente que cubre toda la pantalla */
.modal {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    /* Fondo negro con opacidad */
    backdrop-filter: blur(4px);
    /* Efecto borroso en el fondo */
    animation: fadeIn 0.3s;
}

/* Contenido del Modal (La tarjeta central) */
.modal-content {
    background-color: #fff;
    margin: 5% auto;
    /* Centrado vertical y horizontal */
    padding: 0;
    border: 4px solid #8a633b;
    /* Borde café de tu paleta */
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    /* Ancho máximo similar a la referencia */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideDown 0.3s;
}

/* Animaciones suaves */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Botón de cerrar (X) */
.close {
    color: #fff;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    background: #dc3545;
    text-decoration: none;
}

/* Diseño interno del modal (Imagen arriba, texto abajo) */
.modal-body {
    display: flex;
    flex-direction: column;
}

/* Imagen grande */
.modal-img-container {
    width: 100%;
    height: 350px;
    /* Altura fija para la imagen */
    background-color: #efe3cf;
    /* Color crema de fondo */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* La imagen cubre el espacio sin deformarse */
    transition: transform 0.3s ease;
}

/* Información del producto */
.modal-info {
    padding: 30px;
    text-align: center;
    background-color: #ffffff;
}

.modal-title {
    font-size: 28px;
    font-weight: 800;
    color: #765433;
    /* Café oscuro */
    margin-bottom: 10px;
    text-transform: uppercase;
}

.modal-desc {
    font-size: 18px;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-stock {
    font-size: 14px;
    color: #888;
    margin-bottom: 15px;
    font-weight: 600;
}

.modal-price {
    font-size: 32px;
    color: #2A9D8F;
    /* Color de acento de tu paleta */
    font-weight: 800;
    margin-bottom: 25px;
}

/* Estilo para la imagen en la cuadrícula normal (para indicar clic) */
.product__img {
    cursor: pointer;
    position: relative;
}

.product__img:hover::after {
    content: "🔍 Ver Detalle";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Responsive para móviles */
@media (min-width: 768px) {
    .modal-body {
        flex-direction: row;
        /* En PC, imagen izquierda, texto derecha */
    }

    .modal-img-container {
        width: 55%;
        height: 450px;
    }

    .modal-info {
        width: 45%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        text-align: left;
    }
}