/* Coopo — unified site header + mobile drawer */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header--home {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.site-header--home.site-header--scrolled,
.site-header--home.site-header--open {
  background: var(--card-bg, rgba(20, 20, 20, 0.92));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--glass-border, rgba(255, 255, 255, 0.1));
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
  padding: 0.65rem 0;
}

.site-header--home .site-header__inner {
  min-height: var(--nav-height, 80px);
  padding-left: 5%;
  padding-right: 5%;
}

.site-header__logo img {
  height: 28px;
  width: auto;
  display: block;
}

.site-header--home .site-header__logo img {
  height: 32px;
}

.site-header__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
}

.site-header__nav a {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.site-topbar .site-header__nav a {
  color: var(--text-secondary);
}

.site-topbar .site-header__nav a:hover,
.site-topbar .site-header__nav a.is-active {
  color: var(--charcoal);
  border-bottom-color: var(--primary);
}

.site-header--home .site-header__nav a {
  color: var(--text-dim, #a0a0a0);
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom-color: transparent;
}

.site-header--home .site-header__nav a:hover,
.site-header--home .site-header__nav a.is-active {
  color: var(--text-main, #fff);
  border-bottom-color: var(--text-main, #fff);
}

.site-header__persona--desktop {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.site-header__persona--desktop .persona-switcher {
  display: flex;
  gap: 2rem;
}

.site-header__toggle {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--mid-gray, rgba(255, 255, 255, 0.18));
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  color: inherit;
}

.site-header--home .site-header__toggle {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.site-header__toggle-bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 18px;
}

.site-header__toggle-bars span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header--open .site-header__toggle-bars span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header--open .site-header__toggle-bars span:nth-child(2) {
  opacity: 0;
}

.site-header--open .site-header__toggle-bars span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.lang-switch--desktop {
  flex-shrink: 0;
}

.site-header__drawer {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
  visibility: hidden;
}

.site-header--open .site-header__drawer,
.site-header__drawer[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
}

.site-header__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
}

.site-header--open .site-header__backdrop,
.site-header__drawer[aria-hidden="false"] .site-header__backdrop {
  opacity: 1;
}

.site-header__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(100%, 320px);
  height: 100%;
  min-height: 100dvh;
  max-height: 100dvh;
  padding: calc(0.75rem + env(safe-area-inset-top, 0)) 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0));
  overflow-y: auto;
  background: var(--white, #fcf9f8);
  color: var(--charcoal, #1a1a1a);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-header__drawer--dark .site-header__panel {
  background: #111;
  color: #fff;
}

.site-header--open .site-header__panel,
.site-header__drawer[aria-hidden="false"] .site-header__panel {
  transform: translateX(0);
}

.site-header__drawer-label {
  margin: 0 0 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary, #888);
}

.site-header__drawer--dark .site-header__drawer-label {
  color: var(--text-dim, #a0a0a0);
}

.site-header__drawer-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--mid-gray, #e8e8e8);
}

.site-header__drawer--dark .site-header__drawer-section {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.site-header__drawer-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.site-header__nav--mobile {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.site-header__nav--mobile a {
  display: block;
  padding: 0.85rem 0;
  font-size: 1rem;
  /* Explicit color so links never fall back to the UA default (purple) on
     pages that don't load the global `a { color: inherit }` reset (e.g. home). */
  color: var(--charcoal, #1a1a1a);
  border-bottom: 1px solid var(--mid-gray, #e8e8e8);
}

.site-header__nav--mobile a:hover,
.site-header__nav--mobile a.is-active {
  color: var(--primary, #e8531e);
}

.site-header__drawer--dark .site-header__nav--mobile a {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.site-header__drawer--dark .site-header__nav--mobile a:hover,
.site-header__drawer--dark .site-header__nav--mobile a.is-active {
  color: var(--primary-light, #ff6b35);
}

.site-header__nav--mobile a:last-child {
  border-bottom: 0;
}

.persona-switcher--drawer {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.persona-switcher--drawer .persona-btn {
  width: 100%;
  text-align: left;
  padding: 0.85rem 0;
  font-size: 1rem;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text-dim, #a0a0a0);
  cursor: pointer;
}

.persona-switcher--drawer .persona-btn.active {
  color: var(--text-main, #fff);
  font-weight: 600;
}

.persona-switcher--drawer .persona-btn.active::after {
  display: none;
}

/* Drawer language — segmented control */
.site-header__drawer-lang .lang-switch {
  display: flex !important;
  gap: 0.3rem;
  width: 100%;
  padding: 0.3rem;
  border-radius: 14px;
  background: #f0ebe8;
  border: 1px solid rgba(26, 26, 26, 0.08);
  box-shadow: inset 0 1px 2px rgba(26, 26, 26, 0.04);
}

.site-header__drawer-lang .lang-switch__btn {
  flex: 1;
  min-height: 44px;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #6b6560;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.site-header__drawer-lang .lang-switch__btn:hover:not(.lang-switch__btn--active) {
  color: var(--charcoal, #1a1a1a);
  background: rgba(255, 255, 255, 0.55);
}

.site-header__drawer-lang .lang-switch__btn--active {
  background: var(--white, #fff);
  color: var(--primary, #e8531e);
  box-shadow:
    0 1px 2px rgba(26, 26, 26, 0.06),
    0 4px 12px rgba(232, 83, 30, 0.12);
  transform: translateY(-1px);
}

.site-header__drawer-lang .lang-switch__btn:focus-visible {
  outline: 2px solid var(--primary, #e8531e);
  outline-offset: 2px;
}

body.nav-open {
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header--home .lang-switch {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.site-header--home .lang-switch__btn {
  border: none;
  background: transparent;
  color: var(--text-dim, #a0a0a0);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.site-header--home .lang-switch__btn--active {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text-main, #fff);
}

.site-header__drawer--dark .site-header__drawer-lang .lang-switch {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.site-header__drawer--dark .site-header__drawer-lang .lang-switch__btn {
  color: rgba(255, 255, 255, 0.45);
}

.site-header__drawer--dark .site-header__drawer-lang .lang-switch__btn:hover:not(.lang-switch__btn--active) {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
}

.site-header__drawer--dark .site-header__drawer-lang .lang-switch__btn--active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 4px 14px rgba(0, 0, 0, 0.2);
}

@media (max-width: 900px) {
  .site-header__nav--desktop,
  .site-topbar__nav,
  .site-header__persona--desktop:not(.site-header__persona--home),
  .lang-switch--desktop,
  .site-topbar .lang-switch {
    display: none !important;
  }

  .site-topbar:not(.site-header--home) > .site-header__inner {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: nowrap !important;
    min-height: 52px;
  }

  .site-topbar:not(.site-header--home) .site-header__logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    flex-shrink: 0;
    z-index: 1;
  }

  .site-topbar:not(.site-header--home) .site-header__toggle {
    display: inline-flex;
    position: relative;
    z-index: 2;
    margin-left: auto;
  }

  .site-topbar.site-header--open {
    z-index: 10049;
  }

  body[data-page="creator"] .site-header__toggle,
  body[data-page="brand"] .site-header__toggle,
  body[data-page="agency"] .site-header__toggle {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .site-header__persona--desktop:not(.site-header__persona--home) {
    position: static;
    transform: none;
  }

  /* Home: keep brand / agency / creator switcher in the header bar */
  .site-header--home .site-header__persona--home {
    display: flex !important;
    min-width: 0;
    justify-content: center;
  }

  .site-header--home .site-header__persona--home .persona-switcher {
    gap: 0.65rem 1rem;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .site-header--home .site-header__persona--home .persona-switcher::-webkit-scrollbar {
    display: none;
  }

  .site-header--home .site-header__persona--home .persona-btn {
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 0;
  }

  .site-header--home .site-header__persona--home .persona-btn.active::after {
    width: 18px;
  }

  /* Home mobile: logo in hero; header = hamburger only (drawer holds nav + language) */
  .site-header--home .site-header__logo {
    display: none !important;
  }

  .site-header--home .site-header__toggle {
    display: inline-flex !important;
  }

  /* Inline language pill is desktop-only on home; the drawer provides language on mobile */
  .site-header--home .lang-switch--desktop {
    display: none !important;
  }

  .site-header--home.main-nav {
    padding-left: 0;
    padding-right: 0;
  }

  .site-header--home .site-header__inner {
    position: static;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    min-height: 52px;
    padding: 0 5%;
  }

  .site-header--home .site-header__persona--desktop.site-header__persona--home {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
  }

  .site-header--home .site-header__persona--home.nav-links {
    flex: 0 1 auto;
    width: auto;
    max-width: calc(100% - 3.5rem);
    min-width: 0;
    display: flex !important;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto;
  }

  .site-header--home .site-header__persona--home .persona-switcher {
    gap: 0.35rem 0.5rem;
    justify-content: center;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
    overflow-x: auto;
  }

  .site-header--home .lang-switch--desktop.lang-switch--cyclic {
    position: absolute !important;
    top: 50% !important;
    right: max(1.25rem, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    display: none !important;
    flex-shrink: 0;
    margin: 0 !important;
    z-index: 3;
    width: auto;
    min-width: 0;
    padding: 0 !important;
    gap: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible;
    cursor: pointer;
  }

  .site-header--home .lang-switch--cyclic .lang-switch__btn:not(.lang-switch__btn--active) {
    display: none !important;
    width: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    position: absolute;
    pointer-events: none;
  }

  .site-header--home .lang-switch--cyclic .lang-switch__btn--active {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    height: 2rem;
    padding: 0 0.65rem;
    box-sizing: border-box;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-main, #fff);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    pointer-events: auto;
  }

  .site-header--home .site-header__persona--home .persona-btn {
    font-size: clamp(0.62rem, 2.4vw, 0.78rem);
    padding: 6px 0;
  }
}

@media (max-width: 380px) {
  .site-header--home .site-header__persona--home .persona-btn {
    font-size: 0.62rem;
  }
}

@media (min-width: 901px) {
  .site-header__drawer {
    display: none;
  }

  /* Home desktop: 3-column grid — logo | persona (center) | lang (right) */
  .site-header--home.main-nav {
    display: block;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .site-header--home .site-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    width: 100%;
    min-height: var(--nav-height, 80px);
    padding-left: 5%;
    padding-right: 5%;
    box-sizing: border-box;
  }

  .site-header--home .site-header__logo {
    position: static;
    transform: none;
    grid-column: 1;
    justify-self: start;
    z-index: 1;
  }

  .site-header--home .site-header__persona--desktop.site-header__persona--home,
  .site-header--home .site-header__persona--home.nav-links {
    position: static !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    grid-column: 2;
    justify-self: center;
    flex: none !important;
    width: auto;
    max-width: min(720px, 92vw);
    margin: 0;
    display: flex !important;
    justify-content: center;
    overflow: visible;
  }

  .site-header--home .site-header__persona--home .persona-switcher {
    justify-content: center;
    gap: 2rem;
    width: max-content;
    max-width: 100%;
  }

  .site-header--home .site-header__persona--home .persona-btn {
    font-size: 1rem;
    padding: 10px 0;
    white-space: nowrap;
  }

  .site-header--home .lang-switch--desktop.lang-switch--cyclic {
    position: static !important;
    transform: none !important;
    grid-column: 3;
    justify-self: end;
    margin: 0 !important;
    z-index: 2;
    display: flex !important;
    width: 7.5rem;
    min-width: 7.5rem;
    max-width: 7.5rem;
    box-sizing: border-box;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.35rem 0.65rem !important;
    gap: 0.35rem !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 999px !important;
  }

  .site-header--home .lang-switch--desktop.lang-switch--cyclic .lang-switch__btn {
    display: inline-flex !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    min-width: 0;
    flex: 1 1 0;
    padding: 0.2rem 0.2rem;
    text-align: center;
    pointer-events: auto;
    overflow: visible;
  }

  .site-header--home .site-header__toggle {
    display: none !important;
  }
}
