/* =========================================================
   CORHUILA — HEADER SYSTEM 2026 · v3
   WordPress + The7

   DISTRIBUCIÓN (según el boceto)
   ┌──────────┬──────────────────────────────────────────┐
   │          │ Comunidad: Aspirantes Estudiantes ...     │  fila 1
   │  LOGO    ├──────────────────────────────────────────┤
   │ (grande) │ Institución  Normatividad  ORII ...   (🔍) │  fila 2
   │          ├──────────────────────────────────────────┤
   │          │ Pregrado ⌄  Posgrado ⌄  Educación ...     │  fila 3
   └──────────┴──────────────────────────────────────────┘

   Archivo: /wp-content/chm-header/chm-header.css
========================================================= */


/* =========================================================
   01. VARIABLES
========================================================= */

:root {
    --chm-navy: #152E49;
    --chm-navy-dark: #0F2438;
    --chm-blue: #006983;
    --chm-teal: #00BBAF;
    --chm-green: #1FCE9C;
    --chm-lime: #CEEA00;

    --chm-text: #263746;
    --chm-muted: #5E7283;

    --chm-border: #E3EAF0;
    --chm-soft: #F3F7F9;
    --chm-white: #FFFFFF;

    --chm-accent: linear-gradient(90deg, #00BBAF 0%, #1FCE9C 55%, #CEEA00 100%);

    --chm-container: 1440px;
    --chm-gutter: 32px;

    /* Alturas de las 3 filas */
    --chm-top-height: 42px;
    --chm-brand-height: 64px;
    --chm-nav-height: 58px;

    /* Logo: ancho de la tarjeta (casi cuadrada, con el mismo margen
       en los 4 lados) y espacio que reserva a la izquierda
       (ancho de la tarjeta + separación con el contenido) */
    --chm-logo-w: 140px;
    --chm-logo-space: 188px;

    /* Tamaños de letra y espaciado de los enlaces (fluidos) */
    --chm-fs-nav: clamp(14px, .6vw + 8px, 18px);
    --chm-fs-top: clamp(12.5px, .3vw + 9px, 15px);
    --chm-pad-link: clamp(10px, .9vw, 22px);

    --chm-shadow: 0 16px 40px rgba(21, 46, 73, .14);
}


/* =========================================================
   02. REINICIO
========================================================= */

.chm-header,
.chm-header *,
.chm-backdrop,
.chm-backdrop * {
    box-sizing: border-box;
}

.chm-header {
    position: relative;
    z-index: 9998;

    width: 100%;
    margin: 0;
    padding: 0;

    overflow: visible;
    isolation: isolate;

    background: var(--chm-white);
    color: var(--chm-text);

    font-family: "Source Sans Pro", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.chm-header a {
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
}

.chm-header button {
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.chm-header ul,
.chm-header .chm-root,
.chm-header .chm-sub {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Evita que The7 meta márgenes/rellenos a los ítems (p. ej. li:last-child) */
.chm-header .chm-item,
.chm-header .chm-item:first-child,
.chm-header .chm-item:last-child {
    position: relative;
    float: none !important;

    margin: 0 !important;
    border: 0 !important;
    top: auto !important;
    transform: none;
}

.chm-header .chm-link {
    margin: 0 !important;
    vertical-align: middle;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.chm-header img {
    vertical-align: middle;
}

.chm-wrap,
.chm-top > .chm-wrap,
.chm-brand > .chm-wrap,
.chm-bar > .chm-wrap {
    width: min(var(--chm-container), calc(100% - (var(--chm-gutter) * 2)));
    margin-inline: auto;
}


/* =========================================================
   03. FILA 1 — COMUNIDADES
========================================================= */

.chm-top {
    position: relative;
    z-index: 30;

    width: 100%;
    height: var(--chm-top-height);

    background: var(--chm-navy-dark);
}

.chm-top > .chm-wrap {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    height: 100%;
    padding-left: var(--chm-logo-space);
}

.chm-communities {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center;
    justify-content: center;

    height: 100%;
    gap: 2px;
}

.chm-community-heading {
    display: block;

    margin-right: 10px;

    color: rgba(255, 255, 255, .55);

    font-size: var(--chm-fs-top);
    font-weight: 600;

    white-space: nowrap;
}

.chm-community-link {
    position: relative;

    display: inline-flex;
    align-items: center;

    height: 100%;
    padding: 0 var(--chm-pad-link);

    color: rgba(255, 255, 255, .8);

    font-size: var(--chm-fs-top);
    font-weight: 600;

    white-space: nowrap;

    transition: color .2s ease;
}

.chm-community-link::after {
    content: "";

    position: absolute;
    left: var(--chm-pad-link);
    right: var(--chm-pad-link);
    bottom: 0;

    height: 3px;

    border-radius: 3px 3px 0 0;
    background: var(--chm-lime);

    transform: scaleY(0);
    transform-origin: bottom;

    transition: transform .22s ease;
}

.chm-community-link:hover {
    color: #FFFFFF;
}

.chm-community-link:hover::after {
    transform: scaleY(1);
    background: var(--chm-teal);
}

.chm-community-link.is-active {
    color: var(--chm-lime);
}

.chm-community-link.is-active::after {
    transform: scaleY(1);
    background: var(--chm-lime);
}


/* =========================================================
   04. FILA 2 — MENÚ CORPORATIVO + BUSCADOR
========================================================= */

.chm-brand {
    position: static; /* el logo se posiciona respecto a toda la cabecera */
    z-index: auto;

    width: 100%;
    min-height: var(--chm-brand-height);

    background: var(--chm-white);

    border-bottom: 1px solid var(--chm-border);
}

.chm-brand > .chm-wrap {
    position: static;

    display: flex;
    align-items: stretch;
    justify-content: center;

    min-height: var(--chm-brand-height);

    gap: 14px;
    padding-left: var(--chm-logo-space);
}

/* ---------- LOGO: tarjeta blanca que cruza las 3 filas ---------- */

.chm-logo {
    position: absolute;

    top: 12px;
    bottom: 12px;

    left: max(
        var(--chm-gutter),
        calc((100% - var(--chm-container)) / 2)
    );

    z-index: 60;

    display: flex;
    align-items: center;
    justify-content: center;

    width: var(--chm-logo-w);
    height: auto;

    margin: 0;

    /* Mismo margen en los 4 lados (arriba, abajo, izquierda y derecha) */
    padding: 14px;

    border: 1px solid rgba(21, 46, 73, .06);
    border-radius: 20px;

    background: #FFFFFF;

    box-shadow: 0 10px 30px rgba(15, 36, 56, .2);
}

.chm-logo img {
    display: block;

    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;

    object-fit: contain;
    object-position: center;
}

/* ---------- Menú corporativo ---------- */

.chm-nav--corp {
    display: flex !important;
    align-items: stretch;
    justify-content: center;

    flex: 0 1 auto;
    min-width: 0;
}

.chm-nav--corp > .chm-root {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch;
    justify-content: center;

    min-width: 0;
    gap: 2px;
}

.chm-nav--corp > .chm-root > .chm-item {
    display: flex !important;
    align-items: center;

    flex: 0 0 auto;

    padding: 0 !important;
}

.chm-nav--corp > .chm-root > .chm-item > .chm-link {
    position: relative;

    display: inline-flex;
    align-items: center;

    min-height: 48px;
    padding: 0 var(--chm-pad-link) !important;

    color: var(--chm-navy);

    font-size: var(--chm-fs-nav);
    font-weight: 600;
    line-height: 1.2;

    white-space: nowrap !important;

    transition: color .2s ease;
}

.chm-nav--corp > .chm-root > .chm-item > .chm-link::after {
    content: "";

    position: absolute;
    left: var(--chm-pad-link);
    right: var(--chm-pad-link);
    bottom: 6px;

    height: 2px;

    border-radius: 2px;
    background: var(--chm-teal);

    transform: scaleX(0);
    transform-origin: left;

    transition: transform .25s ease;
}

.chm-nav--corp > .chm-root > .chm-item:hover > .chm-link,
.chm-nav--corp > .chm-root > .chm-item.is-open > .chm-link,
.chm-nav--corp > .chm-root > .chm-item.is-current > .chm-link {
    color: var(--chm-blue);
}

.chm-nav--corp > .chm-root > .chm-item:hover > .chm-link::after,
.chm-nav--corp > .chm-root > .chm-item.is-open > .chm-link::after,
.chm-nav--corp > .chm-root > .chm-item.is-current > .chm-link::after {
    transform: scaleX(1);
}

.chm-nav--corp .chm-toggle {
    color: var(--chm-muted);
}


/* =========================================================
   05. BUSCADOR (lupa + panel)
========================================================= */

.chm-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;
    align-self: center;

    width: 46px;
    height: 46px;

    margin-left: 0;
    padding: 0;

    border: 1px solid var(--chm-border);
    border-radius: 50%;

    background: var(--chm-soft);
    color: var(--chm-navy);

    cursor: pointer;

    transition:
        background .2s ease,
        border-color .2s ease,
        color .2s ease,
        transform .2s ease;
}

.chm-search-toggle:hover,
.chm-search-toggle[aria-expanded="true"] {
    border-color: var(--chm-navy);
    background: var(--chm-navy);
    color: #FFFFFF;
}

.chm-search-toggle:active {
    transform: scale(.94);
}

.chm-search-toggle svg {
    display: block;

    width: 19px;
    height: 19px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chm-search[hidden] {
    display: none !important;
}

.chm-search {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    z-index: 90;

    background: #FFFFFF;

    border-top: 3px solid var(--chm-teal);

    box-shadow: 0 24px 48px rgba(21, 46, 73, .18);

    opacity: 0;
    transform: translateY(-6px);

    transition:
        opacity .2s ease,
        transform .2s ease;
}

.chm-search.is-open {
    opacity: 1;
    transform: translateY(0);
}

.chm-search-inner {
    width: min(var(--chm-container), calc(100% - (var(--chm-gutter) * 2)));
    margin-inline: auto;

    padding: 22px 0 26px var(--chm-logo-space);
}

.chm-search-form {
    display: flex;
    align-items: center;

    gap: 10px;
    margin: 0;
}

.chm-header .chm-search-form input[type="search"] {
    flex: 1 1 auto;

    width: 100%;
    min-width: 0;
    height: 56px;

    margin: 0;
    padding: 0 20px;

    border: 2px solid var(--chm-border);
    border-radius: 14px;

    background: var(--chm-soft);
    color: var(--chm-navy);

    font-family: inherit;
    font-size: 18px;
    font-weight: 600;

    box-shadow: none;
    outline: none;

    transition: border-color .2s ease, background .2s ease;
}

.chm-header .chm-search-form input[type="search"]:focus {
    border-color: var(--chm-teal);
    background: #FFFFFF;
}

.chm-search-submit {
    flex: 0 0 auto;

    height: 56px;
    padding: 0 28px;

    border: 0;
    border-radius: 14px;

    background: var(--chm-navy);
    color: #FFFFFF;

    font-size: 16px;
    font-weight: 700;

    cursor: pointer;

    transition: background .2s ease;
}

.chm-search-submit:hover {
    background: var(--chm-blue);
}

.chm-search-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 44px;
    height: 44px;

    border: 1px solid var(--chm-border);
    border-radius: 50%;

    background: #FFFFFF;
    color: var(--chm-navy);

    font-size: 24px;
    line-height: 1;

    cursor: pointer;
}

.chm-search-close:hover {
    background: var(--chm-soft);
}


/* =========================================================
   06. FILA 3 — MENÚ DE LA SECCIÓN
========================================================= */

.chm-bar {
    position: relative;
    z-index: 35;

    width: 100%;
    min-height: var(--chm-nav-height);

    background: var(--chm-navy);
}

.chm-bar > .chm-wrap {
    display: flex;
    align-items: stretch;
    justify-content: center;

    min-height: var(--chm-nav-height);
    padding-left: var(--chm-logo-space);
}

.chm-nav--main {
    display: block;

    flex: 0 1 auto;
    min-width: 0;
}

.chm-nav--main > .chm-root {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch;
    justify-content: center;

    min-height: var(--chm-nav-height);
}

.chm-nav--main > .chm-root > .chm-item {
    display: flex !important;
    align-items: center;

    flex: 0 0 auto;

    padding: 0 !important;

    transition: background .2s ease, box-shadow .2s ease;
}

.chm-nav--main > .chm-root > .chm-item > .chm-link {
    display: inline-flex;
    align-items: center;

    min-height: var(--chm-nav-height);
    padding: 0 var(--chm-pad-link) !important;

    color: rgba(255, 255, 255, .94);

    font-size: var(--chm-fs-nav);
    font-weight: 600;
    line-height: 1.2;

    white-space: nowrap !important;

    transition: color .2s ease;
}

.chm-nav--main > .chm-root > .chm-item.has-children > .chm-link {
    padding-right: calc(var(--chm-pad-link) * .6) !important;
}

.chm-nav--main .chm-toggle {
    margin-right: 8px;
    color: rgba(255, 255, 255, .8);
}

.chm-nav--main > .chm-root > .chm-item:hover,
.chm-nav--main > .chm-root > .chm-item.is-open {
    background: rgba(255, 255, 255, .08);
    box-shadow: inset 0 -3px 0 var(--chm-teal);
}

.chm-nav--main > .chm-root > .chm-item:hover > .chm-link,
.chm-nav--main > .chm-root > .chm-item.is-open > .chm-link,
.chm-nav--main > .chm-root > .chm-item.is-current > .chm-link {
    color: #FFFFFF;
}

/* Sección activa: fondo muy suave + línea fina, sin llamar demasiado la atención */
.chm-nav--main > .chm-root > .chm-item.is-current {
    background: rgba(255, 255, 255, .07);
    box-shadow: inset 0 -2px 0 rgba(0, 187, 175, .75);
}

.chm-nav--main > .chm-root > .chm-item.is-current:hover,
.chm-nav--main > .chm-root > .chm-item.is-current.is-open {
    background: rgba(255, 255, 255, .12);
    box-shadow: inset 0 -3px 0 var(--chm-teal);
}

/* Acento degradado al final de la cabecera */
.chm-bar::after {
    content: "";

    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    height: 3px;

    background: var(--chm-accent);

    pointer-events: none;
}


/* =========================================================
   07. FLECHAS
========================================================= */

.chm-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 24px;
    height: 36px;

    margin-left: -10px;
    padding: 0;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: currentColor;

    cursor: pointer;
}

.chm-chevron {
    display: block;

    width: 7px;
    height: 7px;

    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;

    transform: rotate(45deg) translateY(-2px);

    transition: transform .22s ease;
}

.chm-item.is-open > .chm-toggle .chm-chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}


/* =========================================================
   08. DESPLEGABLES
========================================================= */

.chm-panel {
    position: absolute;
    top: 100%;
    left: 0;

    z-index: 100;

    display: none;

    width: 300px;
    min-width: 250px;

    margin: 0;
    padding: 8px;

    border: 1px solid var(--chm-border);
    border-top: 3px solid var(--chm-teal);
    border-radius: 0 0 14px 14px;

    background: #FFFFFF;

    box-shadow: var(--chm-shadow);
}

.chm-item.is-open > .chm-panel {
    display: block;
    animation: chm-dropdown-in .2s ease both;
}

@keyframes chm-dropdown-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chm-panel .chm-sub {
    display: flex;
    flex-direction: column;

    gap: 2px;
}

.chm-panel .chm-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    width: 100%;
}

.chm-panel .chm-link {
    display: flex;
    align-items: center;

    flex: 1 1 auto;

    min-height: 42px;
    padding: 9px 14px;

    border-radius: 9px;

    color: var(--chm-text);

    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;

    white-space: normal !important;

    transition:
        color .2s ease,
        background .2s ease,
        padding .2s ease;
}

.chm-panel .chm-link:hover,
.chm-panel .is-current > .chm-link {
    padding-left: 18px;

    color: var(--chm-blue);
    background: var(--chm-soft);
}

.chm-panel .chm-toggle {
    margin: 0 4px 0 0;
    color: var(--chm-muted);
}

.chm-panel .chm-panel {
    top: -9px;
    left: calc(100% + 6px);

    border: 1px solid var(--chm-border);
    border-left: 3px solid var(--chm-teal);
    border-radius: 12px;
}

/* Abrir al pasar el mouse (solo escritorio con mouse) */
@media (min-width: 1025px) and (hover: hover) {

    .chm-nav .chm-item:hover > .chm-panel,
    .chm-nav .chm-item:has(:focus-visible) > .chm-panel {
        display: block;
        animation: chm-dropdown-in .2s ease both;
    }

    .chm-nav .chm-item:hover > .chm-toggle .chm-chevron {
        transform: rotate(225deg) translate(-1px, -1px);
    }
}


/* =========================================================
   09. MEGA MENÚ
========================================================= */

.chm-nav--main .chm-item.is-mega {
    position: static;
}

.chm-nav--main .chm-item.is-mega > .chm-panel {
    top: 100%;
    left: 0;
    right: 0;

    width: 100%;
    min-width: 0;

    padding:
        30px
        max(var(--chm-gutter), calc((100% - var(--chm-container)) / 2))
        34px
        calc(max(var(--chm-gutter), calc((100% - var(--chm-container)) / 2)) + var(--chm-logo-space));

    border: 0;
    border-top: 3px solid var(--chm-teal);
    border-radius: 0 0 18px 18px;

    box-shadow: 0 24px 48px rgba(21, 46, 73, .16);
}

.chm-nav--main .chm-item.is-mega > .chm-panel > .chm-sub {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 6px 32px;
}

.chm-nav--main .chm-item.is-mega > .chm-panel > .chm-sub > .chm-item {
    align-content: flex-start;
}

.chm-nav--main .chm-item.is-mega > .chm-panel > .chm-sub > .chm-item > .chm-link {
    min-height: 44px;
    padding: 10px 0;

    border-bottom: 2px solid var(--chm-border);
    border-radius: 0;

    color: var(--chm-navy);

    font-size: 15px;
    font-weight: 700;
}

.chm-nav--main .chm-item.is-mega > .chm-panel > .chm-sub > .chm-item > .chm-link:hover {
    padding-left: 0;

    border-bottom-color: var(--chm-teal);

    color: var(--chm-blue);
    background: transparent;
}

.chm-nav--main .chm-item.is-mega > .chm-panel .chm-panel {
    position: static;

    display: block;

    width: 100%;
    min-width: 0;

    padding: 4px 0 8px;

    border: 0;
    border-radius: 0;

    background: transparent;
    box-shadow: none;

    animation: none;
}

.chm-nav--main .chm-item.is-mega > .chm-panel .chm-panel .chm-link {
    min-height: 36px;
    padding: 7px 10px;

    color: var(--chm-muted);

    font-size: 14px;
    font-weight: 500;
}

.chm-nav--main .chm-item.is-mega > .chm-panel .chm-panel .chm-link:hover {
    padding-left: 14px;

    color: var(--chm-blue);
    background: var(--chm-soft);
}

.chm-nav--main .chm-item.is-mega > .chm-panel .chm-toggle {
    display: none;
}


/* =========================================================
   10. BOTÓN HAMBURGUESA
========================================================= */

.chm-burger {
    display: none;

    align-items: center;
    justify-content: center;
    flex-direction: column;

    flex: 0 0 46px;
    align-self: center;

    width: 46px;
    height: 46px;

    gap: 5px;
    padding: 0;

    border: 1px solid var(--chm-border);
    border-radius: 12px;

    background: var(--chm-white);

    cursor: pointer;

    transition:
        background .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.chm-burger:hover {
    background: var(--chm-soft);
    border-color: #C9DCE3;
}

.chm-burger:active {
    transform: scale(.96);
}

.chm-burger span {
    display: block;

    width: 20px;
    height: 2px;

    border-radius: 2px;

    background: var(--chm-navy);
}

.chm-burger span:nth-child(2) {
    width: 14px;
    align-self: flex-end;
    margin-right: 13px;
}


/* =========================================================
   11. FONDO OSCURO DEL MENÚ MÓVIL
========================================================= */

.chm-backdrop[hidden] {
    display: none !important;
}

.chm-backdrop {
    position: fixed;
    inset: 0;

    z-index: 9997;

    background: rgba(10, 26, 42, .62);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}


/* =========================================================
   12. PANEL LATERAL MÓVIL
========================================================= */

.chm-drawer {
    position: fixed;
    top: 0;
    right: 0;

    z-index: 9999;

    display: flex;
    flex-direction: column;

    width: min(420px, 92vw);

    height: 100vh;
    height: 100dvh;

    overflow: hidden;

    background: #FFFFFF;

    box-shadow: -16px 0 50px rgba(0, 0, 0, .2);

    transform: translateX(105%);
    visibility: hidden;

    transition:
        transform .32s cubic-bezier(.2, .8, .2, 1),
        visibility .32s ease;
}

.chm-drawer.is-open,
.chm-drawer[aria-hidden="false"] {
    transform: translateX(0);
    visibility: visible;
}

.chm-drawer-head {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    flex: 0 0 auto;

    min-height: 72px;
    padding: 14px 20px 14px 22px;

    background: var(--chm-navy);
    color: #FFFFFF;

    font-size: 16px;
    font-weight: 700;
}

.chm-drawer-head::after {
    content: "";

    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    height: 3px;

    background: var(--chm-accent);
}

.chm-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;

    background: rgba(255, 255, 255, .08);
    color: #FFFFFF;

    font-size: 26px;
    line-height: 1;

    cursor: pointer;

    transition: background .2s ease;
}

.chm-close:hover {
    background: rgba(255, 255, 255, .18);
}

.chm-drawer-content {
    flex: 1 1 auto;

    min-height: 0;
    overflow-y: auto;

    padding: 22px;

    overscroll-behavior: contain;

    scrollbar-width: thin;
    scrollbar-color: #C6D4DC transparent;
}

/* Buscador dentro del panel móvil */
.chm-drawer-search {
    display: flex;
    gap: 8px;

    margin: 0 0 22px;
}

.chm-header .chm-drawer-search input[type="search"] {
    flex: 1 1 auto;

    width: 100%;
    min-width: 0;
    height: 48px;

    margin: 0;
    padding: 0 14px;

    border: 2px solid var(--chm-border);
    border-radius: 12px;

    background: var(--chm-soft);
    color: var(--chm-navy);

    font-family: inherit;
    font-size: 16px;
    font-weight: 600;

    box-shadow: none;
    outline: none;
}

.chm-header .chm-drawer-search input[type="search"]:focus {
    border-color: var(--chm-teal);
    background: #FFFFFF;
}

.chm-drawer-search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 48px;

    width: 48px;
    height: 48px;

    padding: 0;

    border: 0;
    border-radius: 12px;

    background: var(--chm-navy);
    color: #FFFFFF;

    cursor: pointer;
}

.chm-drawer-search button svg {
    width: 20px;
    height: 20px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chm-mobile-label {
    display: block;

    margin: 0 0 12px;

    color: var(--chm-muted);

    font-size: 13px;
    font-weight: 700;
}

.chm-mobile-communities,
.chm-mobile-corp,
.chm-mobile-main {
    margin-bottom: 24px;
    padding-bottom: 22px;

    border-bottom: 1px solid var(--chm-border);
}

.chm-mobile-main {
    margin-bottom: 0;
    border-bottom: 0;
}

.chm-community-mobile-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 8px;
}

.chm-community-mobile-links a {
    display: flex;
    align-items: center;

    min-height: 46px;
    padding: 10px 14px;

    border: 1px solid var(--chm-border);
    border-radius: 10px;

    background: #FFFFFF;
    color: var(--chm-navy);

    font-size: 14px;
    font-weight: 600;

    transition: background .2s ease, border-color .2s ease;
}

.chm-community-mobile-links a:hover {
    background: var(--chm-soft);
}

.chm-community-mobile-links a.is-active {
    border-color: var(--chm-teal);
    background: #E8F8F6;
    color: var(--chm-blue);
}

.chm-mobile-list,
.chm-mobile-list .chm-sub {
    display: flex;
    flex-direction: column;

    gap: 0;
}

.chm-mobile-list .chm-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    width: 100%;

    border-bottom: 1px solid #EDF1F4 !important;
}

.chm-mobile-list .chm-link {
    display: flex;
    align-items: center;

    flex: 1 1 auto;

    min-height: 50px;
    padding: 10px 4px;

    color: var(--chm-navy);

    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.35;

    white-space: normal;
}

.chm-mobile-list .chm-item.is-current > .chm-link {
    color: var(--chm-blue);
}

.chm-mobile-list .chm-toggle {
    width: 44px;
    height: 44px;

    margin: 0;

    border-radius: 10px;

    color: var(--chm-navy);
}

.chm-mobile-list .chm-item.is-open > .chm-toggle {
    background: var(--chm-soft);
}

.chm-mobile-list .chm-panel {
    position: static;

    display: none;

    width: 100%;
    min-width: 0;

    margin: 0;
    padding: 2px 0 10px 12px;

    border: 0;
    border-left: 2px solid var(--chm-teal);
    border-radius: 0;

    background: transparent;
    box-shadow: none;
}

.chm-mobile-list .chm-item.is-open > .chm-panel {
    display: block;
    animation: none;
}

.chm-mobile-list .chm-panel .chm-item {
    border-bottom: 0 !important;
}

.chm-mobile-list .chm-panel .chm-link {
    min-height: 42px;
    padding: 8px 10px;

    border-radius: 8px;

    color: #4F6275;

    font-size: 14.5px;
    font-weight: 500;
}

.chm-mobile-list .chm-panel .chm-link:hover {
    padding-left: 10px;

    color: var(--chm-blue);
    background: var(--chm-soft);
}

.chm-mobile-list .chm-panel .chm-panel {
    margin-left: 6px;
    padding-left: 10px;

    border-left-width: 1px;
}


/* =========================================================
   13. LAPTOPS Y PANTALLAS GRANDES
========================================================= */

@media (min-width: 1025px) and (max-width: 1250px) {

    :root {
        --chm-gutter: 24px;
        --chm-logo-w: 140px;
        --chm-logo-space: 184px;
    }
}

@media (min-width: 1900px) {

    :root {
        --chm-container: 1640px;

        --chm-top-height: 46px;
        --chm-brand-height: 70px;
        --chm-nav-height: 62px;

        --chm-logo-w: 154px;
        --chm-logo-space: 202px;

        --chm-fs-nav: 19px;
        --chm-fs-top: 15.5px;
    }
}


/* =========================================================
   14. TABLET Y MÓVIL (≤ 1024px)
========================================================= */

@media (max-width: 1024px) {

    :root {
        --chm-gutter: 20px;
        --chm-brand-height: 74px;
    }

    .chm-top,
    .chm-nav--corp,
    .chm-bar {
        display: none !important;
    }

    .chm-brand {
        position: relative;

        border-bottom: 0;
        box-shadow: 0 4px 18px rgba(21, 46, 73, .08);
    }

    .chm-brand::after {
        content: "";

        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;

        height: 3px;

        background: var(--chm-accent);
    }

    .chm-brand > .chm-wrap {
        align-items: center;
        justify-content: flex-start;

        gap: 10px;
        padding: 10px 0;
    }

    /* El logo vuelve a ser un elemento normal */
    .chm-logo {
        position: static;

        flex: 0 1 auto;

        width: auto;
        height: 54px;

        padding: 0;

        border-radius: 0;

        background: transparent;
        box-shadow: none;
    }

    .chm-logo img {
        width: auto;
        height: 100%;
        max-width: 240px;
    }

    .chm-burger {
        display: inline-flex;
    }

    .chm-search-toggle {
        width: 44px;
        height: 44px;

        margin-left: auto;
    }

    .chm-search-inner {
        width: calc(100% - (var(--chm-gutter) * 2));
        padding: 16px 0 20px;
    }

    .chm-header .chm-search-form input[type="search"],
    .chm-search-submit {
        height: 50px;
    }

    .chm-search-submit {
        padding: 0 20px;
    }

    .chm-search-close {
        display: none;
    }
}

@media (max-width: 767px) {

    :root {
        --chm-gutter: 16px;
        --chm-brand-height: 68px;
    }

    .chm-logo {
        height: 46px;
    }

    .chm-logo img {
        max-width: 200px;
    }

    .chm-burger {
        flex-basis: 44px;

        width: 44px;
        height: 44px;
    }

    .chm-drawer {
        width: min(400px, 94vw);
    }

    .chm-drawer-content {
        padding: 18px;
    }
}

@media (max-width: 380px) {

    .chm-logo {
        height: 40px;
    }

    .chm-drawer-head {
        min-height: 64px;
        padding-inline: 16px;
    }

    .chm-community-mobile-links {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   15. ACCESIBILIDAD
========================================================= */

.chm-header a:focus-visible,
.chm-header button:focus-visible {
    outline: 3px solid var(--chm-teal);
    outline-offset: 2px;
}

.chm-top a:focus-visible,
.chm-bar a:focus-visible,
.chm-bar button:focus-visible,
.chm-drawer-head button:focus-visible {
    outline-color: var(--chm-lime);
}

.chm-header .chm-link[aria-current="page"] {
    font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {

    .chm-header *,
    .chm-backdrop {
        scroll-behavior: auto !important;

        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;

        transition-duration: .01ms !important;
    }
}


/* =========================================================
   16. REDES SOCIALES
========================================================= */

/* Esquina derecha de la barra de comunidades */
.chm-social {
    position: absolute;
    top: 0;
    right: 0;

    display: flex;
    align-items: center;

    height: 100%;
    gap: 2px;
}

.chm-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    border-radius: 50%;

    color: rgba(255, 255, 255, .82);

    transition:
        color .2s ease,
        background .2s ease,
        transform .2s ease;
}

.chm-social-link svg {
    display: block;

    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chm-social-link:hover {
    color: var(--chm-navy-dark);
    background: var(--chm-lime);

    transform: translateY(-1px);
}

/* Panel lateral móvil */
.chm-mobile-label--social {
    margin-top: 24px;
}

.chm-drawer-social {
    display: flex;
    gap: 10px;
}

.chm-drawer-social .chm-social-link {
    width: 44px;
    height: 44px;

    border: 1px solid var(--chm-border);

    background: var(--chm-soft);
    color: var(--chm-navy);
}

.chm-drawer-social .chm-social-link svg {
    width: 20px;
    height: 20px;
}

.chm-drawer-social .chm-social-link:hover {
    border-color: var(--chm-navy);

    background: var(--chm-navy);
    color: #FFFFFF;
}

/* Laptops: reserva espacio para que las comunidades sigan centradas */
@media (min-width: 1025px) and (max-width: 1250px) {

    .chm-top > .chm-wrap {
        padding-right: 128px;
    }

    .chm-social-link {
        width: 30px;
        height: 30px;
    }

    .chm-social-link svg {
        width: 16px;
        height: 16px;
    }
}

@media (min-width: 1900px) {

    .chm-social-link {
        width: 38px;
        height: 38px;
    }

    .chm-social-link svg {
        width: 20px;
        height: 20px;
    }
}


/* =========================================================
   17. DESPLEGABLES — CORRECCIONES DE DISEÑO
   · La flecha ya no cae a otra línea cuando el texto es largo
   · Panel más ancho y filas con fondo completo al pasar el mouse
   · Flecha hacia la derecha en los submenús laterales
   · Puente de hover para que el submenú no se cierre al cruzar
========================================================= */

/* Panel más cómodo para nombres largos */
.chm-nav .chm-panel {
    width: 340px;
    min-width: 280px;
}

/* Fila: texto flexible + flecha fija, siempre en la misma línea */
.chm-panel .chm-item,
.chm-mobile-list .chm-item {
    flex-wrap: wrap;
    align-items: center;
}

.chm-panel .chm-item > .chm-link,
.chm-mobile-list .chm-item > .chm-link {
    flex: 1 1 0;
    min-width: 0;
}

.chm-panel .chm-item > .chm-toggle {
    flex: 0 0 auto;

    width: 34px;
    height: 34px;

    margin: 0 6px 0 0;
}

/* La fila completa se resalta, no solo el texto */
.chm-panel .chm-item {
    border-radius: 10px;

    transition: background .2s ease;
}

.chm-panel .chm-item:hover,
.chm-panel .chm-item.is-open,
.chm-panel .chm-item.is-current {
    background: var(--chm-soft);
}

.chm-panel .chm-item > .chm-link:hover,
.chm-panel .chm-item.is-current > .chm-link {
    background: transparent;
}

.chm-panel .chm-item:hover > .chm-toggle,
.chm-panel .chm-item.is-open > .chm-toggle {
    color: var(--chm-blue);
}

/* Flecha apuntando al lado donde se abre el submenú (escritorio) */
@media (min-width: 1025px) {

    .chm-nav .chm-panel .chm-chevron,
    .chm-nav .chm-panel .chm-item:hover > .chm-toggle .chm-chevron,
    .chm-nav .chm-panel .chm-item.is-open > .chm-toggle .chm-chevron {
        transform: rotate(-45deg);
    }

    /* Submenú lateral alineado con el borde del panel padre */
    .chm-nav .chm-panel .chm-panel {
        top: -9px;
        left: calc(100% + 8px);
    }

    /* Puente invisible: mantiene el hover al cruzar el espacio entre paneles */
    .chm-nav .chm-panel .chm-panel::before {
        content: "";

        position: absolute;
        top: 0;
        bottom: 0;
        left: -18px;

        width: 18px;
    }
}

/* Móvil: la flecha sí apunta hacia abajo y la fila se ve limpia */
.chm-mobile-list .chm-item > .chm-toggle {
    flex: 0 0 auto;

    margin: 0;
}

/* El <picture> no debe alterar el layout del logo */
.chm-logo picture {
    display: contents;
}

/* =========================================================
   18. LUPA EN MÓVIL — blindaje contra estilos del tema
========================================================= */

/* Lupa de la barra superior */
.chm-header .chm-search-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;

    flex: 0 0 auto;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;

    border: 1px solid var(--chm-border) !important;
    border-radius: 50% !important;

    background: var(--chm-soft) !important;
    color: var(--chm-navy) !important;
    box-shadow: none !important;
    line-height: 1;
}

.chm-header .chm-search-toggle[aria-expanded="true"] {
    background: var(--chm-navy) !important;
    border-color: var(--chm-navy) !important;
    color: #FFFFFF !important;
}

.chm-header .chm-search-toggle svg,
.chm-header .chm-drawer-search button svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2.2 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chm-header .chm-search-toggle svg *,
.chm-header .chm-drawer-search button svg * {
    fill: none !important;
    stroke: currentColor !important;
}

/* Botón de buscar dentro del panel lateral */
.chm-header .chm-drawer-search {
    align-items: center;
}

.chm-header .chm-drawer-search button[type="submit"] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    flex: 0 0 48px;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 12px !important;

    background: var(--chm-navy) !important;
    color: #FFFFFF !important;
    box-shadow: none !important;
}

/* =========================================================
   FIN — CORHUILA HEADER SYSTEM 2026 · v3
========================================================= */