/* Header tasarımı. Vitrinde (#app-nav) ve panel önizlemesinde (.hd-preview) aynı kurallar çalışır. Değerler --hd-* değişkenlerinden gelir. */

:is(#app-nav, .hd-preview) .custom-header.hdx {
  height: calc(var(--hd-h) + var(--hd-row, 0px)) !important;
  background: var(--hd-bg) !important;
  color: var(--hd-text);
  border-radius: 0 0 var(--hd-radius) var(--hd-radius);
  box-sizing: border-box;
  transition: box-shadow 0.2s ease;
}

:is(#app-nav, .hd-preview) .custom-header.hdx.hdx--bg-glass {
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}

:is(#app-nav, .hd-preview) .hdx.hdx--line-none { border-bottom: 0 !important; box-shadow: none; }
:is(#app-nav, .hd-preview) .hdx.hdx--line-thin { border-bottom: 1px solid color-mix(in srgb, var(--hd-text) 16%, transparent) !important; }
:is(#app-nav, .hd-preview) .hdx.hdx--line-accent { border-bottom: 3px solid var(--hd-accent) !important; }
:is(#app-nav, .hd-preview) .hdx.hdx--line-shadow { box-shadow: 0 8px 22px rgba(15, 23, 42, 0.2); }

/* ---- Yerleşim ---- */
:is(#app-nav, .hd-preview) .hdx .custom-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: var(--hd-h);
  box-sizing: border-box;
  padding: 0 10px;
}

:is(#app-nav, .hd-preview) .hdx .custom-header-inner.shop-bar {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr);
}

:is(#app-nav, .hd-preview) .hdx .shop-bar > .logo,
:is(#app-nav, .hd-preview) .hdx .shop-bar > .logo-icon-only { grid-column: 2; grid-row: 1; justify-self: center; }
:is(#app-nav, .hd-preview) .hdx .shop-bar > .custom-menu-toggle { grid-column: 1; grid-row: 1; justify-self: start; }
:is(#app-nav, .hd-preview) .hdx .shop-bar > .shop-bar__bag { grid-column: 3; grid-row: 1; justify-self: end; }

/* Logo konumu: solda */
:is(#app-nav, .hd-preview) .hdx.hdx--lay-auto.hdx--align-left .custom-header-inner.shop-bar { grid-template-columns: auto minmax(0, 1fr) auto; }
:is(#app-nav, .hd-preview) .hdx.hdx--lay-auto.hdx--align-left .shop-bar > .logo,
:is(#app-nav, .hd-preview) .hdx.hdx--lay-auto.hdx--align-left .shop-bar > .logo-icon-only { justify-self: start; align-items: flex-start; }

/* Logo konumu: ortada (klasik / sağ menü header'ı) */
:is(#app-nav, .hd-preview) .hdx.hdx--lay-auto.hdx--align-center .custom-header-inner:not(.shop-bar) {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr);
}

:is(#app-nav, .hd-preview) .hdx.hdx--lay-auto.hdx--align-center .custom-header-inner:not(.shop-bar) > .logo,
:is(#app-nav, .hd-preview) .hdx.hdx--lay-auto.hdx--align-center .custom-header-inner:not(.shop-bar) > .logo-icon-only { grid-column: 2; grid-row: 1; align-items: center; }
:is(#app-nav, .hd-preview) .hdx.hdx--lay-auto.hdx--align-center .custom-header-inner:not(.shop-bar) > .custom-menu-toggle { grid-column: 3; grid-row: 1; justify-self: end; }

/* ---- Logo ---- */
:is(#app-nav, .hd-preview) .hdx .logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-decoration: none;
  transform-origin: center;
  transition: transform 0.2s ease;
}

:is(#app-nav, .hd-preview) .hdx .custom-header-inner:not(.shop-bar) > .logo { align-items: flex-start; }
:is(#app-nav, .hd-preview) .hdx.hdx--lay-auto.hdx--align-center .custom-header-inner:not(.shop-bar) > .logo { align-items: center; }
:is(#app-nav, .hd-preview) .hdx.hdx--inline .logo { flex-direction: row; align-items: baseline; gap: 7px; }

:is(#app-nav, .hd-preview) .hdx .logo-main,
:is(#app-nav, .hd-preview) .hdx .logo-sub {
  display: block;
  align-self: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--hd-text);
  font-family: var(--hd-font);
}

:is(#app-nav, .hd-preview) .hdx.hdx--inline .logo-main,
:is(#app-nav, .hd-preview) .hdx.hdx--inline .logo-sub { align-self: baseline; flex: 0 1 auto; min-width: 0; }

:is(#app-nav, .hd-preview) .hdx .logo-main {
  font-size: min(var(--hd-title), 8.2vw);
  font-weight: var(--hd-weight);
  letter-spacing: var(--hd-spacing);
  line-height: 1.1;
}

:is(#app-nav, .hd-preview) .hdx.hdx--upper .logo-main { text-transform: uppercase; }

:is(#app-nav, .hd-preview) .hdx .logo-sub {
  font-size: var(--hd-sub);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.04em;
  line-height: 1.15;
  opacity: 0.94;
}

:is(#app-nav, .hd-preview) .hdx.hdx--nosub .logo-sub { display: none; }

:is(#app-nav, .hd-preview) .hdx .logo-icon-only i {
  color: var(--hd-text) !important;
  font-size: calc(var(--hd-title) + 6px) !important;
}

/* ---- Menü ve sepet ikonları ---- */
:is(#app-nav, .hd-preview) .hdx .custom-header-inner > .custom-menu-toggle,
:is(#app-nav, .hd-preview) .hdx .custom-header-inner > .shop-bar__bag {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 7px;
  box-sizing: border-box;
  width: calc(var(--hd-icon) + 18px);
  height: calc(var(--hd-icon) + 18px);
  margin: 0;
  padding: 0;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--hd-text);
  text-decoration: none;
  cursor: pointer;
}

:is(#app-nav, .hd-preview) .hdx .custom-header-inner:not(.shop-bar) > .custom-menu-toggle { width: auto; min-width: calc(var(--hd-icon) + 18px); padding: 0 10px; }
:is(#app-nav, .hd-preview) .hdx.hdx--nobag .shop-bar__bag { visibility: hidden; }

:is(#app-nav, .hd-preview) .hdx .custom-menu-toggle .menu-ico,
:is(#app-nav, .hd-preview) .hdx .shop-bar__bag .menu-ico {
  width: var(--hd-icon);
  height: var(--hd-icon);
  font-size: var(--hd-icon);
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:is(#app-nav, .hd-preview) .hdx .custom-menu-toggle .hd-menu-text {
  font: 800 14px/1.1 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: currentColor;
  white-space: nowrap;
}

:is(#app-nav, .hd-preview) .hdx.hdx--shape-rounded .custom-header-inner > :is(.custom-menu-toggle, .shop-bar__bag) { border-radius: 12px; }
:is(#app-nav, .hd-preview) .hdx.hdx--shape-square .custom-header-inner > :is(.custom-menu-toggle, .shop-bar__bag) { border-radius: 4px; }

:is(#app-nav, .hd-preview) .hdx.hdx--icon-soft .custom-header-inner > :is(.custom-menu-toggle, .shop-bar__bag) {
  background: color-mix(in srgb, var(--hd-text) 13%, transparent);
}

:is(#app-nav, .hd-preview) .hdx.hdx--icon-outline .custom-header-inner > :is(.custom-menu-toggle, .shop-bar__bag) {
  border-color: color-mix(in srgb, var(--hd-text) 45%, transparent);
}

:is(#app-nav, .hd-preview) .hdx.hdx--icon-solid .custom-header-inner > :is(.custom-menu-toggle, .shop-bar__bag) {
  background: var(--hd-accent);
  color: var(--hd-accent-ink);
}

:is(#app-nav, .hd-preview) .hdx .custom-header-inner > :is(.custom-menu-toggle, .shop-bar__bag):focus-visible {
  outline: 2px solid var(--hd-accent);
  outline-offset: 2px;
}

/* ---- Sepet: "auto" yerleşimde yalnız Vitrin menüsünde görünür ---- */
:is(#app-nav, .hd-preview) .hdx .hd-cta-text { display: none; }
:is(#app-nav, .hd-preview) .hdx.hdx--lay-auto .custom-header-inner:not(.shop-bar) > .shop-bar__bag { display: none; }

/* ---- Menü düğmesinin içeriği ---- */
:is(#app-nav, .hd-preview) .hdx.hdx--mc-auto .shop-bar .hd-menu-text,
:is(#app-nav, .hd-preview) .hdx.hdx--mc-icon .hd-menu-text,
:is(#app-nav, .hd-preview) .hdx.hdx--mc-text .custom-menu-toggle .menu-ico { display: none; }

:is(#app-nav, .hd-preview) .hdx.hdx--mc-icon .custom-header-inner > .custom-menu-toggle.custom-menu-toggle {
  width: calc(var(--hd-icon) + 18px);
  min-width: 0;
  padding: 0;
}

:is(#app-nav, .hd-preview) .hdx:is(.hdx--mc-side, .hdx--mc-text) .custom-header-inner > .custom-menu-toggle.custom-menu-toggle {
  flex-direction: row;
  width: auto;
  height: 42px;
  gap: 7px;
  padding: 0 12px;
}

:is(#app-nav, .hd-preview) .hdx.hdx--mc-side .custom-header-inner > .custom-menu-toggle .menu-ico { width: min(var(--hd-icon), 26px); height: min(var(--hd-icon), 26px); }

/* "Yalnız yazı": sade stilde de düğme olduğu anlaşılsın */
:is(#app-nav, .hd-preview) .hdx.hdx--mc-text.hdx--icon-plain .custom-header-inner > .custom-menu-toggle.custom-menu-toggle {
  border-color: color-mix(in srgb, var(--hd-text) 45%, transparent);
}

/* İkon altında yazı (menü ve istenirse sepet) */
:is(#app-nav, .hd-preview) .hdx.hdx--mc-below .custom-header-inner > .custom-menu-toggle.custom-menu-toggle,
:is(#app-nav, .hd-preview) .hdx.hdx--baglabel:not(.hdx--cta) .custom-header-inner > .shop-bar__bag.shop-bar__bag {
  flex-direction: column;
  gap: 1px;
  width: auto;
  min-width: calc(var(--hd-icon) + 20px);
  height: calc(var(--hd-icon) + 22px);
  padding: 0 5px;
}

:is(#app-nav, .hd-preview) .hdx.hdx--shape-circle.hdx--mc-below .custom-header-inner > .custom-menu-toggle.custom-menu-toggle,
:is(#app-nav, .hd-preview) .hdx.hdx--shape-circle.hdx--baglabel:not(.hdx--cta) .custom-header-inner > .shop-bar__bag.shop-bar__bag { border-radius: 14px; }

:is(#app-nav, .hd-preview) .hdx.hdx--mc-below .custom-menu-toggle .hd-menu-text,
:is(#app-nav, .hd-preview) .hdx.hdx--baglabel:not(.hdx--cta) .shop-bar__bag .hd-cta-text {
  display: block;
  font: 800 10.5px/1.15 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ---- Hazır yerleşimler ---- */
:is(#app-nav, .hd-preview) .hdx:not(.hdx--lay-auto) .custom-header-inner {
  display: grid;
  grid-template-rows: 100%;
  align-items: center;
  column-gap: 8px;
}

:is(#app-nav, .hd-preview) .hdx.hdx--lay-mlb .custom-header-inner.custom-header-inner {
  grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr);
  grid-template-areas: "menu logo bag";
}

:is(#app-nav, .hd-preview) .hdx.hdx--lay-blm .custom-header-inner.custom-header-inner {
  grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr);
  grid-template-areas: "bag logo menu";
}

:is(#app-nav, .hd-preview) .hdx.hdx--lay-lbm .custom-header-inner.custom-header-inner {
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "logo bag menu";
  padding-left: 14px;
}

:is(#app-nav, .hd-preview) .hdx.hdx--lay-mls .custom-header-inner.custom-header-inner {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "menu logo bag";
}

:is(#app-nav, .hd-preview) .hdx.hdx--lay-bml .custom-header-inner.custom-header-inner {
  grid-template-columns: auto auto minmax(0, 1fr);
  grid-template-areas: "menu bag logo";
  padding-right: 14px;
}

:is(#app-nav, .hd-preview) .hdx:not(.hdx--lay-auto) .custom-header-inner > :is(.logo, .logo-icon-only) { grid-area: logo; justify-self: center; align-items: center; }
:is(#app-nav, .hd-preview) .hdx:not(.hdx--lay-auto) .custom-header-inner > .custom-menu-toggle { grid-area: menu; justify-self: start; }
:is(#app-nav, .hd-preview) .hdx:not(.hdx--lay-auto) .custom-header-inner > .shop-bar__bag { grid-area: bag; justify-self: end; }
:is(#app-nav, .hd-preview) .hdx.hdx--lay-blm .custom-header-inner > .custom-menu-toggle { justify-self: end; }
:is(#app-nav, .hd-preview) .hdx.hdx--lay-blm .custom-header-inner > .shop-bar__bag { justify-self: start; }
:is(#app-nav, .hd-preview) .hdx:is(.hdx--lay-lbm, .hdx--lay-mls) .custom-header-inner > :is(.logo, .logo-icon-only) { justify-self: start; align-items: flex-start; }
:is(#app-nav, .hd-preview) .hdx.hdx--lay-bml .custom-header-inner > :is(.logo, .logo-icon-only) { justify-self: end; align-items: flex-end; }
:is(#app-nav, .hd-preview) .hdx:not(.hdx--lay-auto).hdx--nobag .custom-header-inner > .shop-bar__bag { display: none; }

/* ---- Yazılı sipariş düğmesi ---- */
:is(#app-nav, .hd-preview) .hdx.hdx--cta .custom-header-inner > .shop-bar__bag.shop-bar__bag {
  width: auto;
  height: 40px;
  padding: 0 14px;
  border-color: transparent;
  border-radius: 999px;
  background: var(--hd-accent);
  color: var(--hd-accent-ink);
  font: 800 14px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  white-space: nowrap;
}

:is(#app-nav, .hd-preview) .hdx.hdx--cta.hdx--shape-rounded .custom-header-inner > .shop-bar__bag.shop-bar__bag { border-radius: 12px; }
:is(#app-nav, .hd-preview) .hdx.hdx--cta.hdx--shape-square .custom-header-inner > .shop-bar__bag.shop-bar__bag { border-radius: 4px; }
:is(#app-nav, .hd-preview) .hdx.hdx--cta .shop-bar__bag .menu-ico { display: none; }
:is(#app-nav, .hd-preview) .hdx.hdx--cta .hd-cta-text { display: inline; }
:is(#app-nav, .hd-preview) .hdx.hdx--cta.hdx--lay-auto .custom-header-inner.shop-bar { grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr); }

/* ---- Hızlı bağlantı satırı ---- */
:is(#app-nav, .hd-preview) .hdx .hd-links { display: none; }

:is(#app-nav, .hd-preview) .hdx.hdx--links .hd-links {
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--hd-row);
  max-width: 480px;
  margin: 0 auto;
  padding: 0 8px;
  box-sizing: border-box;
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 1px solid color-mix(in srgb, var(--hd-text) 14%, transparent);
}

:is(#app-nav, .hd-preview) .hdx .hd-links::-webkit-scrollbar { display: none; }

:is(#app-nav, .hd-preview) .hdx .hd-links a {
  flex-shrink: 0;
  padding: 6px 10px;
  color: var(--hd-text);
  font: 700 13px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

/* ---- Yüzen kart ---- */
:is(#app-nav, .hd-preview) .custom-header.hdx.hdx--card-float {
  padding: 6px max(8px, calc(50% - 232px)) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

:is(#app-nav, .hd-preview) .hdx.hdx--card-float::before {
  content: "";
  position: absolute;
  inset: 6px max(8px, calc(50% - 232px));
  z-index: -1;
  border-radius: max(var(--hd-radius), 14px);
  background: var(--hd-bg);
}

:is(#app-nav, .hd-preview) .hdx.hdx--card-float.hdx--bg-glass::before { -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); }
:is(#app-nav, .hd-preview) .hdx.hdx--card-float.hdx--line-thin::before { border: 1px solid color-mix(in srgb, var(--hd-text) 16%, transparent); }
:is(#app-nav, .hd-preview) .hdx.hdx--card-float.hdx--line-accent::before { border-bottom: 3px solid var(--hd-accent); }
:is(#app-nav, .hd-preview) .hdx.hdx--card-float.hdx--line-shadow::before { box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25); }
:is(#app-nav, .hd-preview) .hdx.hdx--card-float .custom-header-inner { width: 100%; height: calc(var(--hd-h) - 12px); }

/* ---- Kaydırınca küçülme ---- */
#app-nav .custom-header.hdx--shrink.is-scrolled { box-shadow: 0 10px 26px rgba(15, 23, 42, 0.28); }
#app-nav .custom-header.hdx--shrink.is-scrolled .logo,
#app-nav .custom-header.hdx--shrink.is-scrolled .logo-icon-only { transform: scale(0.85); }

@media (prefers-reduced-motion: reduce) {
  :is(#app-nav, .hd-preview) .custom-header.hdx,
  :is(#app-nav, .hd-preview) .hdx .logo { transition: none; }
}
