header {
    position: relative;
    padding: var(--space-block) 0;
    background-color: var(--brand-colour-header);
}

header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--header-border-thickness);
    background: var(--header-border-pink);
}

.header-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-block);
}

.header-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-inline);
    flex: 1 1 auto;
    min-width: 0;
}

.header-brand__row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-inline);
}

.header-logo {
    display: inline-block;
    line-height: 0;
}

.header-logo img {
    display: block;
    max-height: 4rem;
    width: auto;
}

.header-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: var(--nav-button-border-radius);
    background-color: var(--brand-colour-primary);
    color: var(--brand-colour-text);
    cursor: pointer;
}

.header-nav-toggle:hover {
    background-color: var(--brand-colour-surface-hover);
}

.header-nav-toggle:focus-visible {
    outline: 2px solid var(--brand-colour-link-dark);
    outline-offset: 2px;
}

.header-nav-toggle svg {
    width: 1.5rem;
    height: 1.5rem;
}

.header-nav-bar {
    width: 100%;
}

.header-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-nav__close {
    display: none;
}

.header-nav a,
.header-nav button {
    color: #fff;
    font-family: var(--font-family-primary);
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 1em;
}

.header-nav a:hover {
    color: var(--brand-colour-link-light);
}

.header-nav a:focus-visible {
    outline: 2px solid var(--brand-colour-link-dark);
    outline-offset: 2px;
}

.header-phone .btn {
    white-space: nowrap;
    border-radius: 50px;
    background-color: #ffffff0d;
    border: 0;
    transition: all 0.2s ease;
}

.header-phone .btn:hover {
    background-color: rgb(255 255 255 / 18%);
    color: var(--brand-colour-link-light);
}

.header-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-inline);
    flex-shrink: 0;
}

.header-contact .header-socials a {
    filter: grayscale(100);
}

.header-contact .header-socials a:hover {
    filter: grayscale(0);
}

.header-contact .header-socials img {
    display: block;
    height: 3rem;
    width: auto;
}

@media (width > 992px) {
    .header-brand {
        flex-direction: row;
        align-items: center;
        gap: var(--space-block);
    }

    .header-brand__row {
        flex-shrink: 0;
    }

    .header-nav-bar {
        flex: 1 1 auto;
        width: auto;
    }

    .header-nav-bar.collapsed .header-nav,
    .header-nav-bar:not(.collapsed) .header-nav {
        display: flex;
    }
}

@media (width <= 992px) {
    .header-nav-toggle {
        display: inline-flex;
    }

    .header-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .header-contact {
        width: 100%;
        justify-content: center;
    }

    .header-nav-bar.collapsed .header-nav {
        display: none;
    }

    .header-nav-bar:not(.collapsed) {
        position: fixed;
        inset: 0;
        z-index: 300;
        padding: var(--space-block);
        background-color: rgb(0 0 0 / 95%);
        overflow-y: auto;
    }

    .header-nav-bar:not(.collapsed) .header-nav {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0;
        max-width: 28rem;
        margin: 0 auto;
        padding-top: 3rem;
    }

    .header-nav__close {
        display: block;
    }

    .header-nav__close button {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 1rem;
        border: 0;
        border-radius: var(--border-radius-s);
        background-color: var(--brand-colour-primary);
        cursor: pointer;
    }

    .header-nav__close button:hover {
        background-color: var(--brand-colour-surface-hover);
    }

    .header-nav__close svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .header-nav-bar:not(.collapsed) .header-nav li:not(.header-nav__close) a {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid var(--brand-colour-secondary);
        font-size: 1rem;
    }
}

@media (width <= 576px) {
    .header-logo img {
        max-height: 3rem;
    }

    .header-contact .header-socials img {
        height: 2.5rem;
    }

    .header-phone {
        width: 100%;
    }

    .header-phone .btn {
        width: 100%;
        justify-content: center;
    }
}
