/* =========================================================
   Header — plochý fixní bar přes celou šířku (Apple směr).
   Vždy viditelný, žádné zasouvání při scrollu, tenký.
========================================================= */

#site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

/* Podstránky: header sedí nahoře a odroluje s obsahem (sticky jen na homepage).
   Statický header zabírá místo ve flow → kompenzační offset (landing hero)
   se vynuluje, takže obsah sedí stejně jako dřív, jen header nezůstává viset. */
body.is-subpage {
  --header-offset-mobile: 0px;
  --header-offset-desktop: 0px;
}

body.is-subpage #site-header {
  position: static;
}

/* Otevřené mobilní menu na podstránce: statický header ignoruje z-index,
   takže rozbalený dropdown prosvítá pod obsahem (mockupy s backdrop-filter,
   pkg-bar, transformované sekce paintnou navrch). Relative + z-index vytvoří
   stacking context a povýší header (i dropdown) nad obsah. */
body.is-subpage #site-header.is-open {
  position: relative;
  z-index: 1100;
}

#site-header .container {
  position: relative;
}

#site-header .header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
}

/* === Brand / logo === */
#site-header .header-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

#site-header .header-brand img {
  display: block;
  width: auto;
  height: 22px;
}

/* === Navigace — mobil (rozbalovací panel pod barem) === */
#site-header .header-nav {
  position: absolute;
  top: 100%;
  left: calc(var(--container-x) * -1);
  right: calc(var(--container-x) * -1);
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px var(--container-x);
  background: var(--header-nav-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

#site-header.is-open .header-nav {
  display: flex;
}

#site-header .header-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#site-header .header-nav li {
  margin: 0;
}

/* Pouze odkazy v UL — NE tlačítko CTA (to si nechá bílý text z .btn-primary) */
#site-header .header-nav ul a {
  display: block;
  padding: 11px 14px;
  color: var(--text-soft);
  font-size: var(--fs-small);
  font-weight: 500;
  transition: color 0.25s ease;
}

#site-header .header-nav ul a:hover {
  color: var(--text);
}

#site-header .header-nav ul li.active a {
  color: var(--text);
}

/* === Pravá zóna — ikonka kontaktu + hamburger === */
#site-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* Kontakt jako outlined ikonka telefonu — bez pozadí a ohraničení, čistá (Apple směr) */
#site-header .header-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* kruh jen s obrysem kolem ikony emailu (obálka → mailto:) */
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  border: 1.5px solid var(--text-soft);
  transition: color 0.2s ease, border-color 0.2s ease;
}

#site-header .header-contact:hover {
  color: var(--text);
  border-color: var(--text);
}

#site-header .header-contact svg {
  width: 18px;
  height: 18px;
}

/* === Hamburger — plochý, sladěný s ikonou telefonu (bez kruhu) === */
#site-header .mobile-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  border: 0;
}

#site-header .mobile-toggle span {
  width: 18px;
  height: 2px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--text);
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

#site-header.is-open .mobile-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

#site-header.is-open .mobile-toggle span:nth-child(2) {
  opacity: 0;
}

#site-header.is-open .mobile-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 768px) {
  /* Desktop: 3-zónové rozložení — logo vlevo | navigace přesně uprostřed | CTA vpravo.
     Navigace se vystředí díky symetrickým 1fr sloupcům kolem auto sloupce. */
  #site-header .header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 44px;
    gap: 18px;
  }

  #site-header .header-brand {
    justify-self: start;
  }

  #site-header .header-brand img {
    height: 22px;
  }

  #site-header .mobile-toggle {
    display: none;
  }

  /* nav zmizí z layoutu a promítne UL + CTA přímo do gridu header-inner */
  #site-header .header-nav {
    position: static;
    display: contents;
  }

  #site-header .header-nav ul {
    justify-self: center;
    flex-direction: row;
    align-items: center;
    gap: 2px;
  }

  #site-header .header-nav ul a {
    position: relative;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: var(--fs-small);
  }

  #site-header .header-actions {
    justify-self: end;
  }
}
