/* ==========================================================================
   Header — mobile first
   ========================================================================== */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-azul);
    padding: 1.125rem 0;
}

.header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Logo */
.header__logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    flex-shrink: 0;
    z-index: 102;
}

.header__logo-image {
    display: block;
    width: auto;
    height: 1.25rem;
}

.header__tagline {
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-amarillo);
    letter-spacing: 0.08em;
    line-height: 1.2;
    white-space: nowrap;
}

/* Toggle */
.header__toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.25rem;
    height: 2.25rem;
    z-index: 102;
    padding: 0.25rem;
}

.header__toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-blanco);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.header--open .header__toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.header--open .header__toggle-bar:nth-child(2) {
    opacity: 0;
}

.header--open .header__toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Nav */
.header__nav {
    position: fixed;
    inset: 0;
    z-index: 101;
    background-color: var(--color-azul);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 5rem 1.5rem 2rem;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}

.header--open .header__nav {
    opacity: 1;
    visibility: visible;
}

.header__menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.125rem;
    width: 100%;
    max-width: 320px;
}

.header__item {
    line-height: 1;
    width: 100%;
    text-align: center;
}

.header__link {
    display: inline-block;
    font-size: 0.9375rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-blanco);
    letter-spacing: 0.03em;
    padding: 0.375rem 0.5rem;
    transition: color var(--transition);
    position: relative;
}

.header__link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-amarillo);
    transition: width var(--transition);
}

.header__link:hover,
.header__link:focus-visible {
    color: var(--color-amarillo);
}

.header__link:hover::after,
.header__link:focus-visible::after {
    width: 100%;
}

.header__link--active,
.header__link--active:hover,
.header__link--active:focus-visible {
    color: var(--color-amarillo);
}

.header__link--active::after {
    width: 100%;
}

/* CTA */
.header__cta {
    flex-shrink: 0;
    width: 100%;
    max-width: 320px;
    justify-content: center;
    white-space: nowrap;
}

.header__cta::after {
    content: none;
}

/* ==========================================================================
   Breakpoints
   ========================================================================== */

@media (min-width: 768px) {
    .header__logo-image {
        height: 1.4rem;
    }

    .header__tagline {
        font-size: 0.625rem;
    }
}

@media (min-width: 1024px) {
    .header {
        padding: 1.25rem 0;
    }

    .header__container {
        gap: 0.75rem;
    }

    .header__toggle {
        display: none;
    }

    .header__nav {
        position: static;
        z-index: auto;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0.625rem;
        flex: 1;
        min-width: 0;
        padding: 0;
        overflow: visible;
        opacity: 1;
        visibility: visible;
        background: none;
    }

    .header__menu {
        flex: 1;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        gap: 0;
        width: auto;
        max-width: none;
    }

    .header__item {
        width: auto;
        text-align: left;
    }

    .header__link {
        font-size: 0.625rem;
        font-weight: 700;
        padding: 0.3125rem 0.3125rem;
        white-space: nowrap;
    }

    .header__link::after {
        bottom: 0.125rem;
        height: 1.5px;
    }

    .header__cta {
        width: auto;
        max-width: none;
    }
}

@media (min-width: 1200px) {
    .header__container {
        gap: 1rem;
    }

    .header__tagline {
        font-size: 0.6875rem;
    }

    .header__link {
        font-size: 0.75rem;
        padding: 0.3125rem 0.4375rem;
    }
}

@media (min-width: 1360px) {
    .header__link {
        font-size: 0.8125rem;
        padding: 0.375rem 0.5rem;
    }
}
