/* Estanteria test */

/* ==========================================================
   SISTEMA DE ESTANTERÍA INTERACTIVA - DISEÑO REFINADO
   ========================================================== */

/* 1. SECCIÓN Y TÍTULO PRINCIPAL DE LA PÁGINA */
.seccion-estanteria {
    padding: 60px 20px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    background-color: var(--white, #fff);
}

.seccion-estanteria h2 {
    font-size: 2.2rem;
    margin-bottom: 50px;
    color: var(--primary-color, #333);
    position: relative;
    padding-bottom: 15px;
    display: inline-block;
}

.seccion-estanteria h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color, #0d5c6b);
    border-radius: 2px;
}

/* 2. CONTENEDOR DE LA IMAGEN DE LA ESTANTERÍA (SHELF) */
.contenedor-estanteria {
    position: relative;
    display: inline-block;
    width: 95vw;
    max-width: 1400px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    line-height: 0;
}

.imagen-estanteria {
    width: 100%;
    height: auto;
    display: block;
}

/* 3. PUNTOS HOTSPOT Y ANIMACIÓN */
.capa-puntos {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
}

.punto-hotspot {
    position: absolute;
    width: 13px; height: 13px;
    background-color: var(--accent-color, #0d5c6b);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px rgba(0,0,0,0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.punto-hotspot:hover {
    transform: translate(-50%, -50%) scale(1.3);
    background-color: #ff5722; /* Color de realce al pasar el ratón */
}

.punto-hotspot::after {
    content: '';
    position: absolute;
    top: -6px; left: -6px; right: -6px; bottom: -6px;
    border: 2px solid var(--accent-color, #0d5c6b);
    border-radius: 50%;
    animation: pulso-puntos 2s infinite;
}

@keyframes pulso-puntos {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* 4. ESTRUCTURA DEL MODAL (BACKDROP) */
#raiz-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    display: none; /* Se activa con JS */
    justify-content: center;
    align-items: center;
    z-index: 100000;
    padding: 20px;
}

#raiz-modal.activo { display: flex; }

.modal-contenido-nuevo {
    position: relative; /* Necesario para posicionar la X de cierre */
    background: white;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
    animation: aparecerModal 0.4s ease-out;
}

@keyframes aparecerModal {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    width: 100%;
}

/* 5. COLUMNA IZQUIERDA: IMAGEN Y GALERÍA REFINADA */
.modal-col-imagen {
    background: #fdfdfd;
    padding: 20px; /* Reducido para acercar elementos */
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid #f0f0f0;
}

.contenedor-principal-foto {
    width: 100%;
    height: 300px; /* Ajustado ligeramente */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px; /* Reducido */
}

#foto-gran-modal {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
    border-radius: 15px;
}

/* La barrita gris pequeña debajo de la imagen grande */
.modal-col-imagen .contenedor-principal-foto::after {
    content: '';
    display: block;
    width: 80%;
    height: 1px;
    background-color: #eee;
    position: absolute;
    bottom: -5px;
    left: 10%;
}
/* Corrección para que el contenedor tenga posición relativa para el after */
.contenedor-principal-foto {
    position: relative;
}

/* Galería de miniaturas más junta */
.galeria-miniaturas {
    display: flex;
    gap: 8px; /* Espacio reducido entre miniaturas */
    margin-top: 5px; /* Pequeño ajuste superior */
    margin-bottom: 15px; /* Reducido */
    flex-wrap: wrap;
    justify-content: center;
}

.mini-foto {
    width: 55px; /* Ligeramente más pequeñas */
    height: 55px;
    object-fit: cover;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mini-foto:hover {
    border-color: var(--accent-color, #0d5c6b);
    transform: translateY(-2px);
}

.mini-foto.activa {
    border-color: var(--accent-color, #0d5c6b);
    box-shadow: 0 3px 8px rgba(13, 92, 107, 0.15);
}

.datos-inferiores-foto {
    text-align: center;
    width: 100%;
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: auto; /* Empuja hacia abajo */
}

.precio-modal {
    font-size: 30px;
    font-weight: 800;
    color: var(--accent-color, #0d5c6b);
    margin: 0;
}

.sku-modal {
    font-size: 11px;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
}

/* 6. COLUMNA DERECHA: INFO Y TEXTOS AJUSTADOS */
.modal-col-info {
    padding: 40px 35px; /* Ligeramente compactado */
    display: flex;
    flex-direction: column;
    text-align: left;
}

.contenedor-titulo-modal {
    margin-bottom: 20px;
}

.contenedor-titulo-modal h2 {
    font-size: 26px;
    color: var(--primary-color, #333);
    margin: 0;
    padding-bottom: 12px; /* Ajustado */
    position: relative;
    line-height: 1.2;
}

/* La barrita decorativa del título en el modal - AJUSTADA */
/* Centrar la línea decorativa bajo el título */
.contenedor-titulo-modal h2::after {
    content: '';
    position: absolute;
    
    /* 1. Posición horizontal centrada */
    left: 10%;
    transform: translateX(-50%); 
    
    /* 2. Ajuste vertical (más cerca o lejos del texto) */
    bottom: 0px; 
    
    /* 3. Dimensiones */
    width: 60px; 
    height: 3px;
    
    background-color: var(--accent-color, #0d5c6b);
    border-radius: 2px;
}

.descripcion-modal {
    font-size: 15px;
    line-height: 1.7;
    color: #666;
    margin-bottom: 30px;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px; /* Espacio para el scrollbar */
}

.descripcion-modal p {
    /* Esta es la clave: interpreta los saltos de línea del texto */
    white-space: pre-line; 
    
    /* Opcional: mejora la lectura */
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
}
/* 7. BOTONES Y CIERRE */
.cerrar-modal-x {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.cerrar-modal-x:hover {
    color: var(--accent-color, #0d5c6b);
    transform: rotate(90deg) scale(1.1);
    background-color: #fff;
}

.grupo-botones {
    display: flex;
    gap: 10px;
    margin-top: auto; /* Empuja hacia abajo */
}

.boton-tienda {
    flex: 2;
    background-color: var(--accent-color, #0d5c6b);
    color: white;
    padding: 14px;
    text-decoration: none;
    text-align: center;
    font-weight: 700;
    border-radius: 8px;
    transition: 0.3s;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
}

.boton-tienda:hover { 
    background-color: #08434d; 
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(13, 92, 107, 0.2);
}

.boton-volver {
    flex: 1;
    background-color: #f5f5f5;
    color: #777;
    padding: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.3s;
    font-size: 13px;
}

.boton-volver:hover { 
    background-color: #eeeeee; 
    color: #333;
}

/* 8. RESPONSIVE (MÓVIL) */
@media (max-width: 850px) {
    .modal-grid { 
        grid-template-columns: 1fr; 
    }
    
    .modal-contenido-nuevo { 
        max-height: 95vh;
        overflow-y: auto; 
    }

    .modal-col-imagen {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 30px 15px 15px 15px;
    }

    .contenedor-principal-foto {
        height: 250px;
    }

    .modal-col-info {
        padding: 25px 20px;
    }

    .precio-modal {
        font-size: 24px;
    }
    
    .cerrar-modal-x {
        background: rgba(255, 255, 255, 0.9);
        top: 10px;
        right: 10px;
    }
}