
/* Header topbar width match: align contact row to main menu shell */
:root {
    --ap-header-shell-width-final: 1628px;
    --ap-header-shell-gutter-final: clamp(64px, 11.25vw, 230px);
}

/* The top info bar should not use the full viewport.
   It should sit inside the same visual content rails as the main menu. */
.ap-header-contact-topbar-inner {
    width: auto !important;
    max-width: var(--ap-header-shell-width-final) !important;
    margin-left: var(--ap-header-shell-gutter-final) !important;
    margin-right: var(--ap-header-shell-gutter-final) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Keep the main menu shell on the same rails where possible */
.hg-header .header-five-wrapper,
.rts-header-area-five.header--sticky.hg-header .header-five-wrapper {
    width: auto !important;
    max-width: var(--ap-header-shell-width-final) !important;
    margin-left: var(--ap-header-shell-gutter-final) !important;
    margin-right: var(--ap-header-shell-gutter-final) !important;
}

/* Contact items use the full shell width, not the viewport width */
.ap-header-contact-line {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.2fr) !important;
    align-items: center !important;
    column-gap: clamp(18px, 4vw, 72px) !important;
}
.ap-header-contact-item:nth-child(1) {
    justify-self: start !important;
}
.ap-header-contact-item:nth-child(2) {
    justify-self: center !important;
}
.ap-header-contact-item:nth-child(3) {
    justify-self: end !important;
}
.ap-header-contact-item {
    max-width: 100% !important;
}
.ap-header-contact-item span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Responsive rails */
@media (max-width: 1440px) {
    :root {
        --ap-header-shell-gutter-final: clamp(32px, 5vw, 72px);
        --ap-header-shell-width-final: calc(100vw - (var(--ap-header-shell-gutter-final) * 2));
    }
}
@media (max-width: 1100px) {
    .ap-header-contact-topbar-inner,
    .hg-header .header-five-wrapper,
    .rts-header-area-five.header--sticky.hg-header .header-five-wrapper {
        margin-left: 24px !important;
        margin-right: 24px !important;
        max-width: calc(100vw - 48px) !important;
    }
    .ap-header-contact-line {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        column-gap: 18px !important;
    }
    .ap-header-contact-address {
        display: none !important;
    }
}
@media (max-width: 640px) {
    .ap-header-contact-topbar-inner,
    .hg-header .header-five-wrapper,
    .rts-header-area-five.header--sticky.hg-header .header-five-wrapper {
        margin-left: 14px !important;
        margin-right: 14px !important;
        max-width: calc(100vw - 28px) !important;
    }
}
