
/* ============================================
   CETPRO CLVQ
   ENCABEZADO INSTITUCIONAL RESPONSIVE
============================================ */

:root {
    /* Ancho independiente del encabezado */
    --header-max-width: 1540px;

    /* Separación respecto a los bordes */
    --header-gutter: clamp(16px, 3vw, 64px);

    /* Tamaño y ampliación del escudo */
    --header-logo-size: 68px;
    --header-logo-scale: 1.20;

    /* Dimensiones de navegación */
    --header-nav-height: 88px;
    --header-nav-gap: clamp(12px, 1.25vw, 23px);
}


/* ============================================
   CONTENEDOR GENERAL
============================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    background: rgba(255, 255, 255, 0.97);

    box-shadow:
        0 3px 20px rgba(15, 35, 25, 0.06);
}

/* Aplicamos un ancho mayor SOLO al encabezado */

.site-header .topbar-content,
.site-header .navbar-content {
    width: min(
        calc(100% - 2 * var(--header-gutter)),
        var(--header-max-width)
    );

    max-width: none;
    margin-inline: auto;
}


/* ============================================
   BARRA SUPERIOR
============================================ */

.site-header .topbar {
    background: #083D2B;
    color: #FFFFFF;
}

.site-header .topbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;
    padding-block: 0.45rem;

    font-size: 0.78rem;
}


/* ============================================
   NAVEGACIÓN PRINCIPAL
============================================ */

.site-header .navbar {
    position: relative;
    background: #FFFFFF;
}

.site-header .navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;

    min-height: var(--header-nav-height);

    gap: 2rem;
}


/* ============================================
   IDENTIDAD Y LOGO
============================================ */

.site-header .brand {
    display: flex;
    align-items: center;

    flex: 0 1 auto;

    gap: 0.9rem;
    min-width: 0;
}

/* Contenedor circular del escudo */

.site-header .brand-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;

    width: var(--header-logo-size);
    height: var(--header-logo-size);

    flex-shrink: 0;

    padding: 0;

    border-radius: 50%;
    overflow: hidden;

    background: #FFFFFF;

    box-shadow:
        0 5px 20px rgba(0, 0, 0, 0.08);
}

/* Escudo PNG */

.site-header .brand-logo {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
    object-position: center;

    transform: scale(var(--header-logo-scale));
    transform-origin: center;
}

/* Nombre institucional */

.site-header .brand-text {
    display: flex;
    flex-direction: column;

    min-width: 0;
    gap: 0.15rem;

    line-height: 1.3;
}

.site-header .brand-text strong {
    color: #17352A;

    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.site-header .brand-text small {
    color: #687970;

    font-size: 0.75rem;
    font-weight: 400;
}


/* ============================================
   OPCIONES DEL MENÚ
============================================ */

.site-header .nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    flex-wrap: nowrap;

    gap: var(--header-nav-gap);
    margin-left: auto;
}

/* Enlaces principales */

.site-header .nav-links > a:not(.btn) {
    position: relative;

    padding: 0.6rem 0;

    color: #24372E;

    font-size: 0.88rem;
    font-weight: 600;

    white-space: nowrap;

    transition: color 0.25s ease;
}

/* Línea animada al pasar el mouse */

.site-header .nav-links > a:not(.btn)::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0.25rem;

    height: 2px;

    background: var(--color-primary);

    transform: scaleX(0);
    transform-origin: left;

    transition: transform 0.25s ease;
}

.site-header .nav-links > a:not(.btn):hover {
    color: var(--color-primary);
}

.site-header .nav-links > a:not(.btn):hover::after,
.site-header .nav-links > a.is-current::after {
    transform: scaleX(1);
}


/* ============================================
   BOTÓN REGÍSTRATE
============================================ */

.site-header .nav-cta {
    display: inline-flex;
    justify-content: center;
    align-items: center;

    min-height: 48px;

    padding: 0.75rem 1.6rem;

    margin-left: 0.35rem;

    border-radius: 11px;

    background: var(--color-primary);
    color: #FFFFFF;

    font-size: 0.9rem;
    font-weight: 700;

    white-space: nowrap;

    box-shadow:
        0 5px 14px rgba(15, 107, 70, 0.12);

    transition:
        background 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.site-header .nav-cta:hover {
    background: var(--color-primary-dark);

    transform: translateY(-2px);

    box-shadow:
        0 9px 22px rgba(15, 107, 70, 0.20);
}


/* ============================================
   BOTÓN DEL MENÚ MÓVIL
============================================ */

.site-header .menu-toggle {
    display: none;

    align-items: center;
    justify-content: center;
    flex-direction: column;

    width: 46px;
    height: 46px;

    flex-shrink: 0;

    gap: 5px;

    padding: 0;

    border: 1px solid transparent;
    border-radius: 10px;

    background: transparent;
}

.site-header .menu-toggle span {
    display: block;

    width: 25px;
    height: 2.5px;

    border-radius: 3px;

    background: var(--color-primary);

    transition: transform 0.25s ease;
}


/* ============================================
   TABLETS Y PANTALLAS MEDIANAS
============================================ */

@media (max-width: 1250px) {

    .site-header .navbar-content {
        min-height: 78px;
        gap: 1rem;
    }

    .site-header .brand-logo-wrap {
        width: 60px;
        height: 60px;
    }

    /* Mostrar menú hamburguesa */

    .site-header .menu-toggle {
        display: flex;
    }

    /* Menú desplegable */

    .site-header .nav-links {
        display: none;

        position: absolute;
        top: 100%;

        left: 0;
        right: 0;

        margin: 0;

        flex-direction: column;
        align-items: stretch;

        gap: 0;

        max-height: calc(100dvh - 110px);
        overflow-y: auto;

        padding: 1rem var(--header-gutter) 1.5rem;

        background: #FFFFFF;

        border-top: 1px solid #E8EEE9;

        box-shadow:
            0 14px 26px rgba(0, 0, 0, 0.09);
    }

    .site-header .nav-links.is-open {
        display: flex;

        animation: clvq-menu-entrada 0.25s ease;
    }

    .site-header .nav-links > a:not(.btn) {
        display: block;

        width: 100%;

        padding: 0.9rem 0;

        border-bottom: 1px solid #EDF1EE;

        font-size: 0.94rem;
    }

    .site-header .nav-links > a:not(.btn)::after {
        display: none;
    }

    .site-header .nav-cta {
        width: 100%;

        min-height: 48px;

        margin: 1rem 0 0;
    }

}


/* ============================================
   CELULARES
============================================ */

@media (max-width: 600px) {

    :root {
        --header-gutter: 16px;
    }

    .site-header .topbar-content {
        justify-content: center;
        text-align: center;

        font-size: 0.7rem;
    }

    .site-header .topbar-content span:last-child {
        display: none;
    }

    .site-header .navbar-content {
        min-height: 72px;
    }

    .site-header .brand {
        flex: 1;
        gap: 0.6rem;
    }

    .site-header .brand-logo-wrap {
        width: 54px;
        height: 54px;
    }

    .site-header .brand-logo {
        transform: scale(var(--header-logo-scale));
    }

    .site-header .brand-text strong {
        font-size: 0.9rem;
    }

    .site-header .brand-text small {
        font-size: 0.66rem;
    }

    .site-header .menu-toggle {
        width: 44px;
        height: 44px;
    }

}


/* ============================================
   CELULARES MUY PEQUEÑOS
============================================ */

@media (max-width: 360px) {

    .site-header .brand-logo-wrap {
        width: 47px;
        height: 47px;
    }

    .site-header .brand-text strong {
        font-size: 0.8rem;
    }

    .site-header .brand-text small {
        font-size: 0.58rem;
    }

}


/* ============================================
   ANIMACIONES
============================================ */

@keyframes clvq-menu-entrada {

    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}


/* ============================================
   ACCESIBILIDAD
============================================ */

@media (prefers-reduced-motion: reduce) {

    .site-header .nav-links.is-open {
        animation: none;
    }

    .site-header .nav-links a,
    .site-header .menu-toggle span {
        transition: none;
    }

}
