/**
 * ThemeForge Pro Fashion — Header styles.
 */

/* ============================================================
   HEADER WRAPPER
   ============================================================ */

.tf-header {
    background: var(--tf-header-bg, #ffffff);
    color: var(--tf-header-text, #171717);
    position: relative;
    z-index: 999;
}

/* ============================================================
   ANNOUNCEMENT BAR
   ============================================================ */

.tf-announcement {
    background: var(--tf-header-text, #171717);
    color: #ffffff;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.tf-announcement__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 0;
    min-height: 34px;
    position: relative;
}

.tf-announcement__messages {
    position: relative;
    text-align: center;
    flex: 1;
}

.tf-announcement__message {
    display: none;
    font-weight: 500;
}

.tf-announcement__message.is-active {
    display: block;
    animation: tf-fade-in 0.4s ease;
}

.tf-announcement__message a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.tf-announcement__close,
.tf-announcement__pause {
    background: transparent;
    border: 0;
    color: inherit;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.tf-announcement__close {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.tf-announcement__pause {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
}

.tf-announcement__close:hover,
.tf-announcement__pause:hover {
    opacity: 1;
}

.tf-announcement__close svg {
    width: 14px;
    height: 14px;
}

.tf-announcement.is-dismissed {
    display: none;
}

@keyframes tf-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .tf-announcement--hide-mobile { display: none; }
    .tf-announcement__inner { font-size: 0.6875rem; }
}

/* ============================================================
   MAIN HEADER
   ============================================================ */

.tf-main-header {
    border-bottom: 1px solid var(--tf-header-border, #eaeaea);
    background: var(--tf-header-bg, #ffffff);
}

.tf-main-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 0;
    min-height: 82px;
}

.tf-main-header__inner--center .tf-main-header__center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.tf-main-header__inner--left .tf-main-header__center {
    flex: 0;
    order: -1;
}

.tf-main-header__inner--left .tf-main-header__left {
    flex: 1;
    justify-content: flex-start;
}

.tf-main-header__inner--right .tf-main-header__center {
    order: 3;
    flex: 0;
}

.tf-main-header__inner--right .tf-main-header__right {
    flex: 1;
    justify-content: flex-end;
}

.tf-main-header__left,
.tf-main-header__right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
}

.tf-main-header__center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

/* ============================================================
   LOGO / BRAND
   ============================================================ */

.tf-site-branding .custom-logo-link {
    display: block;
}

.tf-site-branding img {
    max-height: 60px;
    width: auto;
    max-width: var(--tf-header-logo-width, 180px);
    height: auto;
    object-fit: contain;
}

.tf-site-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tf-header-text, #171717);
}

.tf-mobile-logo {
    display: none;
}

/* ============================================================
   HEADER ACTIONS
   ============================================================ */

.tf-header-action {
    background: transparent;
    border: 0;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tf-header-text, #171717);
    position: relative;
    min-width: 40px;
    min-height: 40px;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
}

.tf-header-action:hover,
.tf-header-action:focus-visible {
    color: var(--tf-header-accent, #171717);
    background: rgba(0, 0, 0, 0.04);
    outline: none;
}

.tf-header-action:focus-visible {
    outline: 2px solid var(--tf-header-accent, #171717);
    outline-offset: 2px;
}

.tf-header-action--cart {
    gap: 6px;
}

.tf-cart-count {
    background: var(--tf-header-accent, #171717);
    color: #ffffff;
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
}

.tf-cart-total {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ============================================================
   SECONDARY NAV
   ============================================================ */

.tf-secondary-nav__list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 18px;
}

.tf-secondary-nav__list a {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tf-header-muted, #737373);
    transition: color 0.2s ease;
}

.tf-secondary-nav__list a:hover {
    color: var(--tf-header-text, #171717);
}

/* ============================================================
   MENU TOGGLE (mobile hamburger)
   ============================================================ */

.tf-menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 8px;
    color: var(--tf-header-text, #171717);
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

/* ============================================================
   PRIMARY NAV
   ============================================================ */

.tf-primary-nav {
    border-bottom: 1px solid var(--tf-header-border, #eaeaea);
    background: var(--tf-header-bg, #ffffff);
    position: relative;
}

.tf-primary-nav__list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 32px;
    position: relative;
    align-items: center;
    min-height: 46px;
}

.tf-primary-nav--center .tf-primary-nav__list {
    justify-content: center;
}

.tf-primary-nav--left .tf-primary-nav__list {
    justify-content: flex-start;
}

.tf-primary-nav--right .tf-primary-nav__list {
    justify-content: flex-end;
}

.tf-primary-nav__list > li {
    position: relative;
}

.tf-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px 0;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tf-header-text, #171717);
    position: relative;
    white-space: nowrap;
}

.tf-nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 6px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.tf-nav-link:hover::after,
.tf-nav-link:focus-visible::after,
.current-menu-item > .tf-nav-link::after {
    transform: scaleX(1);
}

.tf-nav-link:focus-visible {
    outline: 2px solid var(--tf-header-accent, #171717);
    outline-offset: 4px;
}

.tf-chevron {
    display: inline-flex;
    transition: transform 0.2s ease;
}

.tf-has-dropdown.is-open > .tf-nav-link .tf-chevron {
    transform: rotate(180deg);
}

/* Sale link style */
.menu-item.highlight-sale > .tf-nav-link,
.menu-item.nav-sale > .tf-nav-link {
    color: #b91c1c;
}

/* ============================================================
   DROPDOWN SUBMENU
   ============================================================ */

.tf-nav-sub {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--tf-header-bg, #ffffff);
    border: 1px solid var(--tf-header-border, #eaeaea);
    list-style: none;
    margin: 0;
    padding: 12px 0;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.tf-has-dropdown:hover > .tf-nav-sub,
.tf-has-dropdown.is-open > .tf-nav-sub,
.tf-has-dropdown:focus-within > .tf-nav-sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tf-nav-sub .tf-nav-link {
    padding: 8px 20px;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    text-transform: none;
    display: block;
    white-space: nowrap;
}

.tf-nav-sub .tf-nav-link::after {
    display: none;
}

.tf-nav-sub .tf-nav-link:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* Nested dropdown */
.tf-nav-sub .tf-has-dropdown > .tf-nav-sub {
    top: 0;
    left: 100%;
    margin-left: 2px;
}

.tf-nav-sub .tf-has-dropdown > .tf-nav-link .tf-chevron {
    margin-left: auto;
    transform: rotate(-90deg);
}

/* ============================================================
   SEARCH DRAWER
   ============================================================ */

.tf-search-drawer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.tf-search-drawer[hidden] {
    display: none;
}

.tf-search-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    animation: tf-fade-in 0.2s ease;
}

.tf-search-drawer__panel {
    position: relative;
    background: var(--tf-header-bg, #ffffff);
    width: 100%;
    max-width: 720px;
    margin: 0 24px;
    padding: 24px;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: tf-slide-down 0.25s ease;
}

@keyframes tf-slide-down {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tf-search-form {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--tf-header-border, #eaeaea);
    padding-bottom: 12px;
    position: relative;
}

.tf-search-form__icon {
    color: var(--tf-header-muted, #737373);
    display: inline-flex;
}

.tf-search-form__input {
    flex: 1;
    border: 0;
    background: transparent;
    font-size: 1.125rem;
    padding: 8px 0;
    outline: none;
    color: var(--tf-header-text, #171717);
    font-family: inherit;
}

.tf-search-form__input::placeholder {
    color: var(--tf-header-muted, #737373);
}

.tf-search-drawer__close {
    background: transparent;
    border: 0;
    padding: 8px;
    color: var(--tf-header-text, #171717);
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tf-search-drawer__results {
    margin-top: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.tf-search-results__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tf-search-result {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--tf-header-border, #eaeaea);
    transition: background 0.2s ease;
}

.tf-search-result:hover {
    background: rgba(0, 0, 0, 0.02);
}

.tf-search-result__thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 2px;
}

.tf-search-result__info {
    flex: 1;
    min-width: 0;
}

.tf-search-result__title {
    font-size: 0.9375rem;
    font-weight: 500;
    margin: 0 0 4px;
    color: var(--tf-header-text, #171717);
}

.tf-search-result__price {
    font-size: 0.875rem;
    color: var(--tf-header-muted, #737373);
}

.tf-search-results__empty {
    padding: 24px 0;
    text-align: center;
    color: var(--tf-header-muted, #737373);
}

.tf-search-results__loading {
    padding: 24px 0;
    text-align: center;
    color: var(--tf-header-muted, #737373);
}

/* ============================================================
   MOBILE DRAWER
   ============================================================ */

.tf-mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 10001;
}

.tf-mobile-drawer[hidden] {
    display: none;
}

.tf-mobile-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: tf-fade-in 0.2s ease;
}

.tf-mobile-drawer__panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: var(--tf-header-bg, #ffffff);
    display: flex;
    flex-direction: column;
    animation: tf-slide-right 0.28s ease;
    overflow-y: auto;
}

@keyframes tf-slide-right {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}

.tf-mobile-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--tf-header-border, #eaeaea);
}

.tf-mobile-drawer__brand {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tf-mobile-drawer__close {
    background: transparent;
    border: 0;
    padding: 8px;
    color: var(--tf-header-text, #171717);
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tf-mobile-drawer__nav {
    padding: 16px 0;
    flex: 1;
}

.tf-mobile-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tf-mobile-nav__list li {
    position: relative;
}

.tf-mobile-nav__list .tf-nav-link {
    display: flex;
    width: 100%;
    padding: 14px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--tf-header-text, #171717);
    border-bottom: 1px solid var(--tf-header-border, #eaeaea);
    justify-content: space-between;
    align-items: center;
}

.tf-mobile-nav__list .tf-nav-link::after {
    display: none;
}

.tf-mobile-nav__list .tf-nav-sub {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    border: 0;
    background: #fafafa;
    box-shadow: none;
    padding: 0;
    display: none;
}

.tf-mobile-nav__list .tf-nav-sub .tf-nav-link {
    padding-left: 36px;
    border-bottom: 1px solid var(--tf-header-border, #eaeaea);
}

.tf-mobile-nav__list .tf-has-dropdown.is-open > .tf-nav-sub {
    display: block;
}

.tf-mobile-drawer__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--tf-header-border, #eaeaea);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tf-mobile-drawer__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    color: var(--tf-header-text, #171717);
    font-size: 0.875rem;
}

/* ============================================================
   BODY SCROLL LOCK
   ============================================================ */

body.tf-no-scroll {
    overflow: hidden;
}

/* ============================================================
   STICKY HEADER
   ============================================================ */

.tf-has-sticky-header.tf-sticky-full .tf-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--tf-header-bg, #ffffff);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.tf-has-sticky-header.tf-sticky-nav .tf-primary-nav {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--tf-header-bg, #ffffff);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.tf-has-sticky-header.tf-sticky-compact .tf-header.is-compact {
    background: var(--tf-header-bg, #ffffff);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.tf-has-sticky-header.tf-sticky-compact .tf-header.is-compact .tf-announcement {
    display: none;
}

.tf-has-sticky-header.tf-sticky-compact .tf-header.is-compact .tf-main-header__inner {
    min-height: 60px;
    padding: 10px 0;
}

/* Admin toolbar offset */
.admin-bar .tf-has-sticky-header.tf-sticky-full .tf-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .tf-has-sticky-header.tf-sticky-full .tf-header {
        top: 46px;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1023px) {
    .tf-primary-nav {
        display: none;
    }

    .tf-menu-toggle {
        display: inline-flex;
    }

    .tf-secondary-nav {
        display: none;
    }

    .tf-main-header__inner {
        gap: 12px;
        padding: 14px 0;
        min-height: 66px;
    }

    .tf-main-header__center {
        flex: 1;
    }

    .tf-mobile-logo {
        display: inline-block;
    }

    .tf-site-branding .custom-logo-link {
        display: none;
    }
}

@media (max-width: 767px) {
    .tf-main-header__left,
    .tf-main-header__right {
        gap: 4px;
    }

    .tf-header-action {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }

    .tf-site-title {
        font-size: 1.125rem;
    }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .tf-nav-sub,
    .tf-announcement__message,
    .tf-mobile-drawer__panel,
    .tf-search-drawer__panel,
    .tf-search-drawer__backdrop,
    .tf-mobile-drawer__backdrop {
        animation: none !important;
        transition: none !important;
    }
}