/**
 * Tieu Hao Pro header component.
 *
 * Scope: site header composition only. Navigation presentation is owned by
 * navigation.css; button presentation is owned by buttons.css.
 * WordPress/menu/search/contact data belongs to templates/configuration.
 */

.thp-header {
    position: relative;
    z-index: 1000;
    border-bottom: 1px solid var(--thp-color-border);
    background: var(--thp-color-surface);
}

.thp-header__inner {
    display: flex;
    align-items: center;
    gap: var(--thp-space-4);
    min-height: var(--thp-nav-height);
}


.thp-header__brand {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    min-width: 0;
    color: var(--thp-color-text);
    font-weight: 800;
    text-decoration: none;
}

.thp-header__brand .custom-logo-link {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.thp-header__brand .custom-logo {
    display: block;
    width: auto;
    max-width: 180px;
    max-height: 48px;
    height: auto;
}

.thp-header__logo {
    display: block;
    width: auto;
    max-width: 180px;
    max-height: 48px;
}

.thp-header__brand-text {
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    color: var(--thp-color-brand-deep);
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thp-header__nav {
    min-width: 0;
    flex: 1 1 auto;
    width: auto;
    overflow: visible;
}

.thp-header__tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--thp-space-3);
    min-width: 0;
    flex: 0 0 auto;
}

.thp-header__search {
    position: relative;
    display: flex;
    align-items: center;
    width: 220px;
    min-width: 180px;
}

.thp-header__search-form {
    display: flex;
    width: 100%;
    align-items: center;
}

.thp-header__search-input {
    width: 100%;
    min-height: 44px;
    padding: 0 var(--thp-space-4);
    border: 1px solid var(--thp-color-border);
    border-radius: var(--thp-radius-pill);
    background: var(--thp-color-surface-subtle);
    color: var(--thp-color-text);
    font: inherit;
}

.thp-header__search-input:focus {
    border-color: var(--thp-color-action);
    background: var(--thp-color-surface);
    outline: none;
    box-shadow: 0 0 0 3px rgb(22 160 93 / 16%);
}

.thp-header__contact {
    display: inline-flex;
    align-items: center;
    gap: var(--thp-space-2);
}

.thp-header__mobile-toggle {
    display: none;
}

.thp-header__utility {
    display: flex;
    align-items: center;
    gap: var(--thp-space-3);
    color: var(--thp-color-text-secondary);
    font-size: var(--thp-font-size-sm);
}

.thp-header__utility a {
    text-decoration: none;
}

.thp-header__utility a:hover {
    color: var(--thp-color-brand);
}

@media (max-width: 1023px) {
    .thp-header__inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: var(--thp-space-4);
    }

    .thp-header__search {
        min-width: 160px;
    }

    .thp-header__utility {
        display: none;
    }
}

@media (max-width: 767px) {
    .thp-header__inner {
        grid-template-columns: auto 1fr auto;
        min-height: 64px;
        gap: var(--thp-space-3);
    }

    .thp-header__logo {
        max-width: 136px;
        max-height: 40px;
    }

    .thp-header__brand-text {
        max-width: 136px;
        font-size: 1rem;
    }

   .thp-header__nav {
        display: none;
    }

    .thp-header__tools {
        gap: var(--thp-space-2);
    }

    .thp-header__search {
        min-width: 0;
        width: auto;
        flex: 1 1 auto;
    }

    .thp-header__search-input {
        min-height: 44px;
        padding-inline: var(--thp-space-3);
    }

    .thp-header__contact {
        display: none;
    }

    .thp-header__mobile-toggle {
        display: inline-flex;
    }
}

@media (max-width: 374px) {
    .thp-header__inner {
        gap: var(--thp-space-2);
    }

    .thp-header__logo {
        max-width: 112px;
    }

    .thp-header__brand-text {
        max-width: 112px;
    }
}
