/* =====================================================
   ESTILOS BASE PARA TODOS LOS MODALES
   ===================================================== */

.modal {
    display: none; /* Oculto por defecto, activado por JS */
    position: fixed; 
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.6); 
    padding: 20px 0;
}

.modal-content {
    background-color: var(--blue-medium);
    color: var(--white);
    margin: 4vh auto; 
    padding: 2.5rem;
    border: 1px solid var(--blue-medium);
    width: 90%; 
    max-width: 1000px; /* Reducido de 1200px */
    height: auto; 
    max-height: none; /* Sin límite de altura máxima */
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: visible; /* Sin scroll en el contenedor */
}

.modal-content h2 {
    color: var(--white);
}

/* =====================================================
   BOTÓN DE CERRAR (COMÚN A TODOS LOS MODALES)
   ===================================================== */

.close-button {
    color: var(--white);
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10;
}

.close-button:hover,
.close-button:focus {
    color: var(--blue-light);
    text-decoration: none;
}

/* =====================================================
   MODAL DE LOGIN Y REGISTRO
   ===================================================== */

.login-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.login-button {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 5px;
    background-color: var(--blue-light);
    color: var(--white);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-button:hover {
    background-color: #0069d9;
}

/* =====================================================
   MODAL DE PRODUCTO - ESTILOS ESPECÍFICOS
   ===================================================== */

/* Sobrescribir centrado solo cuando el modal está visible */
#productDetailModal[style*="display: block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Ajustar contenedor cuando está visible */
#productDetailModal[style*="display: block"] .modal-content {
    margin: 0;
}

/* Contenedor principal de 2 columnas */
#productDetailModal .product-detail-container {
    display: flex;
    flex-direction: row;
    gap: 3rem;
    align-items: flex-start;
    height: auto;
    overflow: visible; /* Sin scroll */
    padding: 0;
}

/* Scroll personalizado */
#productDetailModal .product-detail-container::-webkit-scrollbar {
    width: 8px;
}

#productDetailModal .product-detail-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

#productDetailModal .product-detail-container::-webkit-scrollbar-thumb {
    background: var(--blue-light);
    border-radius: 10px;
}

/* Columna de Imagen - 45% */
#productDetailModal .product-detail-image-box {
    flex: 0 0 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem; /* Reducido de 2rem */
    min-height: auto; /* Auto en lugar de 300px fijo */
}

#productDetailModal .modal-product-image {
    width: 100%;
    height: auto;
    max-height: 380px; /* Reducido de 450px */
    object-fit: contain;
    border-radius: 8px;
}

/* Columna de Información - 55% */
#productDetailModal .product-detail-info {
    flex: 0 0 55%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: flex-start;
    padding: 0 3rem 0 0; /* Padding derecho para separar del borde */
}

/* Título del Producto */
#productDetailModal #modal-product-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

/* Precio */
#productDetailModal #modal-product-price {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--blue-light);
    margin: 0 0 0.8rem 0;
}

/* Descripción */
#productDetailModal #modal-product-description {
    font-size: 0.95rem; /* Reducido de 1rem */
    line-height: 1.5; /* Reducido de 1.6 */
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 0.8rem 0;
    padding: 0.8rem; /* Reducido de 1rem */
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border-left: 3px solid var(--blue-light);
}

/* Stock */
#productDetailModal #modal-product-stock {
    font-size: 0.95rem; /* Reducido de 1rem */
    font-weight: 700;
    margin: 0 0 0.8rem 0;
    padding: 0.5rem 1rem; /* Reducido padding */
    border-radius: 50px;
    display: inline-block;
    width: fit-content;
    letter-spacing: 0.5px;
}

/* Control de Cantidad */
#productDetailModal .modal-product-quantity {
    margin: 0.5rem 0 0.8rem 0;
    align-self: flex-start;
}

/* Botón Añadir al Carrito */
#productDetailModal .add-to-cart-btn {
    margin-top: 0.5rem; /* Reducido de auto para menos espacio */
    padding: 0.9rem 2rem; /* Ligeramente más compacto */
    font-size: 1rem; /* Reducido de 1.1rem */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    max-width: 100%;
}

/* Mejorar botón de cerrar en modal de producto */
#productDetailModal .close-button {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    line-height: 1;
    top: 15px;
    right: 20px;
}

#productDetailModal .close-button:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: rotate(90deg);
}

