/* =============================================================
   Üst Menü
   Sabitleme tamamen CSS `position: sticky` ile yapılır —
   scroll dinleyicisi olmadığı için titreme/zıplama oluşmaz.
   ============================================================= */

.site-header {
  position: sticky;
  top: calc(-1 * var(--topbar-h));
  z-index: var(--z-header);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--t-base);
}
.site-header.is-stuck { box-shadow: 0 1px 0 var(--line), var(--shadow-md); }

/* Sticky durumunu algılamak için görünmez işaret */
.header-sentinel { height: 1px; margin-bottom: -1px; }

/* -------------------------------------------------------------
   Üst şerit
   ------------------------------------------------------------- */
.topbar {
  height: var(--topbar-h);
  background: var(--brand-darker);
  color: rgba(255, 255, 255, 0.86);
  font-size: var(--fs-12);
}
.topbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}
.topbar__tagline {
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__right {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}
.topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
}
.topbar__link:hover { color: #fff; }
.topbar__link svg { width: 13px; height: 13px; }
.topbar__sep { width: 1px; height: 14px; background: rgba(255,255,255,0.18); }

/* -------------------------------------------------------------
   Dil seçici
   ------------------------------------------------------------- */
.lang { position: relative; }
.lang__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px 6px;
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--fs-12);
  font-weight: var(--fw-medium);
  border-radius: 2px;
  transition: background-color var(--t-fast);
}
.lang__btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.lang__chevron {
  width: 12px; height: 12px;
  transition: transform var(--t-base);
}
.lang__btn[aria-expanded="true"] .lang__chevron { transform: rotate(180deg); }

.lang__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 172px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--t-base), transform var(--t-base), visibility var(--t-base);
  z-index: var(--z-dropdown);
}
.lang__menu.is-open { opacity: 1; visibility: visible; transform: none; }

.lang__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-14);
  color: var(--ink-2);
  border-radius: 2px;
  transition: background-color var(--t-fast);
}
.lang__item:hover { background: var(--surface-2); color: var(--ink); }
.lang__item.is-active { color: var(--brand); font-weight: var(--fw-semibold); background: var(--brand-tint); }
.lang__check { margin-left: auto; width: 14px; height: 14px; color: var(--brand); }

.flag {
  width: 20px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 1px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  display: block;
}
.flag svg { width: 100%; height: 100%; display: block; }

/* -------------------------------------------------------------
   Ana satır: logo + arama + işlemler
   ------------------------------------------------------------- */
.header-main { min-height: var(--headmain-h); }
.header-main__inner {
  height: var(--headmain-h);
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}
.logo__mark {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-13);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  border-radius: 2px;
}
.logo__text { display: flex; flex-direction: column; line-height: 1.15; }
.logo__name {
  font-size: var(--fs-18);
  font-weight: var(--fw-bold);
  letter-spacing: -0.015em;
  color: var(--ink);
}
.logo__sub {
  font-size: var(--fs-11);
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Mobil arama satırı — yalnızca dar ekranlarda görünür */
.mobile-search { display: none; }

/* Arama */
.search {
  position: relative;
  flex: 1;
  max-width: 520px;
}
.search__input {
  width: 100%;
  padding: 10px var(--sp-8) 10px var(--sp-4);
  font-size: var(--fs-14);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color var(--t-fast), background-color var(--t-fast), box-shadow var(--t-fast);
}
.search__input:hover { border-color: var(--ink-4); }
.search__input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.search__submit {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  border-radius: 2px;
}
.search__submit:hover { color: var(--brand); background: var(--surface-3); }
.search__submit svg { width: 17px; height: 17px; }

.search__results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  z-index: var(--z-dropdown);
  max-height: 420px;
  overflow-y: auto;
}
.search__results.is-open { display: block; }
.search__result {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.search__result:last-child { border-bottom: none; }
.search__result:hover, .search__result.is-active { background: var(--surface-2); }
.search__result img {
  width: 40px; height: 40px;
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
}
.search__result-name { font-size: var(--fs-14); font-weight: var(--fw-medium); }
.search__result-price { margin-left: auto; font-size: var(--fs-14); font-weight: var(--fw-semibold); color: var(--brand); }
.search__empty { padding: var(--sp-5); text-align: center; color: var(--ink-3); font-size: var(--fs-14); }

/* İşlemler */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}
.header-action {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  color: var(--ink-2);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.header-action:hover { background: var(--surface-2); color: var(--ink); }
.header-action__icon { position: relative; }
.header-action__icon svg { width: 21px; height: 21px; }
.header-action__text { display: flex; flex-direction: column; line-height: 1.25; }
.header-action__label { font-size: var(--fs-11); color: var(--ink-3); }
.header-action__value { font-size: var(--fs-13); font-weight: var(--fw-semibold); }

.header-action__count {
  position: absolute;
  top: -6px; right: -8px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-11);
  font-weight: var(--fw-bold);
  border-radius: var(--radius-pill);
  border: 2px solid var(--surface);
  box-sizing: content-box;
}
.header-action__count[data-count="0"] { display: none; }

/* Hesap açılır menüsü */
.account-menu { position: relative; }
.account-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--t-base), transform var(--t-base), visibility var(--t-base);
  z-index: var(--z-dropdown);
}
.account-menu__panel.is-open { opacity: 1; visibility: visible; transform: none; }
.account-menu__user {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--sp-2);
}
.account-menu__name { font-size: var(--fs-14); font-weight: var(--fw-semibold); }
.account-menu__mail { font-size: var(--fs-12); color: var(--ink-3); word-break: break-all; }
.account-menu__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-14);
  color: var(--ink-2);
  border-radius: 2px;
}
.account-menu__link:hover { background: var(--surface-2); color: var(--ink); }
.account-menu__link svg { width: 15px; height: 15px; color: var(--ink-3); }

/* Hamburger */
.burger {
  display: none;
  width: 40px; height: 40px;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.burger svg { width: 20px; height: 20px; }

/* -------------------------------------------------------------
   Alt gezinme çubuğu
   ------------------------------------------------------------- */
.header-nav {
  height: var(--headnav-h);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.header-nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  height: 100%;
}
.nav-links__item {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  font-size: var(--fs-14);
  font-weight: var(--fw-medium);
  color: var(--ink-2);
}
.nav-links__item::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transition: transform var(--t-base);
}
.nav-links__item:hover { color: var(--ink); }
.nav-links__item.is-active { color: var(--brand); font-weight: var(--fw-semibold); }
.nav-links__item.is-active::after { transform: scaleX(1); }

.nav-extra { margin-left: auto; display: flex; align-items: center; gap: var(--sp-4); }
.nav-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-13);
  color: var(--ink-3);
}
.nav-note svg { width: 15px; height: 15px; color: var(--brand); }

/* Kategori mega menüsü */
.cat-menu { position: relative; height: 100%; display: flex; align-items: center; }
.cat-menu__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px var(--sp-4);
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius);
  transition: background-color var(--t-fast);
}
.cat-menu__btn:hover { background: var(--brand-dark); }
.cat-menu__btn svg { width: 15px; height: 15px; }
.cat-menu__btn .lang__chevron { width: 12px; height: 12px; }

.cat-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 620px;
  max-width: calc(100vw - 48px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-3);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--t-base), transform var(--t-base), visibility var(--t-base);
  z-index: var(--z-dropdown);
}
.cat-menu__panel.is-open { opacity: 1; visibility: visible; transform: none; }
.cat-menu__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  font-size: var(--fs-14);
  color: var(--ink-2);
  border-radius: 2px;
}
.cat-menu__link:hover { background: var(--surface-2); color: var(--brand); }
.cat-menu__link img {
  width: 34px; height: 34px;
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
  border-radius: 2px;
}
.cat-menu__count { margin-left: auto; font-size: var(--fs-12); color: var(--ink-4); }

/* -------------------------------------------------------------
   Mobil çekmece
   ------------------------------------------------------------- */
.drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 320px;
  max-width: 86vw;
  background: var(--surface);
  z-index: var(--z-drawer);
  transform: translateX(-100%);
  transition: transform var(--t-slow);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.drawer.is-open { transform: none; }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
}
.drawer__close {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.drawer__close svg { width: 16px; height: 16px; }
.drawer__section { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line); }
.drawer__label {
  font-size: var(--fs-11);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: var(--sp-3);
}
.drawer__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  font-size: var(--fs-15);
  font-weight: var(--fw-medium);
  color: var(--ink-2);
}
.drawer__link:hover { color: var(--brand); }
.drawer__link.is-active { color: var(--brand); }
.drawer__link img { width: 28px; height: 28px; object-fit: cover; border-radius: 2px; }
.drawer__foot { padding: var(--sp-5); margin-top: auto; }
