/**
 * Stable header chrome — phone, top bar, YouTube/Google badges.
 * Loaded from layout on every page (including FPC). Does not depend on CMS JIT.
 * CMS blocks header-top-bar / header-phone-desktop / header-phone-mobile
 * use only these classes + theme utilities (container, flex, gap-1).
 */

/* --- Top bar --- */
#header .header-topbar {
    width: 100%;
    background-color: #fff;
    border-bottom: 1px solid var(--color-border);
}

@media (min-width: 1024px) {
    #header .header-topbar {
        background-color: var(--color-topbar);
        border-bottom: 0;
    }
}

#header .header-topbar__inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0;
}

@media (min-width: 1024px) {
    #header .header-topbar__inner {
        justify-content: flex-start;
        gap: 1.25rem;
    }
}

/*
 * CMS outputs nav + badges as siblings. display:contents lets them
 * participate in __inner flex so badges can ml-auto to the right edge.
 */
#header .header-topbar__cms {
    display: contents;
}

@media (max-width: 1023px) {
    #header .header-topbar__cms {
        display: none;
    }
}

#header .header-topbar__lang {
    position: relative;
    flex-shrink: 0;
}

#header .header-topbar__lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.8125rem 0.875rem 0.8125rem 1.25rem;
    min-height: 2.5rem;
    border: 0;
    border-right: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    cursor: pointer;
}

@media (min-width: 1024px) {
    #header .header-topbar__lang-btn {
        padding: 0.8125rem 1.25rem 0.8125rem 0;
        min-height: 0;
    }
}

#header .header-topbar__lang-btn--static {
    cursor: default;
}

#header .header-topbar__lang-flag {
    display: block;
    width: 1.25rem;
    height: 0.875rem;
    object-fit: cover;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    #header .header-topbar__lang-flag {
        width: 1.75rem;
        height: 1.25rem;
    }
}

#header .header-topbar__lang-label {
    display: inline-flex;
    align-items: center;
}

#header .header-topbar__lang-code {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    color: var(--color-primary);
    white-space: nowrap;
}

#header .header-topbar__lang-caret {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

#header .header-topbar__lang-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 40;
    min-width: 11rem;
    margin-top: 0.25rem;
    padding: 0.5rem 0;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(6, 40, 90, 0.12);
}

#header .header-topbar__lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
}

#header .header-topbar__lang-option:hover {
    background: var(--color-topbar);
    text-decoration: none;
}

#header .header-topbar__lang-name {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-dark-grey);
}

#header .header-topbar__nav {
    display: none;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2rem;
    margin: 0;
    padding: 0.8125rem 0;
    flex-shrink: 1;
    min-width: 0;
}

@media (min-width: 1024px) {
    #header .header-topbar__nav {
        display: flex;
    }
}

#header .header-topbar__link {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--color-primary);
    white-space: nowrap;
    text-decoration: none;
}

#header .header-topbar__link:hover {
    text-decoration: underline;
}

#header .header-topbar__badges {
    display: none;
    flex-wrap: nowrap;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

@media (min-width: 1024px) {
    #header .header-topbar__badges {
        display: flex;
    }
}

#header .header-topbar__badge-youtube {
    display: flex;
    align-items: center;
    border-right: 1px solid var(--color-border);
    padding-right: 1.25rem;
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}

#header .header-topbar__badge-google {
    display: flex;
    align-items: center;
    padding-left: 1.25rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

#header .header-topbar__badge-youtube img {
    display: block;
    width: 5rem;
    height: auto;
    max-height: 1.125rem;
}

#header .header-topbar__badge-google img {
    display: block;
    width: 5.4375rem;
    height: auto;
    max-height: 1.9375rem;
}

/* Mobile top-bar phone (desktop uses .header-phone in main row) */
#header .header-topbar__phone-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-left: auto;
    /* Horizontal inset comes from .container — extra padding-right was the visible right gap */
    padding: 0.625rem 0;
    color: var(--color-accent);
    text-decoration: none;
    flex-shrink: 0;
}

#header .header-topbar__phone-mobile:hover {
    text-decoration: none;
}

#header .header-topbar__phone-mobile-icon {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

#header .header-topbar__phone-mobile-number {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25rem;
    color: var(--color-accent);
    white-space: nowrap;
}

@media (min-width: 1024px) {
    #header .header-topbar__phone-mobile {
        display: none;
    }
}

/* --- Phone --- */
#header .header-phone {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

#header .header-phone-hours {
    font-size: 0.75rem;
    line-height: 0.875rem;
    letter-spacing: 0.1px;
    color: var(--color-dark-grey);
    white-space: nowrap;
}

#header .header-phone-number {
    font-size: 1.5rem;
    line-height: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.48px;
    color: var(--color-accent);
    white-space: nowrap;
    text-decoration: none;
}

#header .header-phone-number:hover {
    text-decoration: underline;
}

/* --- Checkout header --- */
#header.checkout-header {
    background-color: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: none;
}

@media (width < 1024px) {
    #header.checkout-header > div {
        gap: 16px;
        padding-block: 12px;
    }

    #header.checkout-header img {
        max-width: 150px;
        height: auto;
    }

    #header.checkout-header .header-phone-hours {
        font-size: 0.6875rem;
        line-height: 0.875rem;
    }

    #header.checkout-header .header-phone-number {
        font-size: 1rem;
        line-height: 1.25rem;
    }
}
