/* ================================== */
/* CSS para Acreditaciones */
/* ================================== */

/* --- Estilos Base --- */
:root {
    --primary: #006994;
    --secondary: #00A5CF;
    /* CORRECCIÓN: Tu accent en los otros archivos es este */
    --accent: #00C9B1; 
    --dark: #0A2342;
    --light: #F7F9FC;
    --text: #333333;
    --gold: #FFD700;
    --deep-blue: #002366;
    --glow: 0 0 30px rgba(0, 201, 177, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Playfair Display', serif;
    background-color: var(--dark);
    color: var(--light);
    overflow-x: hidden;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-wrapper {
    flex-grow: 1; /* Empuja el footer hacia abajo */
}

/* --- Loader --- */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 1s ease;
}
.bubble-animation {
    position: relative;
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
}
.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 201, 177, 0.6);
    animation: float-up 4s infinite ease-in-out;
}
.bubble:nth-child(1) { width: 30px; height: 30px; left: 20px; top: 50px; animation-delay: 0s; }
.bubble:nth-child(2) { width: 50px; height: 50px; left: 60px; top: 30px; animation-delay: 0.5s; }
.bubble:nth-child(3) { width: 20px; height: 20px; left: 100px; top: 70px; animation-delay: 1s; }
.loader-text {
    color: var(--light);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: pulse 2s infinite ease-in-out;
}

/* --- Partículas --- */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: drift 20s infinite linear;
}

/* --- Header y Botón Home --- */
.acreditaciones-header {
    text-align: center;
    padding: 4rem 2rem 3rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 80%);
}
.acreditaciones-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--light);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 2;
}
.acreditaciones-header h1 span { color: var(--accent); }
.acreditaciones-header p {
    font-size: 1.2rem;
    color: var(--light);
    opacity: 0.8;
    position: relative;
    z-index: 2;
}
.water-effect-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, transparent 100%);
    z-index: 1;
}
.home-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: transparent;
    color: var(--light);
    border: 2px solid var(--accent);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}
.home-btn:hover {
    background: var(--accent);
    color: var(--dark);
    box-shadow: var(--glow);
}
.home-btn i { font-size: 1.2rem; }
.home-btn .liquid-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    z-index: -1;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.home-btn:hover .liquid-effect { transform: translateY(0); }
.home-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: var(--accent);
    animation: wave 3s linear infinite;
    z-index: -1;
}

/* ================================================== */
/* --- INICIO DE LA CORRECCIÓN: Cuadrícula 2x2 --- */
/* ================================================== */

.acreditaciones-container {
    padding: 4rem 1rem; /* Más padding vertical, menos horizontal en móvil */
}

.acreditaciones-grid {
    display: grid;
    /* 2 columnas en móvil */
    grid-template-columns: repeat(2, 1fr);
    /* CORRECCIÓN: Más juntos */
    gap: 1rem; 
    /* CORRECCIÓN: Más grande en pantalla */
    max-width: 900px; 
    margin: 0 auto;
}

.cert-card-img {
    position: relative;
    aspect-ratio: 1 / 1; /* Círculo perfecto */
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    
    /* CORRECCIÓN: Fondo sutil y logo completo (no cortado) */
    background-color: rgba(255, 255, 255, 0.05); /* Fondo */
    background-size: 80%; /* Logo al 80% (más completo) */
    background-repeat: no-repeat;
    background-position: center;
    
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cert-card-img:hover {
    transform: scale(1.05);
    box-shadow: var(--glow);
}

.cert-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%; /* Asegura que el overlay sea circular */
}

.cert-card-img:hover .cert-overlay {
    opacity: 1;
}

.cert-text {
    text-align: center;
    color: var(--light);
    padding: 1rem; /* Espacio para que el texto no se pegue a los bordes */
}

.cert-text h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem; /* Ajustado para móviles */
    margin-bottom: 0.25rem;
}

.cert-text p {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem; /* Ajustado para móviles */
    color: var(--accent);
    font-weight: 600;
}

/* Responsive para la cuadrícula */
@media (min-width: 768px) {
    .acreditaciones-grid {
        /* Mantenemos 2 columnas, pero más grandes y juntas */
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem; /* Un poco más de espacio en escritorio */
    }

    .cert-text h3 {
        font-size: 2rem; /* Títulos más grandes en escritorio */
    }
    
    .cert-text p {
        font-size: 1rem;
    }
}

/* ================================================== */
/* --- FIN DE LA CORRECCIÓN --- */
/* ================================================== */


/* --- Estilos del Modal (Lightbox) --- */
.modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s linear;
    padding: 1rem;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.modal-content {
    position: relative;
    background: var(--dark);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid var(--accent);
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    text-align: center;
    overflow-y: auto; 
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* Estilo para N° Certificado */
.modal-content .cert-number {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--light);
    opacity: 0.8;
}

/* Estilo para la descripción */
.modal-content .modal-description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.modal-content img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 10px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    z-index: 10001;
}
.modal-close:hover {
    color: var(--accent);
}

/* --- Footer --- */
.news-footer {
    background: var(--dark);
    color: white;
    padding: 2rem 0 1rem 0;
    position: relative;
    min-height: 120px;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}
.wave-divider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 120px;
    overflow: hidden;
    line-height: 0;
    z-index: 2;
}
.footer-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding: 0 1rem;
}
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.social-icon {
    color: white !important;
    font-size: 2rem !important;
    background: rgba(0,201,177,0.13) !important;
    border-radius: 50%;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.social-icon:hover {
    color: var(--accent) !important;
    background: rgba(0,201,177,0.22) !important;
    transform: translateY(-3px) scale(1.15);
}
.news-footer .social-links a {
    color: white !important;
    text-decoration: none !important;
    border: none;
    box-shadow: none;
}
.footer-content p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.85;
    width: 100%;
    text-align: center;
}
@media (max-width: 600px) {
    .news-footer { padding: 1.2rem 0 0.5rem 0; }
    .footer-content { font-size: 0.95rem; gap: 0.7rem; }
    .social-links { gap: 1rem; }
    .social-icon { font-size: 1.3rem !important; }
}

/* --- Animaciones --- */
@keyframes float-up {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-20px) scale(1.1); opacity: 0.8; }
    100% { transform: translateY(-40px) scale(1); opacity: 0; }
}
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes wave {
    0% { transform: scaleX(0); opacity: 1; }
    100% { transform: scaleX(1); opacity: 0; }
}
@keyframes drift {
    0% { transform: translate(0, 0); opacity: 1; }
    50% { opacity: 0.7; }
    100% { transform: translate(-100vw, 100vh); opacity: 0; }
}

/* --- Responsive General --- */
@media (max-width: 768px) {
    .acreditaciones-header h1 {
        font-size: 2.5rem;
    }
    .home-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}
/* ========================================= */
/* === BLOQUE MAESTRO 2.0 (FLUIDO & RESPONSIVE) === */
/* ========================================= */

/* 1. Configuración de Texto (Se adapta automáticamente) */
body, p, span, a, li, input, textarea, label {
    font-family: 'Roboto', sans-serif; 
    font-weight: 400;
    line-height: 1.6;
    color: var(--light);
}

/* 2. Títulos Inteligentes (Usa clamp para escalar suavemente) */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    /* Evita que palabras largas rompan el celular */
    word-wrap: break-word; 
    hyphens: auto;
}

/* TAMAÑOS: (Mínimo móvil, Ideal variable, Máximo escritorio) */
h1 { 
    font-size: clamp(2.2rem, 5vw + 1rem, 3.5rem) !important; 
}

h2 { 
    font-size: clamp(1.8rem, 4vw + 1rem, 2.5rem) !important; 
    color: var(--light);
}

h3 { 
    font-size: clamp(1.3rem, 3vw + 1rem, 1.8rem) !important; 
}

/* 3. SALVAVIDAS MÓVIL (Evita el desastre lateral) */
html, body {
    max-width: 100vw;
    overflow-x: hidden; /* Bloquea el scroll horizontal indeseado */
}

img, video, iframe, .map-container {
    max-width: 100% !important; /* Nada puede ser más ancho que la pantalla */
    height: auto !important;
}

/* 4. Ajustes Específicos para Celulares ( < 768px ) */
@media (max-width: 768px) {
    /* Reduce el relleno lateral excesivo */
    .contact-header, .about-header, .exp-header, .news-header, .lab-header {
        padding: 3rem 1rem !important; 
    }
    
    /* Asegura que los contenedores no se peguen a los bordes */
    .main-container, .contact-container, .about-container, .section {
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
    }

    /* Fuerza que las cajas se apilen verticalmente */
    .contact-container, .about-card, .news-container {
        flex-direction: column !important;
        display: flex !important;
    }
}

/* ========================================= */
/* === FIN DEL BLOQUE MAESTRO 2.0 === */
/* ========================================= */