/*
 * sodnamis — header.css (topbar, nav, category bar, hamburger, mobile drawer)
 * Author: sodnamis.lt
 */

/* ---------- Top utility bar ---------- */
.topbar {
  background: hsl(var(--secondary));
  border-bottom: 1px solid hsl(var(--border));
  font-size: 0.8125rem;
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 2.25rem;
}
.topbar__trust { display: inline-flex; align-items: center; gap: 0.4rem; color: hsl(var(--muted-foreground)); }
.topbar__trust-label { font-weight: 700; color: hsl(var(--foreground)); }
.topbar__trust-src { font-weight: 600; }
.topbar__contacts { display: inline-flex; gap: 1rem; }
.topbar__contacts a { color: hsl(var(--muted-foreground)); font-weight: 600; }
.topbar__contacts a:hover { color: hsl(var(--primary)); }
@media (max-width: 767px) { .topbar__contacts { display: none; } }

/* ---------- Sticky header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: hsl(var(--background) / 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid hsl(var(--border));
  transition: box-shadow 0.2s ease;
}
.site-header.is-stuck { box-shadow: var(--shadow-soft); }
.site-header__inner {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: var(--header-height);
}

/* Logo / brand */
.brand { display: inline-flex; flex-direction: column; line-height: 1; }
.brand__mark { font-family: var(--font-heading); font-weight: 800; font-size: 1.6rem; color: hsl(var(--primary)); letter-spacing: -0.02em; }
.brand__tag { font-size: 0.625rem; letter-spacing: 0.08em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.site-header__logo .custom-logo { max-height: 48px; width: auto; }

/* Primary nav */
.site-nav { margin-inline-end: auto; }
.site-nav__list, .cat-bar__list { display: flex; align-items: center; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.site-nav__list a {
  font-family: var(--font-heading); font-weight: 600; font-size: 0.9375rem;
  color: hsl(var(--foreground)); padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav__list a:hover,
.site-nav__list .current-menu-item > a { color: hsl(var(--primary)); border-bottom-color: hsl(var(--primary)); }
@media (max-width: 1023px) { .site-nav { display: none; } }

/* Utility actions */
.site-header__actions { display: inline-flex; align-items: center; gap: 0.5rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; border-radius: 9999px;
  color: hsl(var(--foreground)); background: transparent; border: none; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: hsl(var(--secondary)); color: hsl(var(--primary)); }
@media (max-width: 767px) { .icon-btn:not(.icon-btn--cart) { display: none; } }

/* Language switcher */
.lang-switch { position: relative; }
.lang-switch__toggle {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: transparent; border: none; cursor: pointer;
  font-weight: 600; font-size: 0.875rem; color: hsl(var(--foreground));
  padding: 0.4rem 0.5rem; border-radius: var(--radius);
}
.lang-switch__toggle:hover { background: hsl(var(--secondary)); }
.lang-switch__menu {
  position: absolute; right: 0; top: calc(100% + 0.25rem);
  min-width: 6rem; margin: 0; padding: 0.35rem; list-style: none;
  background: hsl(var(--popover)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); box-shadow: var(--shadow-card); z-index: 120;
}
.lang-switch__menu a { display: block; padding: 0.4rem 0.6rem; border-radius: 0.4rem; font-weight: 600; color: hsl(var(--foreground)); }
.lang-switch__menu a:hover { background: hsl(var(--secondary)); }
@media (max-width: 767px) { .lang-switch { display: none; } }

.site-header__cta { white-space: nowrap; }
@media (max-width: 480px) { .site-header__cta { display: none; } }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 2.4rem; height: 2.4rem; padding: 0; background: transparent; border: none; cursor: pointer;
}
.hamburger__bar { display: block; width: 22px; height: 2px; background: hsl(var(--foreground)); border-radius: 2px; }
@media (max-width: 1023px) { .hamburger { display: inline-flex; } }

/* ---------- Category bar ---------- */
.cat-bar { border-top: 1px solid hsl(var(--border)); background: hsl(var(--background)); }
.cat-bar__nav { display: flex; align-items: center; gap: 1.25rem; overflow-x: auto; min-height: 3rem; scrollbar-width: none; }
.cat-bar__nav::-webkit-scrollbar { display: none; }
.cat-bar__offers { font-family: var(--font-heading); font-weight: 700; font-size: 0.875rem; color: hsl(var(--destructive)); white-space: nowrap; }
.cat-bar__list a {
  font-family: var(--font-heading); font-weight: 600; font-size: 0.875rem;
  color: hsl(var(--foreground)); white-space: nowrap;
}
.cat-bar__list a:hover { color: hsl(var(--primary)); }
@media (max-width: 1023px) { .cat-bar { display: none; } }

/* ---------- Mobile drawer ---------- */
.mobile-drawer { position: fixed; inset: 0; z-index: 200; }
.mobile-drawer__backdrop { position: absolute; inset: 0; z-index: 1; background: hsl(220 30% 10% / 0.5); opacity: 0; transition: opacity 0.25s ease; }
.mobile-drawer.is-open .mobile-drawer__backdrop { opacity: 1; }
.mobile-drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%; z-index: 2;
  width: min(88vw, 360px); background: hsl(var(--background));
  padding: 1.5rem; overflow-y: auto;
  transform: translateX(100%); transition: transform 0.25s ease;
  box-shadow: var(--shadow-card-hover);
}
.mobile-drawer.is-open .mobile-drawer__panel { transform: translateX(0); }
.mobile-drawer__close { position: absolute; top: 0.75rem; right: 1rem; font-size: 2rem; line-height: 1; background: none; border: none; cursor: pointer; color: hsl(var(--foreground)); }
.mobile-drawer__list { list-style: none; margin: 2rem 0 0; padding: 0; }
.mobile-drawer__list li { border-bottom: 1px solid hsl(var(--border)); }
.mobile-drawer__list a { display: block; padding: 0.9rem 0; font-family: var(--font-heading); font-weight: 600; color: hsl(var(--foreground)); }
.mobile-drawer__list a:hover { color: hsl(var(--primary)); }
.mobile-drawer hr { border: none; border-top: 1px solid hsl(var(--border)); margin: 1rem 0; }
