/*
 * Public zekabooking brand lockup.
 *
 * This file is deliberately scoped to public/consumer headers. The logged-in
 * business portal/sidebar is not targeted here.
 */

/* =========================================================
   Marketing / platform public header
   ========================================================= */

.zb-unified-public-header .zb-account-header-inner {
    width: min(1240px, calc(100% - 32px));
    min-height: 76px;
    display: grid;
    grid-template-columns: 238px auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}

/* Keep dropdowns above the hero carousel instead of trapping them in the
 * page's lower stacking context. */
.zb-unified-public-header,
.zb-unified-public-header .zb-account-header-inner {
    position: relative;
    overflow: visible;
}

.zb-unified-public-header {
    z-index: 1400;
}

.zb-unified-public-header .zb-account-brand {
    width: 238px;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: 3px;
    flex: 0 0 auto;
}

.zb-unified-public-header .zb-public-brand-logo-surface {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
}

.zb-unified-public-header .zb-public-brand-logo {
    width: 166px;
    height: auto;
    max-width: none;
    object-fit: contain;
}

.zb-unified-public-header .zb-account-brand-text {
    min-width: 0;
    max-width: 228px;
}

.zb-unified-public-header .zb-account-brand-text small {
    display: block;
    margin: 0;
    color: var(--zb-muted);
    font-size: 0.64rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.005em;
    text-wrap: balance;
}

.zb-header-controls {
    min-width: max-content;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.zb-header-controls .zb-language-form {
    position: static;
    inset: auto;
    z-index: auto;
    margin-left: 0;
}

.zb-header-controls > .app-theme-toggle[data-zb-auth-theme-toggle="true"] {
    position: static;
    inset: auto;
    z-index: auto;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.zb-header-controls > .app-theme-toggle[data-zb-auth-theme-toggle="true"] .app-theme-toggle-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.zb-unified-public-header .zb-header-controls {
    justify-self: center;
}

.zb-unified-public-header .zb-account-navigation {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 2px;
}

.zb-unified-public-header .zb-account-navigation > a,
.zb-unified-public-header .zb-account-logout-form button,
.zb-unified-public-header .zb-account-navigation > .app-theme-toggle[data-zb-auth-theme-toggle="true"] {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.80rem;
    line-height: 1.15;
}

.zb-unified-public-header .zb-account-navigation .zb-account-login-link {
    padding-inline: 13px;
}

/* The supplied wordmark contains dark lettering. Keep it legible in dark mode
 * without changing the artwork itself. */
html[data-theme="dark"] .zb-unified-public-header .zb-public-brand-logo-surface,
html[data-theme="dark"] .zb-tenant-product-logo-surface,
html[data-theme="dark"] .zb-customer-product-logo-surface {
    padding: 3px 5px;
    border-radius: 6px;
    background: #ffffff;
}

/* Medium desktop/tablet: keep every action on one row by dropping only the
 * descriptive claim. No navigation item or functionality is removed. */
@media (max-width: 1180px) and (min-width: 861px) {
    .zb-unified-public-header .zb-account-header-inner {
        width: calc(100% - 24px);
        grid-template-columns: 164px auto minmax(0, 1fr);
        gap: 10px;
    }

    .zb-unified-public-header .zb-account-brand {
        width: 164px;
    }

    .zb-unified-public-header .zb-public-brand-logo {
        width: 150px;
    }

    .zb-unified-public-header .zb-account-brand-text {
        display: none;
    }

    .zb-unified-public-header .zb-account-navigation > a,
    .zb-unified-public-header .zb-account-logout-form button,
    .zb-unified-public-header .zb-account-navigation > .app-theme-toggle[data-zb-auth-theme-toggle="true"] {
        padding-inline: 8px;
        font-size: 0.76rem;
    }
}

/* Narrow tablet: a controlled two-row header is cleaner than flex wrapping. */
@media (max-width: 860px) and (min-width: 761px) {
    .zb-unified-public-header .zb-account-header-inner {
        width: calc(100% - 20px);
        min-height: 0;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 12px;
        padding-block: 9px;
    }

    .zb-unified-public-header .zb-account-brand {
        width: auto;
    }

    .zb-unified-public-header .zb-public-brand-logo {
        width: 148px;
    }

    .zb-unified-public-header .zb-account-brand-text {
        display: none;
    }

    .zb-unified-public-header .zb-header-controls {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .zb-unified-public-header .zb-account-navigation {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: center;
    }

    .zb-unified-public-header .zb-account-navigation > a,
    .zb-unified-public-header .zb-account-logout-form button,
    .zb-unified-public-header .zb-account-navigation > .app-theme-toggle[data-zb-auth-theme-toggle="true"] {
        padding: 7px 8px;
        font-size: 0.75rem;
    }
}

/* Mobile keeps the existing interaction model: brand + language/theme controls
 * above the existing two-column navigation. */
@media (max-width: 760px) {
    .zb-unified-public-header .zb-account-header-inner {
        width: calc(100% - 10px);
        min-height: 0;
        padding: 8px;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: center;
        gap: 8px;
    }

    .zb-unified-public-header .zb-account-brand {
        width: calc(100% - 96px);
        min-height: 34px;
        display: flex;
        align-items: center;
        gap: 0;
    }

    .zb-unified-public-header .zb-public-brand-logo {
        width: 128px;
    }

    .zb-unified-public-header .zb-account-brand-text {
        display: none;
    }

    .zb-unified-public-header .zb-header-controls {
        position: absolute;
        top: 8px;
        right: 8px;
        gap: 6px;
    }

    .zb-header-controls .zb-language-toggle,
    .zb-header-controls > .app-theme-toggle[data-zb-auth-theme-toggle="true"] {
        width: 36px;
        min-width: 36px;
        height: 36px;
        min-height: 36px;
    }

    .zb-unified-public-header .zb-account-navigation {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding-top: 1px;
    }

    .zb-unified-public-header .zb-account-navigation > a,
    .zb-unified-public-header .zb-account-logout-form button {
        width: 100%;
        min-height: 36px;
        padding: 6px 7px;
        font-size: 0.76rem;
        line-height: 1.18;
        text-align: center;
        white-space: normal;
    }

    html[data-theme="dark"] .zb-unified-public-header .zb-public-brand-logo-surface {
        padding: 3px 5px;
    }
}

@media (max-width: 430px) {
    .zb-unified-public-header .zb-public-brand-logo {
        width: 120px;
    }
}

/* =========================================================
   End-customer / tenant header
   ========================================================= */

.zb-tenant-header .zb-brand-link {
    flex: 0 1 auto;
    gap: 9px;
}

.zb-tenant-product-logo-surface,
.zb-customer-product-logo-surface {
    min-width: 0;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding-right: 10px;
    border-right: 1px solid color-mix(in srgb, var(--zb-primary) 18%, var(--zb-border));
}

.zb-tenant-product-logo,
.zb-customer-product-logo {
    width: 120px;
    height: auto;
    max-width: none;
    object-fit: contain;
}

.zb-tenant-header .zb-brand-logo {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    box-shadow: none;
}

.zb-tenant-header .zb-brand-text {
    min-width: 0;
    max-width: 150px;
    display: grid;
    gap: 1px;
}

.zb-tenant-header .zb-brand-title {
    font-size: 0.86rem;
    line-height: 1.15;
}

.zb-tenant-header .zb-brand-subtitle {
    margin-top: 0;
    font-size: 0.66rem;
    line-height: 1.25;
}

.zb-tenant-header .zb-header-navigation {
    min-width: 0;
    flex-wrap: nowrap;
    gap: 2px;
}

.zb-tenant-header .zb-header-navigation a,
.zb-tenant-header .zb-header-navigation button {
    padding: 8px 9px;
    font-size: 0.76rem;
}

.zb-customer-header .zb-brand-link {
    gap: 9px;
}

.zb-customer-header .zb-brand-subtitle {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 650;
}

.zb-account-entry-header,
.zb-tenant-header,
.zb-customer-header {
    overflow: visible;
}

.zb-account-entry-header .zb-brand-link {
    min-width: 0;
    gap: 9px;
}

.zb-account-entry-header .zb-customer-product-logo-surface {
    border-right: 0;
}

/* Auth pages (/zekabooking/customer/...) use three independent header zones.
 * Equal outer grid columns keep the language/theme controls truly centered on
 * desktop even when brand and return-link widths differ. */
.zb-account-entry-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 10px 16px;
}

.zb-account-entry-header .zb-brand-link {
    justify-self: start;
}

.zb-account-entry-header .zb-header-controls {
    justify-self: center;
}

.zb-account-entry-header .zb-header-navigation {
    width: auto;
    justify-self: end;
    flex-wrap: nowrap;
}

@media (max-width: 980px) and (min-width: 721px) {
    .zb-tenant-product-logo,
    .zb-customer-product-logo {
        width: 108px;
    }

    .zb-tenant-header .zb-brand-logo {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .zb-tenant-header .zb-brand-text {
        max-width: 118px;
    }

    .zb-tenant-header .zb-header-navigation a,
    .zb-tenant-header .zb-header-navigation button {
        padding-inline: 7px;
        font-size: 0.72rem;
    }
}

@media (max-width: 720px) {
    .zb-tenant-header .zb-brand-link {
        min-width: 0;
        gap: 7px;
    }

    /* On mobile the tenant's name is enough; hiding its optional square logo
     * prevents the product logo, language control and menu from colliding. */
    .zb-tenant-header .zb-brand-logo {
        display: none;
    }

    .zb-tenant-product-logo-surface,
    .zb-customer-product-logo-surface {
        padding-right: 7px;
    }

    .zb-tenant-product-logo,
    .zb-customer-product-logo {
        width: 104px;
    }

    .zb-tenant-header .zb-brand-text {
        max-width: 92px;
    }

    .zb-tenant-header .zb-brand-title {
        font-size: 0.82rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .zb-tenant-header .zb-brand-subtitle {
        display: none;
    }
}

@media (max-width: 390px) {
    .zb-tenant-product-logo,
    .zb-customer-product-logo {
        width: 96px;
    }

    .zb-tenant-header .zb-brand-text {
        max-width: 72px;
    }
}

@media (max-width: 720px) {
    .zb-account-entry-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px 10px;
        padding: 10px 12px;
    }

    .zb-account-entry-header .zb-brand-link {
        min-width: 0;
        justify-self: start;
    }

    .zb-account-entry-header .zb-header-controls {
        justify-self: end;
    }

    .zb-account-entry-header .zb-header-navigation {
        grid-column: 1 / -1;
        width: auto;
        justify-self: end;
        display: flex;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 4px;
    }

    .zb-account-entry-header .zb-header-navigation a,
    .zb-account-entry-header .zb-header-link-button {
        width: auto;
        min-height: 36px;
        padding: 6px 8px;
        font-size: 0.78rem;
        white-space: normal;
    }
}

@media (max-width: 430px) {
    .zb-account-entry-header .zb-brand-subtitle {
        display: none;
    }
}
