/* SWISS Instalacije: site header. Mobile first check: 64 px bar on phones, 40 px top bar
   plus a 76 px bar on desktop. The bar is sticky; the top bar scrolls away.
   Every icon has a fixed size and flex: none, so it can never grow. */

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

.topbar,
.site-header {
  --hd-bg: var(--bg, #151515);
  --hd-surface: var(--surface-1, #1b1b1b);
  --hd-line: var(--line, #2a2a2a);
  --hd-text: var(--text, #f2f2f0);
  --hd-muted: var(--text-muted, #a3a3a3);
  --hd-subtle: var(--text-subtle, #8a8a8a);
  --hd-brand: var(--brand, #c2272b);
  --hd-brand-hover: var(--brand-hover, #b33f2e);
  --hd-open: var(--status-open, #48b884);
  --hd-focus: var(--focus, #f2f2f0);
}

.topbar a:focus-visible,
.site-header a:focus-visible,
.site-header button:focus-visible {
  outline: 2px solid var(--hd-focus);
  outline-offset: 2px;
}

.topbar svg,
.site-header svg {
  flex: none;
}

/* ---------- top bar (desktop only) ---------- */

.topbar {
  background: var(--hd-bg);
  border-bottom: 1px solid var(--hd-line);
  color: var(--hd-muted);
  font-size: 0.8125rem;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1320px;
  min-height: 40px;
  margin: 0 auto;
  padding: 0 24px;
}

.topbar__list {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.topbar__item svg {
  width: 16px;
  height: 16px;
  color: var(--hd-subtle);
}

a.topbar__item:hover {
  color: var(--hd-text);
}

.topbar__lang {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar__lang__link,
.site-drawer__lang__link {
  color: inherit;
  text-decoration: none;
}

.topbar__lang__link[aria-current],
.site-drawer__lang__link[aria-current] {
  color: var(--hd-text);
  font-weight: 600;
}

.topbar__lang__link:hover,
.site-drawer__lang__link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* opening hours status, text set by the script from Zagreb time */
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 12px;
  border: 1px solid var(--hd-line);
  border-radius: 999px;
  color: var(--hd-text);
  font-size: 0.8125rem;
  white-space: nowrap;
  visibility: hidden;
}

.status.is-ready {
  visibility: visible;
}

.status__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hd-subtle);
}

.status[data-state="open"] .status__dot {
  background: var(--hd-open);
  box-shadow: 0 0 0 3px rgba(72, 184, 132, 0.18);
}

/* ---------- main bar ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--hd-bg);
  transition: background-color 0.2s ease-out, box-shadow 0.2s ease-out;
}

.site-header.is-scrolled {
  background: var(--hd-surface);
  box-shadow: 0 1px 0 var(--hd-line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 1320px;
  height: 76px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header__brand {
  display: inline-flex;
  flex: none;
  margin-right: auto;
}

.site-header__brand img {
  display: block;
  width: auto;
  height: 30px;
}

.site-nav__list {
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--hd-text);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 8px;
  left: 0;
  height: 2px;
  background: var(--hd-brand);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s ease-out;
}

.site-nav__link:hover::after,
.site-nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}

.site-header__cta,
.site-drawer__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 4px;
  background: var(--hd-brand);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease-out;
}

.site-header__cta:hover,
.site-drawer__cta:hover {
  background: var(--hd-brand-hover);
}

.site-header__icon {
  display: none;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--hd-line);
  border-radius: 4px;
  background: transparent;
  color: var(--hd-text);
  cursor: pointer;
}

.site-header__icon svg {
  width: 20px;
  height: 20px;
}

.burger,
.burger::before,
.burger::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s ease-out, background-color 0.2s ease-out;
}

.burger {
  position: relative;
}

.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
}

.burger::before { top: -6px; }
.burger::after { top: 6px; }

.site-header__toggle[aria-expanded="true"] .burger { background: transparent; }
.site-header__toggle[aria-expanded="true"] .burger::before { transform: translateY(6px) rotate(45deg); }
.site-header__toggle[aria-expanded="true"] .burger::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- drawer (phones and tablets) ---------- */

.site-drawer {
  position: fixed;
  top: calc(64px + env(safe-area-inset-top, 0px));
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 99;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom, 0px));
  background: var(--hd-bg);
  border-top: 1px solid var(--hd-line);
}

.site-drawer[hidden] {
  display: none;
}

.site-drawer__nav {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.site-drawer__link {
  display: flex;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--hd-line);
  color: var(--hd-text);
  font-size: 1.375rem;
  font-weight: 600;
  text-decoration: none;
}

.site-drawer__link[aria-current="page"] {
  color: var(--brand-text, #dd585c);
}

.site-drawer__cta {
  display: flex;
  min-height: 52px;
  margin-bottom: 28px;
  font-size: 1rem;
}

.site-drawer__contact {
  display: grid;
  gap: 4px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.site-drawer__item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--hd-muted);
  font-size: 1rem;
  text-decoration: none;
}

.site-drawer__item svg {
  width: 18px;
  height: 18px;
  color: var(--hd-subtle);
}

a.site-drawer__item:hover {
  color: var(--hd-text);
}

.site-drawer .status {
  white-space: normal;
}

.site-drawer__lang {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 0;
  color: var(--hd-muted);
  font-size: 1rem;
}

.site-drawer__lang__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

html.has-open-drawer,
html.has-open-drawer body {
  overflow: hidden;
}

/* the script fixes the body and stores the scroll position, so iOS keeps the page in place */
html.has-open-drawer body {
  position: fixed;
  right: 0;
  left: 0;
  width: 100%;
}

/* ---------- breakpoints ---------- */

@media (max-width: 1180px) {
  .topbar__list { gap: 20px; }
  .site-header__inner { gap: 24px; }
  .site-nav__list { gap: 24px; }
}

@media (max-width: 999px) {
  .topbar { display: none; }

  .site-header__inner {
    gap: 8px;
    height: 64px;
    padding: 0 16px;
  }

  .site-header__brand img { height: 26px; }

  .site-nav,
  .site-header__cta { display: none; }

  .site-header__icon { display: inline-flex; }
}

@media (min-width: 1000px) {
  .site-drawer { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-nav__link::after,
  .burger,
  .burger::before,
  .burger::after { transition: none; }
}
