.anpa-header {
    color: #101776;
    background: #fff;
    border-bottom: 2px solid #ffc400;
    font-family: inherit;
}
.anpa-header__limite { width: min(92%, 1380px); margin-inline: auto; }
.anpa-header__contacto { background: #e0f4ff; }
.anpa-header__contacto .anpa-header__limite {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    min-height: 30px;
    padding-block: 4px;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
}
.anpa-header__contacto span { display: inline-flex; align-items: center; gap: 7px; }
.anpa-header__contacto span + span { border-left: 1px solid #9cc5df; padding-left: 18px; }
.anpa-header__contacto svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.anpa-header__contacto a { color: inherit; text-decoration: none; }
.anpa-header__contacto a:hover { text-decoration: underline; }
.anpa-header__barra {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    min-height: 80px;
    padding-block: 8px;
}
.anpa-header__marca { display: block; }
.anpa-header__marca img { display: block; width: 240px; height: 62px; object-fit: contain; object-position: left center; }
.anpa-header__menu { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; }
.anpa-header__menu a {
    position: relative;
    padding: 10px 16px;
    border-radius: 999px;
    color: #101776;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 550;
    text-decoration: none;
    white-space: nowrap;
}
.anpa-header__menu a:hover { background: #f0f9ff; }
.anpa-header__menu a[aria-current="page"] { background: #e0f4ff; }
.anpa-header__menu a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 25%;
    right: 25%;
    bottom: 4px;
    height: 3px;
    border-radius: 4px;
    background: #ffc400;
}
.anpa-header__familias {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 999px;
    background: #e0f4ff;
    padding: 11px 18px;
    color: #101776;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 550;
    text-decoration: none;
    white-space: nowrap;
}
.anpa-header__familias svg { width: 22px; height: 22px; flex-shrink: 0; }
.anpa-header__familias:hover, .anpa-header__familias[aria-current="page"] { background: #c8eaff; }
.anpa-header a:focus-visible { outline: 3px solid #1744b8; outline-offset: 3px; }
@media (max-width: 1080px) {
    .anpa-header__barra { grid-template-columns: 200px minmax(0, 1fr) auto; gap: 12px; }
    .anpa-header__marca img { width: 200px; }
    .anpa-header__menu a { font-size: 14px; padding-inline: 10px; }
    .anpa-header__familias { font-size: 14px; padding-inline: 12px; }
}
@media (max-width: 820px) {
    .anpa-header__barra { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
    .anpa-header__marca img { width: min(200px, 100%); height: 54px; }
    .anpa-header__menu { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; padding-bottom: 4px; }
}
@media (max-width: 380px) {
    .anpa-header__familias { gap: 6px; font-size: 12px; padding: 9px; }
    .anpa-header__familias svg { width: 17px; }
    .anpa-header__contacto .anpa-header__limite { font-size: 10px; gap: 5px 8px; }
    .anpa-header__contacto span + span { padding-left: 8px; }
}
/* Trazo de subliñador */
.anpa-header__menu a {
    isolation: isolate;
    transition: color 180ms ease;
}

.anpa-header__menu a::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 10%;
    right: 10%;
    bottom: 24%;
    height: 38%;
    border-radius: 3px 8px 4px 6px;
    background: #ffdb38;
    opacity: 0;
    transform: scaleX(0) rotate(-2deg);
    transform-origin: left center;
    transition:
        transform 300ms cubic-bezier(.2, .8, .2, 1),
        opacity 180ms ease;
}

.anpa-header__menu a:hover,
.anpa-header__menu a:focus-visible {
    background: transparent;
    color: #101776;
}

.anpa-header__menu a:hover::before,
.anpa-header__menu a:focus-visible::before {
    opacity: 1;
    transform: scaleX(1) rotate(-2deg);
}

/* Conserva o fondo da páxina activa */
.anpa-header__menu a[aria-current="page"] {
    background: #e0f4ff;
}

/* Área de familias como etiqueta adhesiva */
.anpa-header__familias {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 16px;
    transform-origin: center;
    transition:
        transform 280ms cubic-bezier(.2, .8, .2, 1),
        box-shadow 280ms ease,
        background-color 280ms ease;
}

.anpa-header__familias::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 23px;
    height: 23px;
    background: linear-gradient(
        135deg,
        #e8ae00 0%,
        #ffdb38 49%,
        #fff6ca 50%,
        #fff6ca 100%
    );
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    opacity: 0;
    transform: translate(10px, 10px);
    transition:
        transform 280ms ease,
        opacity 180ms ease;
    pointer-events: none;
}

.anpa-header__familias:hover,
.anpa-header__familias:focus-visible {
    background: #d4efff;
    transform: translateY(-3px) rotate(-1.5deg);
    box-shadow: 3px 7px 0 rgb(16 23 118 / 10%);
}

.anpa-header__familias:hover::after,
.anpa-header__familias:focus-visible::after {
    opacity: 1;
    transform: translate(0, 0);
}

.anpa-header__familias:active {
    transform: translateY(-1px) rotate(0);
    box-shadow: 1px 3px 0 rgb(16 23 118 / 10%);
}

/* Respecta a preferencia de movemento reducido */
@media (prefers-reduced-motion: reduce) {
    .anpa-header__menu a,
    .anpa-header__menu a::before,
    .anpa-header__familias,
    .anpa-header__familias::after {
        transition: none;
    }

    .anpa-header__familias:hover,
    .anpa-header__familias:focus-visible,
    .anpa-header__familias:active {
        transform: none;
    }
}
/* Elimina o subliñado tradicional */
.anpa-header__menu a,
.anpa-header__menu a:hover,
.anpa-header__menu a:focus-visible,
.anpa-header__familias,
.anpa-header__familias:hover,
.anpa-header__familias:focus-visible {
    text-decoration: none;
}

/* Retira a liña inferior da opción activa */
.anpa-header__menu a::after {
    content: none;
}