/* =============================================
   1. ESTILO GENERAL Y CONTENEDOR
   ============================================= */
body {
    background-color: #bbb;
    margin: 0;
    padding: 0;
}

.rg-gallery { 
    width: 99%; 
    margin: 0 auto; 
    display: flex !important; 
    flex-direction: column !important; 
    gap: 0; 
    clear: both;
    user-select: none;
    font-family: myFirstFont, sans-serif;
    padding-top: 6px;
}

.thumbnail-slider-container, .main-display { 
    width: 100% !important; 
    box-sizing: border-box; 
    margin: 0 auto;
}

/* =============================================
   2. CARRUSEL DE MINIATURAS (SUPERIOR)
   ============================================= */
.thumbnail-slider-container { 
    display: flex !important; 
    align-items: center; 
    background: #000; 
    padding: 10px 5px 0 5px; 
    border-radius: 10px 10px 0 0; 
    z-index: 10;
    position: relative;
}

.thumbs-wrapper { 
    display: flex !important; 
    flex-direction: row !important; 
    overflow-x: auto; 
    gap: 10px; 
    flex: 1; 
    scrollbar-width: none;
    padding: 5px 0; 
    -webkit-overflow-scrolling: touch; 
}

.thumbs-wrapper::-webkit-scrollbar { display: none; }

.thumb-node { 
    flex: 0 0 65px; 
    cursor: pointer; 
    text-align: center;
    display: flex !important;
    flex-direction: column !important; 
    align-items: center !important;
    gap: 2px;
    opacity: 0.5 !important; 
    transition: all 0.3s ease;
}

.thumb-node:hover, .thumb-node.active { opacity: 1 !important; }

.thumb-node.active .img-frame { 
    border-color: #f44 !important; 
    border-radius: 6px; 
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.7); 
}

.img-frame { 
    width: 100%;
    height: 65px; 
    border: 2px solid #444; 
    border-radius: 4px; 
    overflow: hidden; 
    background: #111; 
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.thumb-node img { width: 100%; height: 100%; object-fit: cover; display: block; }

.vistas-mini { 
    display: flex !important; 
    align-items: center;
    justify-content: center;
    gap: 1px; 
    color: #f2e389; 
    font-size: 11px; 
    font-family: sans-serif;
    background: rgba(255,255,255,0.1); 
    border: 1px solid #555; 
    border-radius: 4px; 
    padding: 2px 5px; 
    width: 75%;
    white-space: nowrap;
}

/* Flechas del slider superior */
.slider-arrow { 
    background: #000; 
    border: none; 
    color: #d44; 
    font-size: 20px; 
    cursor: pointer; 
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -25px;
    transition: 0.3s; 
    z-index: 20;
}

/* Estado hover general (para el color y el escalado) */
.slider-arrow:hover { 
    color: #fff; 
}

/* Movimiento específico: Asumiendo que usas las clases prev/next o los IDs que tengas */
/* Flecha izquierda (Atrás) */
.slider-arrow:first-of-type:hover {
    transform: scale(1.1) translateX(-2px);
}

/* Flecha derecha (Adelante) */
.slider-arrow:last-of-type:hover {
    transform: scale(1.1) translateX(2px);
}

/* =============================================
   3. FOTO GRANDE Y ZONAS LATERALES (CENTRAL)
   ============================================= */
.main-display { 
    background: #000; 
    border-radius: 0 0 15px 15px; 
    overflow: hidden; 
    border: 1px solid #000; 
    position: relative;
    z-index: 5;
    box-shadow: 0 3px 3px rgba(0,0,0,0.5);
}

.big-img-container { 
    width: 100%; 
    display: flex !important; 
    align-items: stretch !important; /* Estira las zonas laterales al alto de la foto */
    justify-content: center !important; 
    background: #050505; 
    padding: 0 !important; /* Sin padding para que las zonas toquen los bordes */
    box-sizing: border-box;
    position: relative;
}

/* Zonas de clic laterales */
.nav-zone {
    flex: 0 0 40px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 10;
}

.nav-arrow {
    background: none;
    border: none;
    color: #d44;
    font-size: 28px;
    transition: 0.3s;
    pointer-events: none; /* El click lo gestiona la zona */
}

.nav-zone:hover .nav-arrow { color: #fff; transform: scale(1.2); }

#foto-principal { 
    max-width: calc(100% - 80px); /* 65px + 65px de las zonas */
    height: auto !important; 
    display: block;
    border-radius: 8px;    
    transition: opacity 0.3s ease; 
    margin: 10px 0; /* Espacio arriba y abajo de la foto */
}

.main-caption { 
    padding: 0 0 14px 0; 
    color: #fff; 
    text-align: center; 
    font-family: Tahoma, Arial, sans-serif; 
    font-size : clamp(0.9rem, 2.5vw, 1.4rem); 
    background: #000; 
    text-transform: uppercase;
    letter-spacing: 2px;
    border-top: 1px solid #111;
}

/* =============================================
    4. VISOR LIGHTBOX (PANTALLA COMPLETA)
    ============================================= */
.visor-overlay {
    display: none; 
    position: fixed;
    z-index: 10000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.20); 
    backdrop-filter: blur(2px) !important; 
    -webkit-backdrop-filter: blur(4px) !important;
    cursor: zoom-out;
    align-items: center;
    justify-content: center;
    animation: fadeInVisor 0.3s ease;
}

.visor-contenido {
    position: relative;
    display: inline-block;
    max-width: 92%;
    max-height: 92vh;
    animation: zoomSuave 0.25s ease-out;
}

#img-visor {
    display: block;
    max-width: 100%;
    max-height: 92vh;
    border: 2px solid #333;
    border-radius: 15px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    object-fit: contain;
}

/* FLECHAS DEL VISOR (Diseño tipo pastilla al pie) */
.nav-arrow-visor {
    position: absolute;
    bottom: 4px; /* Alineadas al pie de la imagen */
    background: rgba(0, 0, 0, 0.25); 
    backdrop-filter: blur(2px);    
    border: 1px solid rgba(255, 255, 255, 0.4); 
    color: #fff;
    font-size: 20px; 
    cursor: pointer;
    z-index: 100;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, opacity 0.3s ease, transform 0.2s;
    opacity: 0.8;
}

.nav-arrow-visor.prev {
    left: 20px;
    border-radius: 20px;
}

.nav-arrow-visor.next {
    right: 20px;
    border-radius: 20px;
}

.nav-arrow-visor:hover {
    background: rgba(0, 0, 0, 0.6); 
    color: #f44; /* Color de realce al pasar el ratón */
    opacity: 1;
}

.nav-arrow-visor:active {
    transform: scale(0.9); /* Efecto de pulsación */
}

/* Contador de fotos en el lightbox */
#visor-contador {
    position: absolute;
    bottom: 10px; /* Centrado entre las pastillas */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-family: sans-serif;
    font-size: 14px;
    z-index: 110;
    backdrop-filter: blur(5px);
    pointer-events: none;
    letter-spacing: 1px;
    border: 1px solid rgba(255,255,255,0.1);
}

.visor-close {
    position: absolute;
    top: -12px;
    right: -12px;
    background: #c44;
    color: #fff;
    width: 35px;
    height: 35px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

@keyframes fadeInVisor { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomSuave { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* =============================================
   5. RESPONSIVE / MÓVIL (LIMPIO Y SIN COMPLICACIONES)
   ============================================= */
@media (max-width: 600px) {
    .thumbnail-slider-container { padding: 5px 8px !important; }
    
    /* Ocultamos zonas laterales de la galería principal */
    .nav-zone { display: none; }
    
    #foto-principal { 
        max-width: 100%; 
        pointer-events: none !important; 
        margin: 0;
    }

    /* Ocultamos flechas del slider de arriba */
    .slider-arrow { display: none !important; }

    /* LIGHTBOX EN MÓVIL: Limpio y funcional */
    .visor-contenido { 
        max-width: 98%; 
    }

	.nav-arrow-visor {
    font-size: 16px;
    bottom: 14px;
	} 

	.main-caption { 
    padding: 6px 0 6px 0; 
    font-size : clamp(0.85rem, 2.5vw, 1.4rem); 
    letter-spacing: 0px;
	}
	
	#visor-contador {
    bottom: 30px; /* Centrado entre las pastillas */
	}	

    #img-visor {
        border-radius: 10px;
        max-height: 90vh;
    }
}

@media (min-width: 600px) {
    #foto-principal { cursor: zoom-in; }
}