/* Navbar iyilestirmeleri (nav-enhance.js ile birlikte). styles.css'ten SONRA yuklenir.
   Kirilma noktalari: >1100 tam menu | 821-1100 tablet (hamburger, arama satir icinde) | <=820 telefon (iki satir). */

/* ---- Bulunulan sayfa ---- */
.nav-menu a.is-active,
.nav-menu a[aria-current="page"] { color: var(--navy-900); }
.nav-menu a.is-active::after,
.nav-menu a[aria-current="page"]::after { transform: scaleX(1); }
.hero-header .nav-menu a.is-active,
.hero-header .nav-menu a[aria-current="page"] { color: #fff; }

/* ---- Urunler: chevron + kategori menusu (masaustu) ---- */
.nav-row { display: contents; }
.nav-chevron { width: 14px; height: 14px; margin-inline-start: 5px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.nav-has-mega.is-mega-open .nav-chevron { transform: rotate(180deg); }
.nav-has-mega.is-mega-open::after { transform: scaleX(1); }

.nav-mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  color: var(--ink);
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 40px rgba(7, 29, 54, .16);
}
.nav-mega[hidden] { display: none; }
.nav-mega-inner { padding: 20px 0 16px; }
.nav-mega-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 18px; }
.nav-mega-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; color: var(--ink); transition: background-color .15s ease; }
.nav-mega-item:hover, .nav-mega-item:focus-visible { background: #eef5f8; }
.nav-mega-thumb { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; background: #eef3f6; }
.nav-mega-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nav-mega-text { min-width: 0; display: grid; gap: 2px; }
.nav-mega-text strong { font-size: 14.5px; font-weight: 800; line-height: 1.25; color: var(--navy-900); }
.nav-mega-text small { color: #5d7084; font-size: 12px; font-weight: 600; }
.nav-mega-all { margin-top: 10px; padding: 12px 10px 0; border-top: 1px solid #edf1f4; display: flex; align-items: center; gap: 8px; color: var(--teal-600); font-size: 14px; font-weight: 800; }
.nav-mega-all svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.nav-mega-all:hover svg { transform: translateX(3px); }
[dir="rtl"] .nav-mega-all svg { transform: scaleX(-1); }
[dir="rtl"] .nav-mega-all:hover svg { transform: scaleX(-1) translateX(3px); }

/* Cekmece ogeleri masaustunde yok */
.nav-cats-toggle, .nav-drawer-cats, .nav-drawer-actions, .nav-backdrop { display: none; }

/* ---- Arama onerileri ---- */
.nav-search { position: relative; }
.nav-suggest {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  z-index: 70;
  width: max(100%, 360px);
  max-height: min(70vh, 430px);
  overflow-y: auto;
  padding: 6px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d5dee6;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(7, 29, 54, .2);
  text-align: start;
}
.nav-suggest[hidden] { display: none; }
/* .nav-menu a (padding 27px, altcizgi, beyaz renk) masaustu aramasini da kapsiyor; .site-header oneki o kurallari ezer */
.site-header .nav-suggest .nav-suggest-row { position: static; display: flex; align-items: center; gap: 12px; min-height: 0; padding: 7px 8px; border: 0; border-radius: 8px; color: var(--ink); font-size: 14px; font-weight: 400; text-shadow: none; white-space: normal; box-shadow: none; }
.site-header .nav-suggest .nav-suggest-row::after { display: none; }
.site-header .nav-suggest .nav-suggest-row:hover, .site-header .nav-suggest .nav-suggest-row.is-selected { background: #eef5f8; color: var(--ink); }
.nav-suggest-thumb { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 6px; overflow: hidden; background: #eef3f6; }
.nav-suggest-row.is-category .nav-suggest-thumb { border-radius: 50%; }
.nav-suggest-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nav-suggest-text { min-width: 0; display: grid; gap: 1px; }
.nav-suggest-text strong { overflow: hidden; color: var(--navy-900); font-size: 13.5px; font-weight: 800; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.nav-suggest-text small { color: #5d7084; font-size: 11.5px; font-weight: 600; }
.site-header .nav-suggest .nav-suggest-row.is-all { margin-top: 4px; border-top: 1px solid #edf1f4; border-radius: 0 0 8px 8px; padding-top: 11px; color: var(--teal-600); }
.nav-suggest-row.is-all svg { width: 18px; height: 18px; margin: 0 11px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.nav-suggest-row.is-all strong { color: var(--teal-600); white-space: normal; }
.nav-suggest-empty { padding: 12px 10px; color: #5d7084; font-size: 13px; }

/* ---- Teklif Al: 1100px altinda yazisiz WhatsApp dugmesi (yalniz TR; yabanci dilde dugme bilerek gizli) ---- */
@media (max-width: 1100px) {
  html[lang] .nav-offer { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; min-height: 44px; padding: 0; gap: 0; font-size: 0; }
  html[lang] .nav-offer .whatsapp-icon { width: 22px; height: 22px; }
}

/* ---- Cekmece (<=1100px): hamburger, Teklif Al ikon, Hemen Ara ---- */
@media (max-width: 1100px) {
  .nav-mega { display: none; }
  .nav-chevron { display: none; }

  .nav-menu { overflow-y: auto; overscroll-behavior: contain; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); }
  .nav-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px; align-items: stretch; border-bottom: 1px solid #edf1f4; }
  .nav-row > a { border-bottom: 0 !important; }
  .nav-cats-toggle { display: grid; place-items: center; padding: 0; border: 0; border-inline-start: 1px solid #edf1f4; background: transparent; color: inherit; cursor: pointer; }
  .nav-cats-toggle .nav-chevron { display: block; width: 18px; height: 18px; margin: 0; }
  .nav-cats-toggle.is-open .nav-chevron { transform: rotate(180deg); }
  .nav-drawer-cats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 10px; padding: 6px 4px 12px; }
  .nav-drawer-cats[hidden] { display: none; }
  .nav-menu .nav-drawer-cats a { display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 8px; font-size: 14px; font-weight: 700; white-space: normal; line-height: 1.25; }
  .nav-drawer-thumb { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; background: #eef3f6; }
  .nav-drawer-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

  .nav-drawer-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 4px 0 12px; }
  .nav-menu .nav-drawer-actions a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 12px; border: 1px solid var(--navy-800); border-radius: 8px; font-size: 14.5px; font-weight: 800; }
  .nav-menu .nav-drawer-actions a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .nav-menu .nav-drawer-actions .nav-drawer-offer { color: #fff; border-color: var(--teal-600); background: var(--teal-600); }

  .nav-menu a { display: flex; align-items: center; min-height: 48px; }
  .nav-menu a.is-active, .nav-menu a[aria-current="page"] { color: var(--teal-600); box-shadow: inset 3px 0 0 var(--teal-600); }
  [dir="rtl"] .nav-menu a.is-active, [dir="rtl"] .nav-menu a[aria-current="page"] { box-shadow: inset -3px 0 0 var(--teal-600); }
  .hero-header .nav-menu a.is-active, .hero-header .nav-menu a[aria-current="page"] { color: var(--yellow-500); box-shadow: inset 3px 0 0 var(--yellow-500); }
  .hero-header .nav-row, .hero-header .nav-cats-toggle { border-color: rgba(255, 255, 255, .12); }
  .hero-header .nav-cats-toggle { color: #fff; }
  .hero-header .nav-menu .nav-drawer-actions a { color: #fff; border-color: rgba(255, 255, 255, .5); }
  .hero-header .nav-menu .nav-drawer-actions .nav-drawer-offer { border-color: var(--teal-600); }

  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(6, 21, 40, .5); }
  .nav-backdrop[hidden] { display: none; }
}

/* ---- Tablet (821-1100px): tek satir, arama satir icinde, menu cekmecede ---- */
@media (min-width: 821px) and (max-width: 1100px) {
  .nav, .hero-header .nav { gap: 14px; }
  .menu-button { display: inline-grid; }
  .nav-search-mobile { display: flex; order: 1; flex: 0 1 300px; width: auto; min-width: 150px; height: 42px; margin: 0 0 0 auto; padding-left: 12px; }
  .nav-search-mobile > svg { display: block; width: 17px; height: 17px; }
  .nav-search-mobile input { font-size: 14px; }
  .nav-search-mobile button { width: 40px; height: 40px; flex: 0 0 auto; }
  .nav-actions { order: 2; gap: 8px; }
  .nav-actions .cart-button { width: 44px; min-width: 44px; padding: 0; }
  .nav-actions .cart-button-label { display: none; }
  .nav-actions .cart-button .cart-count { position: absolute; top: -7px; right: -7px; }
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 10px max(24px, calc((100vw - 1240px) / 2)) 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu .nav-search { display: none; }
  .nav-menu a { padding: 12px; border-bottom: 1px solid #edf1f4; }
  .nav-menu a::after { display: none; }
  .hero-header .nav-menu { background: rgba(6, 21, 40, .97); border-color: rgba(255, 255, 255, .14); box-shadow: 0 20px 45px rgba(4, 18, 34, .3); backdrop-filter: blur(16px); }
  .hero-header .nav-menu a { color: #fff; border-color: rgba(255, 255, 255, .12); text-shadow: none; }
  .nav-drawer-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- Telefon (<=820px) ----
   Basliktaki yazisiz Teklif Al dugmesi yalniz tablette (821-1199px): telefonda 5 dugme + logo siginca logoyu eziyor,
   zaten ekranda sabit WhatsApp dugmesi var; Teklif Al + Hemen Ara cekmecenin en ustunde. */
@media (max-width: 820px) {
  html[lang] .nav-offer { display: none; }
  .nav-menu { max-height: calc(100dvh - var(--mobile-nav-h) - 12px); }
}

/* ---- Masaustu (>1100px): yatay linkler yok, sagdaki 3 cizgili dugme kucuk kutu acar ---- */
.nav-pop { display: none; }
@media (min-width: 1101px) {
  .nav-menu > a, .nav-menu > .nav-row { display: none; }
  .nav-mega { display: none; }
  .menu-button { display: inline-grid; }
  html[lang] .nav-offer { display: inline-flex; }
  .nav-pop {
    display: block;
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-end: max(20px, calc((100vw - 1240px) / 2));
    z-index: 70;
    width: 280px;
    padding: 8px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(7, 29, 54, .2);
  }
  .nav-pop[hidden] { display: none; }
  .nav-pop-links { display: grid; }
  .nav-pop-links a { display: flex; align-items: center; min-height: 46px; padding: 0 14px; border-radius: 8px; color: #30465d; font-size: 15px; font-weight: 700; transition: background-color .15s ease, color .15s ease; }
  .nav-pop-links a:hover, .nav-pop-links a:focus-visible { background: #eef5f8; color: var(--navy-900); }
  .nav-pop-links a.is-active, .nav-pop-links a[aria-current="page"] { color: var(--teal-600); box-shadow: inset 3px 0 0 var(--teal-600); }
  [dir="rtl"] .nav-pop-links a.is-active, [dir="rtl"] .nav-pop-links a[aria-current="page"] { box-shadow: inset -3px 0 0 var(--teal-600); }
  .nav-pop-contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; padding: 10px 6px 4px; border-top: 1px solid #edf1f4; }
  .nav-pop-contact a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 8px; border: 1px solid var(--navy-800); border-radius: 8px; color: var(--navy-900); font-size: 13.5px; font-weight: 800; white-space: nowrap; }
  .nav-pop-contact a svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .nav-pop-contact .nav-pop-offer { color: #fff; border-color: var(--teal-600); background: var(--teal-600); }
  .nav-pop-contact .nav-pop-offer .whatsapp-icon { width: 17px; height: 17px; }

  /* Dil secimi kutuda; basliktaki dil dugmesi masaustunde gizli */
  .nav-actions .language-switcher { display: none; }
  .nav-pop-lang { margin-top: 6px; padding-top: 6px; border-top: 1px solid #edf1f4; }
  .nav-pop-lang-toggle { width: 100%; min-height: 46px; padding: 0 14px; border: 0; border-radius: 8px; display: flex; align-items: center; gap: 10px; color: #30465d; background: transparent; font: inherit; font-size: 15px; font-weight: 700; text-align: start; cursor: pointer; transition: background-color .15s ease; }
  .nav-pop-lang-toggle:hover, .nav-pop-lang-toggle:focus-visible { background: #eef5f8; color: var(--navy-900); }
  .nav-pop-lang-toggle > svg:first-child { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .nav-pop-lang-current { margin-inline-start: auto; color: #5d7084; font-size: 13.5px; font-weight: 600; }
  .nav-pop-lang-toggle .nav-chevron { display: block; width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
  .nav-pop-lang-toggle[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
  /* Menu sabit kalir; yalniz dil listesi ekrana sigmazsa kendi icinde kayar */
  .nav-pop-lang-list { display: grid; align-content: start; max-height: clamp(72px, calc(100vh - 520px), 360px); max-height: clamp(72px, calc(100dvh - 520px), 360px); padding: 2px 0 4px; overflow-y: auto; overscroll-behavior: contain; }
  .nav-pop-lang-list[hidden] { display: none; }
  .nav-pop-lang-list a { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 14px 0 42px; border-radius: 8px; color: #30465d; font-size: 14.5px; font-weight: 600; transition: background-color .15s ease; }
  [dir="rtl"] .nav-pop-lang-list a { padding: 0 42px 0 14px; }
  .nav-pop-lang-list a:hover, .nav-pop-lang-list a:focus-visible { background: #eef5f8; color: var(--navy-900); }
  .nav-pop-lang-list a.is-active { color: var(--teal-600); font-weight: 800; }
  .nav-pop-lang-list a.is-active::after { content: ""; width: 7px; height: 12px; margin-inline-end: 2px; border: solid var(--teal-600); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
}

/* ---- Sepet dugmesi: yalniz ikon (her genislikte) ---- */
.site-header .cart-button { width: 44px; min-width: 44px; padding: 0; }
.site-header .cart-button .cart-button-label { display: none; }
.site-header .cart-button .cart-count { position: absolute; top: -7px; right: -7px; }
[dir="rtl"] .site-header .cart-button .cart-count { right: auto; left: -7px; }

/* ---- Favori ve hesap dugmesi: ustune gelince logodaki "MED" mavisi (#00b0f4, logodan olculdu) ---- */
.site-header .favorite-header-button:hover,
.site-header .favorite-header-button:focus-visible {
  color: #00b0f4;
  border-color: #00b0f4;
  background: #eaf8fe;
}

/* ---- Masaustu: arama cubugu genis, logo ile sag taraftaki dugmelerin tam ortasinda ---- */
@media (min-width: 1101px) {
  .site-header .nav-menu { flex: 1 1 0; min-width: 0; margin: 0; justify-content: center; }
  .site-header .nav-menu .nav-search { width: min(100%, 480px); }
}

/* ---- Ust serit: yukari kayan uc bant (masaustu + telefon) ---- */
.topbar { position: relative; }
.topbar-stage { position: relative; height: 38px; overflow: hidden; }
.topbar-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  transform: translateY(100%);
  transition: transform .65s cubic-bezier(.65, 0, .35, 1);
}
.topbar-slide.is-active { transform: translateY(0); }
.topbar-slide.is-leaving { transform: translateY(-100%); }
.topbar-slide.is-reset { transition: none; }
.topbar-slide > .topbar-inner { width: min(calc(100% - 40px), var(--container)); }
.topbar-slide.is-info { color: #d9e7f4; background: var(--navy-950); }
.topbar-slide.is-welcome { color: var(--navy-950); background: var(--yellow-500); } /* "Urunleri Incele" butonunun rengi */
.topbar-slide.is-shipping { color: #fff; background: var(--teal-600); }
.topbar-center { justify-content: center; gap: 9px; font-size: 13.5px; font-weight: 700; letter-spacing: .02em; }
.topbar-center svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .topbar-slide { transition: none; } }

/* "Hos geldiniz" bandi: yazi tekrar eder, serit boydan boya dolar (tasan kisim iki yandan simetrik kirpilir) */
/* "Hos geldiniz" bandi: yazilar ve aralarindaki noktalar seridi boydan boya esit aralikla doldurur (adet JS'te seridin genisligine gore) */
.topbar-fill { width: 100%; height: 38px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; overflow: hidden; white-space: nowrap; font-size: 14px; font-weight: 800; letter-spacing: .05em; }
.topbar-fill span { flex: 0 0 auto; }
.topbar-fill i { flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: var(--navy-950); opacity: .6; }

/* Telefon: ayni uc bant; yazilar dar ekrana sigsin diye kucuk ve tek satir */
@media (max-width: 820px) {
  .topbar-slide > .topbar-inner { width: calc(100% - 24px); }
  .topbar-slide.is-info .topbar-inner { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; }
  .topbar-slide.is-info .topbar-inner > span { overflow: hidden; text-overflow: ellipsis; }
  .topbar-center { gap: 7px; font-size: 12.5px; letter-spacing: 0; white-space: nowrap; }
  .topbar-center svg { width: 15px; height: 15px; }
  .topbar-fill { padding: 0 14px; justify-content: center; gap: 11px; font-size: 12.5px; letter-spacing: .06em; }
  .topbar-fill i { width: 4px; height: 4px; }
}
