/**
 * Header-specific styles.
 *
 * Breakpoints: 1024px (desktop), 768px (tablet).
 */

/* ── Top Bar ── */
.zt-top-bar {
  background: var(--zb-primary);
  color: #fff;
  font-size: 13px;
  padding: 6px 0;
  position: relative;
}

.zt-top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--zb-space-md);
}

.zt-top-bar-left {
  display: flex;
  align-items: center;
  gap: var(--zb-space-md);
}

.zt-top-bar-text {
  opacity: 0.9;
}

.zt-top-bar-contact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(255,255,255,0.85);
  transition: color var(--zb-transition-fast);
}

.zt-top-bar-contact:hover {
  color: #fff;
}

.zt-top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--zb-space-md);
}

.zt-top-bar-menu {
  display: flex;
  gap: var(--zb-space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}

.zt-top-bar-menu a {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
}

.zt-top-bar-menu a:hover {
  color: #fff;
}

.zt-top-bar .zt-social-icons {
  gap: var(--zb-space-sm);
}

.zt-top-bar .zt-social-icon {
  color: rgba(255,255,255,0.7);
}

.zt-top-bar .zt-social-icon:hover {
  color: #fff;
}

.zt-top-bar-close {
  padding: 4px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  line-height: 0;
  transition: color var(--zb-transition-fast);
}

.zt-top-bar-close:hover {
  color: #fff;
}

/* ── Header Base ── */
.zt-header {
  position: relative;
  z-index: 1000;
  background: var(--zb-bg);
  box-shadow: var(--zb-shadow-sm);
  transition: all var(--zb-transition-base);
}

.zt-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--zb-header-height);
  gap: var(--zb-space-md);
}

/* ── Sticky Header ── */
.zt-header--sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: var(--zb-shadow-md);
  animation: ztSlideDown 300ms ease;
}

.zt-header--sticky .zt-header-inner {
  height: var(--zb-header-height-sticky);
}

@keyframes ztSlideDown {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

/* Hide on scroll down */
.zt-header--hidden {
  transform: translateY(-100%);
}

/* ── Transparent Header ── */
.zt-header--transparent {
  position: absolute;
  left: 0;
  right: 0;
  background: transparent;
  box-shadow: none;
}

.zt-header--transparent .zt-site-title,
.zt-header--transparent .zt-site-title a,
.zt-header--transparent .zt-nav__link,
.zt-header--transparent .zt-hamburger-line,
.zt-header--transparent .zt-search-toggle,
.zt-header--transparent .zt-social-icon {
  color: #fff;
}

.zt-header--transparent .zt-hamburger-line {
  background: #fff;
}

/* Solid state after scroll */
.zt-header--solid {
  background: var(--zb-bg);
  box-shadow: var(--zb-shadow-md);
}

.zt-header--solid .zt-site-title,
.zt-header--solid .zt-site-title a,
.zt-header--solid .zt-nav__link,
.zt-header--solid .zt-search-toggle,
.zt-header--solid .zt-social-icon {
  color: var(--zb-text);
}

.zt-header--solid .zt-hamburger-line {
  background: var(--zb-heading);
}

/* ── Brand / Logo ── */
.zt-header-brand {
  flex-shrink: 0;
}

.zt-header-brand .custom-logo {
  max-height: 50px;
  width: auto;
  transition: max-height var(--zb-transition-base);
}

.zt-header--sticky .zt-header-brand .custom-logo {
  max-height: 40px;
}

.zt-site-title {
  font-family: var(--zb-font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.zt-site-title a {
  color: var(--zb-heading);
  transition: color var(--zb-transition-fast);
}

.zt-site-title a:hover {
  color: var(--zb-primary);
}

.zt-site-description {
  font-size: 0.75rem;
  color: var(--zb-text-light);
  margin: 0;
}

/* ── Desktop Navigation ── */
.zt-header-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.zt-nav {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.zt-nav__item {
  position: relative;
}

.zt-nav__link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  color: var(--zb-text);
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 200ms ease;
}

.zt-nav__link:hover,
.zt-nav__item--current > .zt-nav__link,
.zt-nav__item--ancestor > .zt-nav__link {
  color: var(--zb-primary);
}

.zt-nav__arrow {
  transition: transform var(--zb-transition-fast);
  flex-shrink: 0;
}

.zt-nav__item.is-open > .zt-nav__link .zt-nav__arrow {
  transform: rotate(180deg);
}

/* Toggle button — hidden on desktop, shown on mobile */
.zt-nav__toggle {
  display: none;
}

/* ── Dropdown Submenu ── */
.zt-nav__submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--zb-bg);
  box-shadow: var(--zb-shadow-lg);
  border-radius: 4px;
  list-style: none;
  margin: 0;
  padding: var(--zb-space-xs) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 200ms ease;
  z-index: 100;
}

.zt-nav__item.is-open > .zt-nav__submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.zt-nav__submenu .zt-nav__link {
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 400;
}

.zt-nav__submenu .zt-nav__link:hover {
  background: var(--zb-bg-alt);
}

/* Nested submenu — flies out right */
.zt-nav__submenu .zt-nav__submenu {
  top: 0;
  left: 100%;
}

/* ── Mega Menu ── */
.zt-nav__item--mega > .zt-nav__submenu {
  left: 0;
  right: 0;
  min-width: 100%;
  display: flex;
  flex-wrap: wrap;
  padding: var(--zb-space-lg);
  gap: var(--zb-space-lg);
}

/* ── Header Utilities (search, social) ── */
.zt-header-utilities {
  display: flex;
  align-items: center;
  gap: var(--zb-space-md);
  flex-shrink: 0;
}

/* ── Search Toggle ── */
.zt-header-search {
  position: relative;
}

.zt-search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--zb-text);
  border-radius: 50%;
  transition: background var(--zb-transition-fast), color var(--zb-transition-fast);
}

.zt-search-toggle:hover {
  background: var(--zb-bg-alt);
  color: var(--zb-primary);
}

.zt-search-expand {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  padding: var(--zb-space-md);
  background: var(--zb-bg);
  box-shadow: var(--zb-shadow-lg);
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 200ms ease;
  z-index: 200;
}

.zt-search-expand.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.zt-search-expand .zt-search-form {
  max-width: none;
}

/* ── Social Icons ── */
.zt-social-icons {
  display: flex;
  align-items: center;
  gap: var(--zb-space-sm);
}

.zt-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--zb-text-light);
  border-radius: 50%;
  transition: color var(--zb-transition-fast), background var(--zb-transition-fast);
}

.zt-social-icon:hover {
  color: var(--zb-primary);
  background: var(--zb-bg-alt);
}

/* ── Hamburger ── */
.zt-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.zt-hamburger-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 24px;
}

.zt-hamburger-line {
  display: block;
  height: 2px;
  background: var(--zb-heading);
  border-radius: 2px;
  transition: all var(--zb-transition-fast);
  transform-origin: center;
}

.zt-hamburger[aria-expanded="true"] .zt-hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.zt-hamburger[aria-expanded="true"] .zt-hamburger-line:nth-child(2) {
  opacity: 0;
}

.zt-hamburger[aria-expanded="true"] .zt-hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile Menu (slide-in drawer) ── */
.zt-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 380px;
  background: var(--zb-bg);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 300ms ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.zt-menu-open .zt-mobile-menu {
  transform: translateX(0);
}

/* Backdrop */
.zt-menu-open::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
}

.zt-mobile-menu-inner {
  padding: var(--zb-space-lg);
  padding-top: var(--zb-space-xl);
}

.zt-mobile-close {
  position: absolute;
  top: var(--zb-space-md);
  right: var(--zb-space-md);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--zb-text);
  border-radius: 50%;
  transition: background var(--zb-transition-fast);
}

.zt-mobile-close:hover {
  background: var(--zb-bg-alt);
}

/* ── Mobile Nav ── */
.zt-mobile-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.zt-mobile-nav .zt-nav__item {
  border-bottom: 1px solid var(--zb-border);
}

.zt-mobile-nav .zt-nav__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--zb-text);
}

.zt-mobile-nav .zt-nav__link:hover {
  color: var(--zb-primary);
}

.zt-mobile-nav .zt-nav__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--zb-text-light);
  transition: transform var(--zb-transition-fast);
}

.zt-mobile-nav .zt-nav__item.is-open > .zt-nav__toggle {
  transform: rotate(180deg);
}

.zt-mobile-nav .zt-nav__submenu {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  display: none;
  padding-left: var(--zb-space-md);
}

.zt-mobile-nav .zt-nav__item.is-open > .zt-nav__submenu {
  display: block;
}

.zt-mobile-nav .zt-nav__submenu .zt-nav__link {
  padding: 10px 0;
  font-size: 0.9375rem;
  font-weight: 400;
}

.zt-mobile-nav .zt-nav__arrow {
  display: none;
}

.zt-mobile-search {
  margin-top: var(--zb-space-lg);
  padding-top: var(--zb-space-lg);
  border-top: 1px solid var(--zb-border);
}

.zt-mobile-search .zt-search-form {
  max-width: none;
}

.zt-mobile-social {
  margin-top: var(--zb-space-lg);
  padding-top: var(--zb-space-lg);
  border-top: 1px solid var(--zb-border);
}

.zt-mobile-social .zt-social-icons {
  justify-content: center;
}

.zt-mobile-social .zt-social-icon {
  width: 40px;
  height: 40px;
}

/* ── Fullscreen overlay variant (for minimal header) ── */
.zt-mobile-menu--fullscreen {
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zt-mobile-menu--fullscreen .zt-mobile-menu-inner {
  text-align: center;
  width: 100%;
  max-width: 480px;
}

.zt-mobile-menu--fullscreen .zt-mobile-nav .zt-nav__link {
  justify-content: center;
  font-size: 1.25rem;
  padding: var(--zb-space-md) 0;
}

/* ── Centered Header Variant ── */
.zt-header--centered .zt-header-inner {
  flex-direction: column;
  height: auto;
  padding-block: var(--zb-space-md);
  gap: var(--zb-space-xs);
}

.zt-header-brand-centered {
  text-align: center;
}

.zt-header-brand-centered .zt-site-title {
  text-align: center;
}

.zt-header-social-row {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-bottom: var(--zb-space-sm);
}

.zt-header-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--zb-space-md);
  width: 100%;
}

.zt-header--centered .zt-header-nav {
  justify-content: center;
}

.zt-header--centered .zt-nav {
  justify-content: center;
}

/* ── Minimal Header Variant ── */
.zt-header--minimal .zt-hamburger {
  display: flex;
}

.zt-header--minimal .zt-header-nav {
  display: none;
}

.zt-header--minimal .zt-header-utilities {
  display: none;
}

/* ── Responsive: below 1024px ── */
@media (max-width: 1023px) {
  .zt-hamburger {
    display: flex;
  }

  .zt-header-nav {
    display: none;
  }

  .zt-header-utilities .zt-social-icons {
    display: none;
  }

  .zt-header--centered .zt-header-inner {
    flex-direction: row;
    height: var(--zb-header-height);
    padding-block: 0;
  }

  .zt-header-social-row,
  .zt-header-nav-row {
    display: none;
  }

  .zt-top-bar {
    display: none;
  }
}

/* ── Responsive: below 768px ── */
@media (max-width: 767px) {
  .zt-header-inner {
    height: 60px;
  }

  .zt-header-brand .custom-logo {
    max-height: 36px;
  }

  .zt-top-bar-left {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--zb-space-xs);
  }
}
