/* Header tasarımları (Panel › Tema › Bölümler › Üst Bilgi › Header tasarımı). Kapsam: partials/designs/header/* */
/* Bütün kurallar tasarım kökünün (.hd ve .hd-ortali / .hd-arama / .hd-tek / .hd-koyu / .hd-kategori) altında; temanın kendi header'ı etkilenmez.
   Ortak parçalar style.css'ten gelir (.menu-btn, .logo, .search, .actions, .act, .nav, .mega); burada yerleşim ve tasarıma özgü görünüm.
   Renkler temadan (--brand, --red, --text, --line, --soft, --muted, --radius); logo ve menü yazısı seçili temanın karakterinde. */

/* ==========================================================================
   Ortak
   ========================================================================== */
.hd { --hd-nav-fs: 13.5px; --hd-nav-ls: .05em; --hd-nav-tt: uppercase; --hd-nav-c: var(--text); --hd-logo-fw: 500; --hd-logo-ls: .34em; --hd-logo-tt: uppercase; --hd-logo-c: var(--text); }
/* Sade: ince büyük harfli menü, geniş aralıklı logo */
[data-theme-id="demo2"] .hd { --hd-nav-fs: 11.5px; --hd-nav-ls: .16em; --hd-logo-ls: .42em; }
/* Pudra: küçük harfli menü ve kalın logo marka renginde */
[data-theme-id="demo3"] .hd { --hd-nav-fs: 14px; --hd-nav-ls: 0; --hd-nav-tt: none; --hd-nav-c: var(--brand); --hd-logo-fw: 700; --hd-logo-ls: -.02em; --hd-logo-tt: none; --hd-logo-c: var(--brand); }

.hd .hd-bar { display: grid; align-items: center; }
.hd .logo { justify-self: start; font-weight: var(--hd-logo-fw); letter-spacing: var(--hd-logo-ls); text-transform: var(--hd-logo-tt); color: var(--hd-logo-c); padding-left: 0; white-space: nowrap; }
.hd .logo.has-img { letter-spacing: 0; }
.hd .search-box .hd-sicon { width: 18px; height: 18px; color: var(--muted); }
.hd .search-box input { font-size: 14px; }
.hd .nav-link { font-size: var(--hd-nav-fs); letter-spacing: var(--hd-nav-ls); text-transform: var(--hd-nav-tt); color: var(--hd-nav-c); white-space: nowrap; }
.hd .nav-link.is-red { color: var(--red); }
[data-theme-id="demo3"] .hd .nav-link.is-red { margin: auto 0 auto 6px; height: 32px; padding: 0 16px; border-radius: 999px; background: var(--red); color: #fff; font-weight: 600; }
[data-theme-id="demo3"] .hd .nav-link.is-red::after { content: none; }
[data-theme-id="demo3"] .hd .mega-col h6 { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--brand); }
[data-theme-id="demo2"] .hd .mega-col h6 { font-size: 11.5px; letter-spacing: .16em; }
/* Yalnızca ikon gösteren düğmelerin yazısı ekran okuyucuda kalır */
.hd-ortali .act > span:not(.act-ic), .hd-tek .act > span:not(.act-ic) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ==========================================================================
   1 · Logo Ortada — solda arama, ortada logo, sağda ikonlar; menü altta ortalı
   ========================================================================== */
.hd-ortali .hd-bar { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "search logo actions"; gap: 24px; height: 80px; }
.hd-ortali .logo { justify-self: center; font-size: 30px; }
.hd-ortali .logo:not(.has-img) { padding-left: var(--hd-logo-ls); }
[data-theme-id="demo3"] .hd-ortali .logo { padding-left: 0; font-size: 32px; }
.hd-ortali .search { justify-self: start; width: 100%; max-width: 300px; }
.hd-ortali .search-box { height: 42px; gap: 10px; padding: 0 14px; border-color: transparent; background: var(--soft); }
.hd-ortali .search-box:focus-within { border-color: var(--brand); background: #fff; }
.hd-ortali .search-box input { font-size: 13.5px; }
.hd-ortali .search-pop { right: auto; width: 440px; }
.hd-ortali .actions { gap: 4px; margin-right: -8px; }
.hd-ortali .actions .act { justify-content: center; width: 46px; min-width: 0; height: 46px; }
.hd-ortali .act .icon { width: 23px; height: 23px; }

/* ==========================================================================
   2 · Geniş Arama — solda logo, ortada hap arama, etiketli ikonlar; menü altta
   ========================================================================== */
.hd-arama .hd-bar { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "logo search actions"; gap: 44px; height: 82px; }
.hd-arama .logo { font-size: 28px; }
.hd-arama .search { justify-self: center; width: 100%; max-width: 700px; }
.hd-arama .search-box { height: 48px; padding: 0 5px 0 22px; border: 1px solid transparent; border-radius: 999px; background: var(--soft); }
.hd-arama .search-box:focus-within { border-color: var(--brand); background: #fff; }
.hd-arama .search-box button { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; transition: opacity .2s; }
.hd-arama .search-box button:hover { opacity: .85; }
.hd-arama .search-box button .icon { width: 18px; height: 18px; stroke-width: 1.8; }
.hd-arama .search-pop { top: calc(100% + 8px); border-radius: 16px; }
.hd-arama .actions { gap: 26px; }
.hd-arama .act { flex-direction: row; gap: 10px; min-width: 0; font-size: 13.5px; font-weight: 500; }
.hd-arama .act > span:not(.act-ic) { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-arama .act-ic .badge-count { left: calc(100% - 13px); top: -9px; }
.hd-arama .nav-list { justify-content: flex-start; }
.hd-arama .nav-item:first-child .nav-link { padding-left: 0; }
.hd-arama .nav-item:first-child .nav-link::after { left: 0; }

/* ==========================================================================
   3 · Tek Satır — logo, menü ve ikonlar aynı satırda; arama büyüteçle açılan şeritte
   ========================================================================== */
.hd-tek .hd-bar { display: flex; gap: 20px; height: 72px; }
.hd-tek .logo { flex: none; font-size: 24px; }
.hd-tek .logo.has-img img { max-height: 44px; }
/* Menü satırın ortasında; sığmazsa yatay kayar. Mega menü header'a göre konumlanır (kaydırma kabı onu kesmez) */
.hd-tek .nav { position: static; flex: 1; min-width: 0; border-top: 0; }
.hd-tek .nav-list { justify-content: flex-start; max-width: none; height: 72px; padding-inline: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.hd-tek .nav-list::-webkit-scrollbar { display: none; }
/* Yer varken ortalar, taşınca baştan başlar (ilk öğe kesilmez) */
.hd-tek .nav-item:first-child { margin-left: auto; }
.hd-tek .nav-item:last-child { margin-right: auto; }
/* Sağ kenarda solma: menü sığmadığında devamı olduğunu gösterir (yer varken boş alanın üstünde kalır, görünmez) */
.hd-tek .nav-list::after { content: ""; position: sticky; right: 0; z-index: 1; flex: none; width: 36px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 85%); pointer-events: none; }
.hd-tek .nav-link { padding: 0 11px; font-size: calc(var(--hd-nav-fs) - .5px); }
.hd-tek .nav-link::after { left: 11px; right: 11px; bottom: 0; }
[data-theme-id="demo3"] .hd-tek .nav-link.is-red { margin-left: 4px; padding: 0 14px; }
.hd-tek .search { position: static; flex: none; }
.hd-tek .hd-sbtn { justify-content: center; width: 42px; height: 44px; cursor: pointer; }
.hd-tek .hd-sbtn .icon { width: 23px; height: 23px; }
.hd-tek .actions { flex: none; gap: 0; margin-right: -8px; }
.hd-tek .actions .act { justify-content: center; width: 42px; min-width: 0; height: 44px; }
.hd-tek .act .icon { width: 23px; height: 23px; }
/* Arama şeridi: header'ın altında açılır (app.js odakta .is-open ekler; dışarı tıklama ve Esc kapatır) */
.hd-tek .hd-sdrop { position: absolute; left: 0; right: 0; top: 100%; z-index: 55; background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); box-shadow: 0 24px 30px -20px rgba(0, 0, 0, .18); opacity: 0; pointer-events: none; transform: translateY(-6px); transition: opacity .18s, transform .18s; }
.hd-tek .search.is-open .hd-sdrop { opacity: 1; pointer-events: auto; transform: none; }
.hd-tek .search.is-open .hd-sbtn { color: var(--red); }
.hd-tek .hd-sdrop-in { max-width: 780px; padding-block: 18px 20px; }
.hd-tek .search-box { height: 50px; gap: 12px; padding: 0 16px; border-color: var(--text); }
.hd-tek .search-box input { font-size: 15px; }
.hd-tek .search-box .hd-sicon { width: 20px; height: 20px; color: var(--text); }
.hd-tek .search-pop { position: static; max-height: min(60vh, 520px); margin-top: 10px; padding: 4px 0 0; overflow-y: auto; border: 0; border-radius: 0; box-shadow: none; opacity: 1; visibility: visible; transform: none; transition: none; }

/* ==========================================================================
   4 · Koyu Header — marka renginde üst bant, beyaz logo ve ikonlar, koyu arama; menü altta açık zeminde
   ========================================================================== */
.hd-koyu .hd-band { background: var(--brand); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.hd-koyu .hd-bar { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "logo search actions"; gap: 48px; height: 80px; }
.hd-koyu .logo { font-size: 28px; color: #fff; }
.hd-koyu .logo.has-img img { filter: brightness(0) invert(1); }
.hd-koyu .search { justify-self: center; width: 100%; max-width: 620px; }
.hd-koyu .search-box { height: 44px; gap: 10px; padding: 0 16px; border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .1); color: #fff; }
.hd-koyu .search-box:focus-within { border-color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .15); }
.hd-koyu .search-box input::placeholder { color: rgba(255, 255, 255, .62); }
.hd-koyu .search-box .hd-sicon { color: rgba(255, 255, 255, .75); }
.hd-koyu .search-box input::-webkit-search-cancel-button { filter: invert(1); }
.hd-koyu .search-pop { color: var(--text); }
.hd-koyu .actions { gap: 18px; }
.hd-koyu .act, .hd-koyu .menu-btn { color: #fff; }
.hd-koyu .act:hover { color: #fff; opacity: .72; }
.hd-koyu .act > span:not(.act-ic) { color: rgba(255, 255, 255, .86); }
.hd-koyu .badge-count { border-color: var(--brand); }
.hd-koyu .nav { border-top: 0; background: #fff; }
/* Açık marka rengi: bantta koyu yazı */
.hd-koyu.is-light .hd-band { color: var(--text); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .06); }
.hd-koyu.is-light .logo, .hd-koyu.is-light .act, .hd-koyu.is-light .menu-btn, .hd-koyu.is-light .search-box, .hd-koyu.is-light .act > span:not(.act-ic) { color: var(--text); }
.hd-koyu.is-light .logo.has-img img { filter: none; }
.hd-koyu.is-light .search-box { border-color: rgba(0, 0, 0, .14); background: rgba(255, 255, 255, .7); }
.hd-koyu.is-light .search-box input::placeholder { color: var(--muted); }
.hd-koyu.is-light .search-box .hd-sicon { color: var(--muted); }
.hd-koyu.is-light .search-box input::-webkit-search-cancel-button { filter: none; }

/* ==========================================================================
   5 · Kategori Düğmeli — logo, "Kategoriler" düğmesi, geniş arama, ikonlar (pazaryeri)
   Düğme ana menüyü (.nav, mega menüsüyle birlikte) açılır liste olarak gösterir: üzerine gelme ya da tıklama (odak)
   ========================================================================== */
.hd-kategori .hd-bar { grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "logo cats search actions"; gap: 18px; height: 84px; }
.hd-kategori .logo { margin-right: 14px; font-size: 26px; }
.hd-kategori .hd-cats { grid-area: cats; position: relative; }
.hd-kategori .hd-catbtn { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px 0 16px; border-radius: var(--radius); background: var(--brand); color: #fff; font-size: 14px; font-weight: 500; white-space: nowrap; transition: opacity .2s; }
.hd-kategori .hd-catbtn .icon { width: 20px; height: 20px; }
.hd-kategori .hd-catbtn .hd-chev { width: 15px; height: 15px; margin-left: 2px; stroke-width: 2; transition: transform .2s; }
.hd-kategori .hd-cats:hover .hd-chev, .hd-kategori .hd-cats:focus-within .hd-chev { transform: rotate(180deg); }
/* Açılır kategori listesi = ana menü; üstteki boşluk fareyi düğmeden listeye taşır */
.hd-kategori .nav { position: absolute; top: 100%; left: 0; z-index: 60; width: 272px; padding-top: 10px; border-top: 0; opacity: 0; visibility: hidden; transition: opacity .16s, visibility .16s; }
.hd-kategori .hd-cats:hover .nav, .hd-kategori .hd-cats:focus-within .nav { opacity: 1; visibility: visible; }
.hd-kategori .nav-list { display: block; max-width: none; height: auto; padding: 8px 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 18px 40px rgba(0, 0, 0, .12); }
.hd-kategori .nav-item { display: block; }
.hd-kategori .nav-link { justify-content: space-between; padding: 10px 18px; font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--text); }
[data-theme-id="demo3"] .hd-kategori .nav-link.is-red { margin: 0; height: auto; padding: 10px 18px; border-radius: 0; background: none; color: var(--red); }
.hd-kategori .nav-link::after { content: none; }
.hd-kategori .nav-link .icon { transform: rotate(-90deg); color: var(--muted); }
.hd-kategori .nav-item:hover > .nav-link, .hd-kategori .nav-item:focus-within > .nav-link { background: var(--soft); }
/* Alt kategoriler listenin sağında açılır */
.hd-kategori .mega { top: 10px; left: calc(100% - 1px); right: auto; width: min(760px, calc(100vw - 620px)); min-height: calc(100% - 10px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 40px rgba(0, 0, 0, .12); }
.hd-kategori .mega-inner { display: flex; gap: 24px; max-width: none; padding: 22px 26px 24px; }
.hd-kategori .mega-col { flex: 0 1 180px; min-width: 0; }
.hd-kategori .mega-col:empty { display: none; }
.hd-kategori .mega-col a { padding: 4px 0; font-size: 13.5px; }
.hd-kategori .mega-img { flex: 0 0 180px; height: 240px; margin-left: auto; }
.hd-kategori .mega-img ~ .mega-img { display: none; }
.hd-kategori .search { grid-area: search; }
.hd-kategori .search-box { height: 46px; padding: 0 4px 0 18px; border-color: transparent; background: var(--soft); }
.hd-kategori .search-box:focus-within { border-color: var(--brand); background: #fff; }
.hd-kategori .search-box button { width: 40px; height: 38px; }
.hd-kategori .actions { gap: 22px; margin-left: 8px; }
.hd-kategori .act { flex-direction: row; gap: 9px; min-width: 0; font-size: 13.5px; font-weight: 500; }
.hd-kategori .act > span:not(.act-ic) { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-kategori .act-ic .badge-count { left: calc(100% - 13px); top: -9px; }
.hd-kategori .act-cart { height: 46px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.hd-kategori .act-cart:hover { border-color: var(--red); }

/* ==========================================================================
   Duyarlı
   ========================================================================== */
@media (max-width: 1280px) {
  .hd-arama .hd-bar, .hd-koyu .hd-bar { gap: 32px; }
  .hd-arama .actions { gap: 20px; }
  .hd-kategori .hd-bar { gap: 14px; }
  .hd-kategori .actions { gap: 16px; margin-left: 4px; }
  .hd-kategori .act-account > span, .hd-kategori .act-fav > span:not(.act-ic) { display: none; }
  .hd-kategori .mega-img { display: none; }
  .hd-tek .hd-bar { gap: 14px; }
  .hd-tek .nav-link { padding: 0 9px; }
  .hd-tek .nav-link::after { left: 9px; right: 9px; }
}
@media (max-width: 1200px) {
  .hd-tek .nav-link { padding: 0 7px; }
  .hd-tek .nav-link::after { left: 7px; right: 7px; }
}

/* Tablet ve telefon: menü düğmesi + ortada logo + ikonlar; arama altta tam genişlik (Tek Satır'da büyüteç) */
@media (max-width: 1024px) {
  .hd .hd-bar { grid-template-columns: 1fr auto 1fr; grid-template-areas: "menu logo actions" "search search search"; gap: 8px 10px; height: auto; padding-block: 10px 12px; }
  .hd .logo, .hd-ortali .logo, [data-theme-id="demo3"] .hd-ortali .logo { justify-self: center; margin: 0; font-size: 22px; }
  .hd .logo:not(.has-img) { padding-left: var(--hd-logo-ls); }
  [data-theme-id="demo3"] .hd .logo { padding-left: 0; font-size: 24px; }
  .hd .search { justify-self: stretch; width: auto; max-width: none; }
  .hd .search-box { height: 42px; }
  .hd .search-pop { right: 0; width: auto; }
  .hd .actions { gap: 0; margin: 0 -8px 0 0; }
  .hd .actions .act { flex-direction: column; justify-content: center; width: 42px; min-width: 0; height: 44px; padding: 0; border: 0; }
  .hd .act > span:not(.act-ic) { display: none; }
  .hd .act .icon { width: 24px; height: 24px; }
  .hd .act-ic .badge-count { left: calc(100% - 9px); top: -8px; }

  .hd-arama .search-box { height: 44px; }
  .hd-arama .search-box button { width: 34px; height: 34px; }

  .hd-tek .hd-bar { display: grid; grid-template-areas: "menu logo actions"; }
  .hd-tek .search { grid-area: menu; justify-self: start; margin-left: 34px; }
  .hd-tek .hd-sbtn { width: 42px; height: 44px; }
  .hd-tek .hd-sdrop-in { padding-block: 12px 14px; }
  .hd-tek .search-box { height: 46px; }
  .hd-tek .search-box input { font-size: 16px; }
  .hd-tek .search-pop { max-height: calc(100vh - 220px); }

  .hd-koyu .hd-bar { gap: 8px 10px; }
  .hd-koyu .search-box { height: 42px; }
  .hd-koyu .menu-btn:active { background: rgba(255, 255, 255, .12); }
  .hd-koyu .act:hover { opacity: 1; }

  .hd-kategori .hd-cats { display: none; }
  .hd-kategori .search-box { padding-left: 16px; }
}

@media (max-width: 640px) {
  .hd .search-box input { font-size: 16px; } /* iOS odakta yakınlaştırmasın */
  .hd-ortali .search-box { padding-inline: 14px; }
  .hd-kategori .search-box { padding-inline: 14px 4px; }
}
