:root {
    --verde: #1bbf6b;
    --azul: #0b3c5d;
    --rojo: #e63946;
    --oscuro: #0a1a2a;
    --claro: #f5f7fa;

    --header-height: 150px;
}

/* RESET */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background: var(--claro);
    color: #222;
}

/* ================= HEADER ================= */
header {
    background: var(--oscuro);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Bloque superior: logo + búsqueda + redes */
.header-top {
    display: flex;
    justify-content: space-between;
    /* logo a la izquierda, bloque búsqueda/redes a la derecha */
    align-items: center;
    padding: 16px 8%;
    gap: 40px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
}

/* Logos por defecto (desktop) */
.logo-desktop {
    display: block;
    height: 70px;
    max-width: 100%;
}

.logo-mobile {
    display: none;
}

/* Buscador con lupa integrada */
.search {
    position: relative;
    width: 250px;
}

.search input {
    width: 100%;
    padding: 8px 35px 8px 12px;
    border-radius: 6px;
    border: none;
    outline: none;
    font-size: 0.95rem;
}

.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    pointer-events: none;
}

/* Redes sociales */
.social-icons {
    display: flex;
    gap: 26px;
    padding: 10px 0;
}

.social-icons a {
    color: white;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: var(--verde);
}

/* ===== HEADER DESKTOP: logo izquierda / buscador+redes derecha ===== */
@media (min-width: 769px) {

    nav {
        display: flex;
        flex-direction: column;
    }

    /* Contenedor superior completo */
    nav>.header-top,
    nav>.search-social-block {
        display: inline-flex;
        align-items: center;
    }

    /* Creamos una sola fila virtual */
    nav {
        position: relative;
    }

    .header-top {
        justify-content: flex-start;
    }

    .search-social-block {
        position: absolute;
        right: 8%;
        top: 23px;
        transform: translateY(-15%);
    }

    /* Hamburguesa fuera en desktop */
    .menu-toggle {
        display: none;
    }
}

/* ================= MENU ================= */

nav {
    display: flex;
    flex-direction: column;
}

.menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin: 0;
    padding: 20px 0;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, .12);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.menu li {
    white-space: nowrap;
}

.menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.menu a:hover,
.menu a:focus {
    color: var(--verde);
    outline: none;
}

.btn-panamericanos {
    background: rgba(230, 57, 70, .18);
    color: white !important;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid rgba(230, 57, 70, .35);
    transition: .3s ease;
}

.btn-panamericanos:hover {
    background: rgba(230, 57, 70, .35);
    transform: translateY(-1px);
}

@media (min-width: 769px) {

    /* Buscador + redes en dos líneas, alineado a la derecha */
    .search-social-block {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }

    /* Buscador alineado a la derecha */
    .search {
        width: 250px;
    }

    /* Redes alineadas a la derecha */
    .social-icons {
        justify-content: flex-end;
    }
}

/* ================= HERO ================= */
.hero {
    position: relative;
    height: 85vh;
    min-height: 520px;
}

.hero-carousel {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 26, 42, .65);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 40px;
}

/* Dots carrusel */
.hero-dots {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 50;
}

.hero-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .45);
    cursor: pointer;
}

.hero-dots .dot.active {
    background: white;
}

.hero-overlay h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero-overlay span {
    color: var(--rojo);
}

.hero-cta {
    margin-top: 30px;
    padding: 14px 30px;
    background: var(--verde);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: .3s;
}

.hero-cta:hover {
    background: #14a85c;
    transform: translateY(-2px);
}

/* Animación solo en slide activo */
.slide.active .hero-overlay h1,
.slide.active .hero-overlay p,
.slide.active .hero-cta {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp .8s ease forwards;
}

.slide.active .hero-overlay p {
    animation-delay: .2s;
}

.slide.active .hero-cta {
    animation-delay: .4s;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Flechas carrusel */
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    font-size: 2.2rem;
    background: rgba(0, 0, 0, .45);
    color: white;
    border: none;
    padding: 14px 18px;
    cursor: pointer;
}

/* Izquierda / derecha */
.hero-arrow.left {
    left: 30px;
}

.hero-arrow.right {
    right: 30px;
}

/* ================= SECCIONES ================= */
section {
    scroll-margin-top: var(--header-height);
}

.section-image img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

/* ================= TEXTO INTRODUCTORIO DESTACADO ================= */
.section-content {
    padding: 70px 8% 60px;
    text-align: center;
}

.section-content .intro {
    font-size: 1.22rem;
    line-height: 1.9;
    max-width: 900px;
    margin: 20px auto 0;
    font-weight: 500;
    text-align: center;
}

/* ================= DIRECTORIO ================= */
.directorio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 80px;
    margin-top: 50px;
}

.directorio-item h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--azul);
    margin-bottom: 6px;
}

.directorio-item .cargo {
    font-weight: 600;
    margin-bottom: 2px;
}

.directorio-item .area {
    font-size: .95rem;
    color: #555;
    margin-bottom: 6px;
}

.directorio-item .correo a {
    color: var(--verde);
    text-decoration: none;
    font-weight: 500;
}

.directorio-item .correo a:hover {
    text-decoration: underline;
}

/* ================= MISIÓN / VISIÓN / VALORES ================= */
.mvv-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 20px;
    margin-bottom: 80px;
    padding-left: 40px;
    padding-right: 40px;
}

.mvv-item {
    background: white;
    padding: 35px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
}

.mvv-item h3 {
    color: var(--azul);
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.mvv-item p {
    font-size: 1rem;
    line-height: 1.7;
}

.mvv-item.valores ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mvv-item.valores li {
    margin-bottom: 10px;
    font-size: .95rem;
}

/* Énfasis tipográfico */
.intro .valor {
    font-weight: 600;
    padding: 0 2px;
    white-space: nowrap;
}

.intro .equipo {
    color: #0056a3;
}

.intro .creatividad {
    font-style: italic;
    color: #0077b6;
}

.intro .respeto {
    font-weight: 700;
    color: #003049;
}

/* ================= FOOTER ================= */
.footer {
    background: var(--oscuro);
    color: white;
    padding: 60px 8%;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    gap: 60px;
    justify-content: space-between;
}

.footer-col {
    max-width: 260px;
}

.footer-col img {
    margin-bottom: 10px;
    height: 60px;
    /* Logo footer ajustado */
    width: auto;
}

.footer-col h4 {
    color: var(--verde);
    margin-bottom: 15px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col a {
    color: white;
    text-decoration: none;
    line-height: 1.8;
}

.social {
    display: flex;
    gap: 15px;
    font-size: 1.6rem;
}

.footer-bottom {
    border-top: 1px solid #444;
    margin-top: 40px;
    padding-top: 20px;
    text-align: center;
    color: #aaa;
}

.section-image {
    position: relative;
}

.section-image img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

.section-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(10, 26, 42, .55), rgba(10, 26, 42, .65));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.section-image-title {
    color: white;
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* ================= MENU HAMBURGUESA ================= */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 16px;
    height: 3px;
    background: white;
    margin: 5px 0;
    transition: .3s;
}

/* Estado activo del menú hamburguesa */
.menu.active {
    display: flex;
}


/* ================= RESPONSIVE ================= */
@media (max-width:768px) {

    /* Header: logo izquierda / hamburguesa derecha */
    .header-top {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .header-top {
        padding: 10px 8%;
    }

    .logo img {
        max-width: 100%;
    }

    /* Ocultar logo desktop */
    .logo-desktop {
        display: none;
    }

    /* Mostrar logo mobile */
    .logo-mobile {
        display: block;
        height: 80px;
        /* ajusta según necesidad */
    }

    /* Alineación del contenedor del logo */
    .logo {
        justify-content: flex-start;
    }

    /* Botón hamburguesa */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
    }

    .menu-toggle span {
        width: 36px;
        height: 4px;
        background: #fff;
        display: block;
    }

    /* Buscador + redes debajo */
    .search-social-block {
        width: 100%;
        margin-top: 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }


    .search {
        width: 100%;
        max-width: 280px;
    }

    .search input {
        width: 100%;
        padding: 8px 35px 8px 12px;
        /* espacio para la lupa */
    }

    .menu {
        display: none;
        flex-direction: column;
        gap: 12px;
        padding: 20px 0;
    }

    /* Cambiar logo a SVG responsive usando HTML directamente */
    /* Para que funcione: en HTML reemplaza <img src="images/logo.svg"> por
     <img src="images/logo_responsive.svg" class="logo-responsive"> solo en móvil
     o usando JS si quieres automático. */

    /* Ajustes hero */
    .hero {
        height: 75vh;
    }

    .hero-overlay h1 {
        font-size: 2.2rem;
    }

    .hero-arrow {
        font-size: 1.6rem;
        padding: 10px 14px;
    }

    /* Directorio y MVV */
    .directorio-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .mvv-grid {
        grid-template-columns: 1fr;
    }

    .section-image img {
        height: 300px;
    }

    .section-image-title {
        font-size: 1.9rem;
    }
}