/* --- modal.css --- */

/* 1. Fondo Oscuro con Desenfoque (Glassmorphism) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Fondo semi-transparente */
    backdrop-filter: blur(8px);     /* Efecto borroso elegante */
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Estado activo para mostrar el modal */
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 2. La Tarjeta del Producto */
.modal-card {
    background: #141414;
    width: 90%;
    max-width: 400px; /* Ancho máximo elegante */
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* Animación de entrada: empieza abajo y sube */
    transform: translateY(100px) scale(0.9);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Estado activo de la tarjeta */
.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* 3. Contenedor de la Imagen (Controla el tamaño) */
.modal-image-wrapper {
    width: 100%;
    height: 250px; /* Altura fija para evitar que ocupe todo */
    position: relative;
    
    /* TRUCO DE ELEGANCIA: Desvanecer la imagen hacia abajo */
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.modal-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Recorta la imagen sin deformarla */
    object-position: center;
}

/* Botón cerrar flotante más bonito */
.btn-close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    z-index: 10;
    transition: transform 0.2s;
}
.btn-close-modal:active { transform: scale(0.9); }

/* 4. Contenido del Texto */
.modal-body-content {
    padding: 0 25px 25px 25px;
    margin-top: -40px; /* Sube el texto sobre el desvanecido de la imagen */
    position: relative;
    z-index: 5;
}

.modal-title-elegant {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--gold, #FFD700);
    margin-bottom: 5px;
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.modal-price-tag {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    display: block;
}

.modal-description {
    color: #b0b0b0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    max-height: 100px;
    overflow-y: auto; /* Si el texto es muy largo, hace scroll solo en el texto */
}

/* Caja de Curiosidad IA */
.ia-badge {
    background: linear-gradient(45deg, #1a1a20, #25252b);
    border: 1px dashed rgba(255, 215, 0, 0.3);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}
.ia-title { font-size: 0.75rem; color: var(--gold, #FFD700); font-weight: bold; letter-spacing: 1px; text-transform: uppercase; display: block; margin-bottom: 5px; }
.ia-text { font-size: 0.85rem; color: #ddd; font-style: italic; }

/* Botón de acción */
.btn-modal-action {
    width: 100%;
    padding: 14px;
    background: var(--gold, #FFD700);
    border: none;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    color: #000;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn-modal-action:active { transform: scale(0.98); }