:root {
    --primary: #006994;
    --secondary: #00A5CF;
    --accent: #00C9B1;
    --dark: #0A2342;
    --light: #F7F9FC;
    --text: #333333;
    --gold: #FFD700;
    --deep-blue: #002366;
    --glow: 0 0 30px rgba(0, 201, 177, 0.7);
    --text-glow: 0 0 10px rgba(255, 255, 255, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

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

/* Títulos con fuente Playfair Display */
h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

.main-container {
    flex-grow: 1;
}

/* Team Section */
.team-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 80%);
    padding: 6rem 1rem 4rem;
    min-height: 100vh;
    overflow: hidden;
}

.team-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 201, 177, 0.15) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

/* Particles */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(0, 201, 177, 0.6);
    border-radius: 50%;
    filter: blur(1px);
    animation: particle-float 20s infinite linear;
}

/* Title */
.title-container {
    text-align: center;
    margin-bottom: 3rem;
    z-index: 2;
    position: relative;
}

.title-container h1 {
    font-size: 3.5rem;
    color: var(--light);
    text-shadow: var(--text-glow);
    margin-bottom: 0.5rem;
}

.title-container p {
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: 400;
}

/* Intro Section */
.intro-container {
    max-width: 1000px;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--light);
    background: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
    position: relative;
}
.intro-container h2 {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}
.intro-container p {
    font-size: 1.1rem;
    line-height: 1.8;
    font-weight: 300;
}

/* Carousel Container */
.carousel-container {
    width: 100%;
    max-width: 1000px;
    height: 700px;
    position: relative;
    margin-bottom: 4rem;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    z-index: 2;
}

.carousel {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-item {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Botones Carrusel */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-btn:hover {
    background: var(--accent);
    color: var(--dark);
}
.carousel-btn.prev { left: 15px; }
.carousel-btn.next { right: 15px; }

/* Team Grid */
.team-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    width: 100%;
    max-width: 1100px;
    z-index: 2;
    position: relative;
}

.team-card.full-width {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(0, 201, 177, 0.2);
    padding: 2.5rem;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-card.full-width:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 201, 177, 0.15);
}

.card-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 2.5rem;
}

.img-wrapper {
    flex-shrink: 0;
}

/* ============================================= */
/* === CORRECCIÓN DE IMÁGENES (TEAM) AQUÍ === */
/* ============================================= */
.team-img {
    width: 180px;
    /* El !important es necesario para vencer al bloque maestro */
    height: 180px !important; 
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover; /* Evita que la cara se aplaste o estire */
    object-position: center 20%; /* Enfoca mejor los rostros */
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.text-wrapper {
    flex-grow: 1;
    color: var(--light);
}

.text-wrapper h3 {
    font-size: 2.2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.text-wrapper .role {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--light);
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.text-wrapper .description {
    font-size: 1.05rem;
    line-height: 1.7;
    opacity: 0.95;
    text-align: justify;
}

/* 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;
    z-index: 10;
}
.wave-divider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 120px;
    overflow: hidden;
    line-height: 0;
    z-index: 2;
}
.footer-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding-bottom: 1rem;
}
.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}
.social-icon {
    color: white !important;
    font-size: 1.8rem !important;
    background: rgba(0,201,177,0.13);
    border-radius: 50%;
    padding: 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.social-icon:hover {
    color: var(--accent) !important;
    background: rgba(0,201,177,0.3);
    transform: translateY(-3px);
}
.footer-content p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Loader & Home Btn */
.loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--dark);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease;
}
.loader-logo { width: 150px; animation: float 3s infinite ease-in-out; }
.loader-bar { width: 300px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; margin-top: 20px; }
.loader-progress { height: 100%; background: var(--accent); width: 0; transition: width 0.3s ease; }

.home-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--accent);
    border-radius: 50px;
    color: var(--light);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    overflow: hidden;
}
.home-btn:hover {
    background: var(--accent);
    color: var(--dark);
}
.liquid-effect { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--accent); transform: translateY(100%); transition: transform 0.3s ease; z-index: -1; }
.home-btn:hover .liquid-effect { transform: translateY(0); }

/* Animaciones */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@keyframes particle-float {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* Responsive Específico de la Sección Team */
@media (max-width: 768px) {
    .team-section {
        padding: 5rem 1rem 2rem;
    }
    .card-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }
    .text-wrapper .description {
        text-align: center;
    }
    
    /* CORRECCIÓN RESPONSIVE DE IMAGEN */
    .team-img {
        width: 150px;
        height: 150px !important; /* Sobrescribe también en móvil */
    }
    
    .carousel-container {
        height: 300px;
    }
    .title-container h1 {
        font-size: 2.5rem;
    }
    .intro-container h2 {
        font-size: 2rem;
    }
}

/* ========================================= */
/* === BLOQUE MAESTRO 2.0 (FLUIDO & RESPONSIVE) === */
/* ========================================= */

/* 1. Configuración de Texto */
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 */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    word-wrap: break-word; 
    hyphens: auto;
}

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 */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* NOTA: El !important aquí es lo que causaba el problema, 
   pero ahora .team-img tiene su propio !important para defenderse. */
img, video, iframe, .map-container {
    max-width: 100% !important;
    height: auto !important;
}

/* 4. Ajustes Específicos para Celulares */
@media (max-width: 768px) {
    .contact-header, .about-header, .exp-header, .news-header, .lab-header {
        padding: 3rem 1rem !important; 
    }
    
    .main-container, .contact-container, .about-container, .section {
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
    }

    .contact-container, .about-card, .news-container {
        flex-direction: column !important;
        display: flex !important;
    }
}