/**
 * Header do site — OrquestraShop (landing index)
 * Um único componente: desktop ≥1024px nav inline; <1024 drawer + overlay.
 */

:root {
  --os-header-h: 64px;
  /* Espaço extra abaixo do header ao ir para âncoras (#seções) — alinhado ao JS em custom.js */
  --os-anchor-gap: 20px;
  --os-anchor-offset: calc(var(--os-header-h) + var(--os-anchor-gap));
  --os-header-bg: #ffffff;
  --os-header-border: rgba(15, 23, 42, 0.08);
  --os-header-text: #334155;
  --os-header-text-muted: #64748b;
  --os-header-accent: #00b494;
  --os-header-accent-soft: rgba(0, 180, 148, 0.12);
  --os-header-max: 1400px;
}

@media (min-width: 1024px) {
  :root {
    --os-header-h: 72px;
  }
}

/* Espaço do conteúdo abaixo do header fixo (só index usa este arquivo) */
#dtr-main-content {
  padding-top: var(--os-header-h);
}

#dtr-main-content .hero-section-top-padding {
  padding-top: clamp(16px, 3vw, 24px);
}

#dtr-wrapper .container {
  max-width: var(--os-header-max);
}

/*
 * Âncoras: scroll-margin no alvo evita título “embaixo” do header fixo
 * em saltos nativos (ex.: link externo index.html#planos com JS desligado).
 * O scroll via jQuery usa o mesmo --os-anchor-gap em custom.js.
 */
#dtr-main-content section[id],
/* #how-it-works fica na primeira row (fora do <section>) — manter scroll-margin nativo */
#how-it-works {
  scroll-margin-top: var(--os-anchor-offset);
}

/* ─── Shell ─── */
.os-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10050;
  background: var(--os-header-bg);
  border-bottom: 1px solid var(--os-header-border);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.os-site-header.is-scrolled {
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  border-bottom-color: rgba(15, 23, 42, 0.1);
}

.os-site-header.is-open {
  box-shadow: none;
}

.os-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--os-header-h);
  max-width: var(--os-header-max);
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 28px);
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

.os-header__end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.os-header__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.os-header__logo img {
  display: block;
  height: auto;
  max-height: 40px;
  width: auto;
  max-width: min(200px, 46vw);
}

@media (min-width: 1024px) {
  .os-header__logo img {
    max-height: 44px;
    max-width: 200px;
  }
}

/* CTAs na barra: escondidos em telas muito estreitas (vão para o drawer) */
.os-header__toolbar {
  display: none;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .os-header__toolbar {
    display: flex;
  }
}

.os-header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.os-header__btn:active {
  transform: scale(0.98);
}

.os-header__btn--primary {
  background: var(--os-header-accent);
  border-color: var(--os-header-accent);
  color: #fff;
}

.os-header__btn--primary:hover {
  background: #009e82;
  border-color: #009e82;
  color: #fff;
}

.os-header__btn--ghost {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #1e293b;
}

.os-header__btn--ghost:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* Hamburger */
.os-header__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  color: #0f172a;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.os-header__toggle:hover {
  background: rgba(15, 23, 42, 0.06);
}

.os-header__toggle:focus-visible {
  outline: 2px solid var(--os-header-accent);
  outline-offset: 2px;
}

.os-header__toggle-bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 22px;
  pointer-events: none;
}

.os-header__toggle-bars span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.os-site-header.is-open .os-header__toggle-bars span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.os-site-header.is-open .os-header__toggle-bars span:nth-child(2) {
  opacity: 0;
}

.os-site-header.is-open .os-header__toggle-bars span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 1024px) {
  .os-header__toggle {
    display: none;
  }
}

/* ─── Painel de navegação ─── */
/* Backdrop antes da barra no DOM: fica atrás do conteúdo do header */
.os-header__backdrop {
  display: none;
  position: fixed;
  top: var(--os-header-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.os-site-header.is-open .os-header__backdrop {
  display: block;
}

.os-header__panel {
  display: none;
  position: fixed;
  top: var(--os-header-h);
  left: 0;
  right: 0;
  z-index: 2;
  max-height: calc(100dvh - var(--os-header-h));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--os-header-bg);
  border-bottom: 1px solid var(--os-header-border);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  padding: 8px 0 16px;
}

.os-site-header.is-open .os-header__panel {
  display: block;
}

.os-header__nav {
  margin: 0;
  padding: 0 12px;
}

.os-header__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.os-header__link {
  display: block;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--os-header-text);
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
}

.os-header__link:hover,
.os-header__link:focus-visible {
  background: var(--os-header-accent-soft);
  color: var(--os-header-accent);
  outline: none;
}

.os-header__link.active {
  color: var(--os-header-accent);
  font-weight: 600;
  background: rgba(0, 180, 148, 0.14);
}

.os-header__panel-footer {
  margin-top: 12px;
  padding: 16px 16px 8px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.os-header__panel-footer .os-header__btn {
  width: 100%;
  justify-content: center;
  padding: 14px 18px;
  font-size: 15px;
}

/* CTAs duplicados no drawer: só quando a barra não mostra os botões */
@media (min-width: 480px) {
  .os-header__panel-footer {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .os-header__backdrop,
  .os-site-header.is-open .os-header__backdrop {
    display: none !important;
  }

  .os-header__bar {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 20px;
  }

  .os-header__logo {
    justify-self: start;
  }

  .os-header__panel {
    display: flex !important;
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: none;
    box-shadow: none;
    min-width: 0;
    justify-self: stretch;
    justify-content: center;
    align-items: center;
  }

  .os-site-header.is-open .os-header__panel {
    display: flex !important;
  }

  .os-header__nav {
    padding: 0 4px;
    width: 100%;
    display: flex;
    justify-content: center;
    min-width: 0;
  }

  .os-header__list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 2px;
    row-gap: 4px;
  }

  .os-header__link {
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
  }

  .os-header__end {
    justify-self: end;
  }
}

/* Bloqueio de scroll quando menu mobile aberto */
html.os-header--locked,
html.os-header--locked body {
  overflow: hidden;
  touch-action: none;
}

@media (min-width: 1024px) {
  html.os-header--locked,
  html.os-header--locked body {
    overflow: visible;
    touch-action: auto;
  }
}

/* ─── Marca + aviso Beta (landing e páginas legais) ─── */
.os-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}

.os-header__beta-pill {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #127d67;
  background: linear-gradient(
    180deg,
    rgba(236, 253, 249, 0.98) 0%,
    var(--os-header-accent-soft) 55%,
    rgba(0, 180, 148, 0.1) 100%
  );
  border: 1px solid rgba(0, 180, 148, 0.38);
  border-radius: 999px;
  padding: 5px 10px;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65) inset,
    0 1px 2px rgba(18, 125, 103, 0.08);
}

@media (max-width: 380px) {
  .os-header__beta-pill {
    font-size: 10px;
    padding: 4px 8px;
  }
}

.os-beta-banner {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 12px clamp(14px, 3vw, 28px);
  background: linear-gradient(
    90deg,
    rgba(240, 253, 250, 0.92) 0%,
    rgba(236, 253, 249, 0.98) 48%,
    rgba(240, 253, 250, 0.92) 100%
  );
  border-bottom: 1px solid rgba(0, 180, 148, 0.22);
  color: var(--os-header-text);
  font-size: clamp(0.8125rem, 2.2vw, 0.9375rem);
  line-height: 1.55;
  text-align: center;
}

.os-beta-banner__inner {
  max-width: var(--os-header-max);
  margin: 0 auto;
}

.os-beta-banner a {
  color: var(--os-header-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.os-beta-banner a:hover {
  color: #127d67;
}

.os-beta-banner strong {
  color: #127d67;
}

/* Bloco beta em páginas de texto (termos / política): não ocupa largura total */
.os-beta-banner--legal {
  text-align: left;
  margin-bottom: 1.35rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 180, 148, 0.28);
  box-shadow: 0 2px 14px rgba(18, 125, 103, 0.07);
}
