@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* --- CONFIGURACIÓN DE LA CUADRÍCULA (GRID) --- */
.gal-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* --- ADAPTACIÓN ESPECÍFICA PARA PANTALLAS DE 1200PX O MENOS --- */
@media screen and (max-width: 1200px) {
    .gal-grid-container {
        grid-template-columns: repeat(4, 1fr) !important; 
        gap: 15px;
        padding: 0 10px;
    }
    .gal-card-header {
        font-size: 0.9rem !important;
    }
}

/* --- ADAPTACIÓN PARA TABLETS Y MÓVILES --- */
@media screen and (max-width: 900px) {
    .gal-grid-container { grid-template-columns: repeat(2, 1fr) !important; }
}
@media screen and (max-width: 700px) {
    .gal-grid-container {
        grid-template-columns: 1fr !important;
        width: 85%;
    }
}

/* --- ESTILO DE LAS TARJETAS --- */
.gal-card {
    background: #ffffff !important;
    border-radius: 8px !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease !important;
}

.gal-card:hover {
    transform: scale(1.04) translateY(-4px) !important;
    box-shadow: 0 0px 25px rgba(255, 255, 255, 0.6) !important;
}

.gal-card-header {
    text-align: center !important;
    font-size: 1.2rem !important;
    font-weight: 400 !important;
    color: #111111 !important;
    margin-bottom: 10px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: none;
}

.gal-image-wrapper {
    position: relative !important;
    width: 100% !important;
    padding-top: 65% !important; 
    overflow: hidden !important;
    border-radius: 6px !important;
}

.gal-image-wrapper img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    opacity: 0 !important;
    transition: opacity 0.6s ease-in-out !important;
}

.gal-image-wrapper img.gal-visible {
    opacity: 1 !important;
}

/* --- VENTANA MODAL TRANSPARENTE ULTRA LIMPIA --- */
.gal-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); 
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gal-modal.gal-active {
    display: flex;
    opacity: 1;
}

.gal-modal-content {
    position: relative;
    max-width: 85vw;       
    max-height: 80vh;      
    width: max-content;    
    height: max-content;   
    background: transparent !important; 
    overflow: visible !important;                  
}

.gal-carousel-track {
    display: grid !important;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.gal-carousel-slide {
    grid-column: 1;
    grid-row: 1;
    display: flex !important;
    justify-content: center;
    align-items: center;
    opacity: 0; 
    visibility: hidden;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
    z-index: 1;
}

.gal-carousel-slide.slide-active {
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 2;
}

.gal-carousel-slide img {
    display: block;
    max-width: 85vw;   
    max-height: 80vh;  
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6); 
}

/* --- BOTÓN DE CERRAR (X) --- */
.gal-modal-close {
    position: absolute !important;
    top: 15px !important;               
    right: 15px !important;             
    background: rgba(0, 0, 0, 0.6) !important; 
    border: none !important;           
    width: 50px !important;             
    height: 50px !important;            
    cursor: pointer !important;
    border-radius: 50% !important;      
    z-index: 999999 !important;         
    /* Activamos Flexbox en el padre para obligar al texto a centrarse */
    display: flex !important; 
    justify-content: center !important;  
    align-items: center !important;      
    box-sizing: border-box !important;
    transition: background 0.2s, transform 0.2s !important;
    user-select: none !important;
}

.gal-modal-close .gal-close-text {
    position: relative !important;
    color: #ff0000 !important;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important; /* Agregamos fuentes más simétricas */
    font-size: 38px !important; 
    font-weight: bold !important;
    
    /* BLOQUE INTEGRAL DE CENTRADO TIPOGRÁFICO */
    line-height: 1 !important;      /* Restablece el tamaño real de la caja del carácter */
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    
    /* AJUSTE FINO MATEMÁTICO */
    /* Empujamos la cruz exactamente 2 píxeles hacia abajo para equilibrar su peso visual */
    transform: translateY(2px) !important; 
}

.gal-modal-close:hover {
    background: rgba(255, 0, 0, 0.767) !important; 
    transform: scale(1.1) !important;
    box-shadow: 0 0 20px red;   
}
.gal-close-text:hover{
    color: #ffffff !important;
}

/* Interacción Active */
.gal-modal-close:active {
    transform: scale(0.95) !important;
    background: rgba(0, 102, 204, 0.85) !important; 
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

/* --- BOTONES DE NAVEGACIÓN --- */
.gal-nav-btn {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(0, 0, 0, 0.6) !important; 
    color: white !important;
    /*border: 1px solid rgba(255, 255, 255, 0.3) !important;*/
    border:none !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 24px !important;
    cursor: pointer !important;
    border-radius: 50% !important;
    z-index: 999999 !important; 
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    transition: background 0.2s, transform 0.2s !important;
    user-select: none !important;
}

.gal-prev-btn { left: 150px !important; }
.gal-next-btn { right: 150px !important; }

/* --- INTERACCIONES HOVER Y ACTIVE DE LAS FLECHAS --- */
.gal-nav-btn:hover {
    background: rgba(0, 153, 255, 0.7) !important; 
    color: #ffffff !important; 
    transform: translateY(-50%) scale(1.1) !important;
    box-shadow: 0 0 20px blue;
}

.gal-nav-btn:active {
    transform: translateY(-50%) scale(0.95) !important;
    background: rgba(0, 102, 204, 0.85) !important; 
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

/* --- ADAPTACIONES RESPONSIVAS PARA PANTALLAS MÓVILES --- */
@media screen and (max-width: 768px) {
    .gal-prev-btn { left: 10px !important; }
    .gal-next-btn { right: 10px !important; }
    .gal-modal-close { 
        top: 15px !important; 
        right: 15px !important; 
    }
}
