/* ==========================================================================
   Ceyhan teması — ocakbaşı menüsü
   Renkler: --ember ve --brass şablondan (yönetim panelindeki ana/ikincil
   renk) gelir; aşağıdaki değerler yalnızca yedektir.
   ========================================================================== */

:root {
  --ember: #c1440e;              /* $page->primaryColor */
  --brass: #d9a441;              /* $page->secondaryColor */
  --coal: #14100d;
  --coal-sheet: #17120e;
  --coal-slot: #241a14;
  --cream: #f5ead5;
  --cream-bright: #f7efdd;
  --cream-soft: rgba(245, 234, 213, 0.62);
  --cream-mute: rgba(245, 234, 213, 0.4);
  --hairline: rgba(217, 164, 65, 0.22);
  --hairline-strong: rgba(217, 164, 65, 0.55);
  --display: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: Karla, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--coal);
}

body {
  font-family: var(--sans);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

/* Çerçeveleme kararı — sözleşme §3.
   object-fit yapısal class'lara değil, yalnızca bu iki isme yazılır. */
.img-cover   { width: 100%; height: 100%; object-fit: cover; }
.img-contain { width: 100%; height: 100%; object-fit: contain; }

::selection { background: rgba(217, 164, 65, 0.32); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

/* --- sayfa gövdesi ------------------------------------------------------ */

.page {
  min-height: 100vh;
  background: var(--coal);
}

.sheet {
  position: relative;
  max-width: 760px;
  min-height: 100vh;
  margin: 0 auto;
  background-color: var(--coal-sheet);
  /* color-mix desteklenmiyorsa yalnızca doku kalır; ocak parıltısı aşağıdaki
     ikinci bildirimle eklenir ve desteklenmeyen tarayıcıda sessizce düşer. */
  background-image:
    repeating-conic-gradient(from 45deg at 0 0, rgba(217, 164, 65, 0.028) 0deg 90deg, rgba(0, 0, 0, 0) 90deg 180deg);
  background-size: 34px 34px;
  background-image:
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--ember) 22%, transparent) 0%, rgba(20, 16, 13, 0) 60%),
    repeating-conic-gradient(from 45deg at 0 0, rgba(217, 164, 65, 0.028) 0deg 90deg, rgba(0, 0, 0, 0) 90deg 180deg);
  background-size: auto, 34px 34px;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.6);
}

/* --- üst çubuk ---------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(20, 16, 13, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(217, 164, 65, 0.35);
}

.topbar__logo {
  flex: none;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--brass);
  border-radius: 50%;
}

.topbar__brand {
  margin-right: auto;
  min-width: 0;
}

.topbar__name {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream);
}

.topbar__kicker {
  display: block;
  margin-top: 6px;
  font-size: 9.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--brass);
}

/* --- dil değiştirici ---------------------------------------------------- */

.langs {
  display: flex;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
}

.langs__item {
  min-width: 46px;
  height: 38px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-decoration: none;
  color: var(--cream);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.langs__item + .langs__item { border-left: 1px solid rgba(217, 164, 65, 0.4); }
.langs__item:hover { background: rgba(217, 164, 65, 0.18); }

.langs__item.is-active {
  background: var(--brass);
  color: var(--coal);
}

/* --- hero --------------------------------------------------------------- */

.hero {
  padding: 46px 24px 40px;
  text-align: center;
}

.rule-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--brass);
}

.rule-text__line {
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.hero__title {
  margin: 22px 0 0;
  font-family: var(--display);
  font-weight: 600;
  /* --title-ch: marka adındaki en uzun kelimenin harf sayısı (şablondan).
     0.7em, bu serifin ortalama büyük harf genişliği + harf aralığıdır; punto
     kelime satıra sığacak şekilde kısılır, break-word yalnızca son çaredir. */
  font-size: clamp(34px, min(15vw, calc((100vw - 60px) / (var(--title-ch, 6) * 0.7))), 86px);
  line-height: 1.02;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream-bright);
  overflow-wrap: break-word;
}

.hero__title-accent {
  color: var(--brass);
  letter-spacing: 0.16em;
}

.hero__blurb {
  margin: 22px auto 0;
  max-width: 34ch;
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  line-height: 1.8;
  color: var(--cream-soft);
  text-wrap: pretty;
}

.hero__hint {
  margin: 26px 0 0;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cream-mute);
}

/* --- süsleme ------------------------------------------------------------ */

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 300px;
  margin: 26px auto 0;
  color: var(--brass);
}

.ornament__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor);
}

.ornament__line:last-child {
  background: linear-gradient(90deg, currentColor, transparent);
}

.ornament__mark {
  font-size: 13px;
  opacity: 0.9;
}

/* --- kategoriler -------------------------------------------------------- */

.category {
  border-top: 1px solid var(--hairline);
  overflow: hidden; /* .items'ın -1px sağ payını kırpar */
}

.category__banner {
  position: relative;
  display: block;
  padding: 62px 18px 16px;
  cursor: default;
  list-style: none;
  background:
    linear-gradient(180deg, rgba(20, 16, 13, 0.2) 0%, rgba(20, 16, 13, 0.85) 100%),
    var(--coal-slot);
  background:
    radial-gradient(90% 120% at 12% 110%, color-mix(in srgb, var(--ember) 30%, transparent) 0%, rgba(20, 16, 13, 0) 62%),
    linear-gradient(180deg, rgba(20, 16, 13, 0.2) 0%, rgba(20, 16, 13, 0.85) 100%),
    var(--coal-slot);
}

.has-js .category__banner { cursor: pointer; }

.category__banner::-webkit-details-marker { display: none; }
.category__banner::marker { content: ''; }

/* pirinç köşe çizgileri — fotoğrafın yerini tutan tek grafik unsur */
.category__banner::before {
  content: '';
  position: absolute;
  inset: 14px 14px auto auto;
  width: 46px;
  height: 46px;
  border-top: 1px solid var(--hairline-strong);
  border-right: 1px solid var(--hairline-strong);
  opacity: 0.7;
  pointer-events: none;
}

.category__meta {
  display: block;
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--brass);
}

.category__name {
  display: block;
  margin-top: 6px;
  padding-right: 56px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(28px, 8vw, 42px);
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-bright);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
  text-wrap: balance;
}

.category__chevron {
  position: absolute;
  right: 18px;
  bottom: 16px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--brass);
  border-radius: 50%;
  background: rgba(20, 16, 13, 0.6);
  color: var(--brass);
  font-size: 11px;
  line-height: 1;
}

.category__chevron::before {
  content: '\25BC';
  display: block;
  line-height: 1;
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.category__box[open] .category__chevron::before { transform: rotate(180deg); }
.category__box[open] .category__chevron { background: rgba(217, 164, 65, 0.14); }

.category__chevron { transition: background-color 0.32s ease; }
.category__banner:hover .category__chevron { background: rgba(217, 164, 65, 0.18); }

/* --- ürün listesi ------------------------------------------------------- */

/* Açılırken ürünler sırayla belirir. Animasyon <details> her açıldığında
   yeniden çalışır; yükseklik geçişini menu.js yürütür. */
@keyframes item-in {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* fill: backwards — gecikme boyunca başlangıç durumunu uygular, bittiğinde
   elementi normal stiline bırakır. both olsaydı biten animasyon birim
   transform'u üzerinde tutup gereksiz bir bileşik katman bırakırdı. */
/* Toplam süre panelin açılma süresini (menu.js: 320ms) aşmasın; aşarsa
   panel durduktan sonra devam eden ikinci bir hareket gibi görünür. */
.has-js .category__box[open] .item {
  animation: item-in 0.26s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
}

.has-js .category__box[open] .items > li:nth-child(1) .item { animation-delay: 0s; }
.has-js .category__box[open] .items > li:nth-child(2) .item { animation-delay: 0.02s; }
.has-js .category__box[open] .items > li:nth-child(3) .item { animation-delay: 0.04s; }
.has-js .category__box[open] .items > li:nth-child(4) .item { animation-delay: 0.05s; }
.has-js .category__box[open] .items > li:nth-child(n + 5) .item { animation-delay: 0.06s; }

/* Kapanış animasyonu sürerken satırların yeniden belirmesini engelle. */
.category__box.is-animating:not([open]) .item { animation: none; }

.items {
  display: grid;
  /* min(...) olmadan 330px'den dar ekranlarda sütun taşar. */
  grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
  margin: 0 -1px 0 0; /* son sütunun dikey ayracı .category ile kırpılır */
  padding: 0;
  list-style: none;
  background: rgba(10, 8, 6, 0.35);
  /* Açılma animasyonu bu kutunun yüksekliğini değiştiriyor. Varsayılan
     align-content (normal = stretch) fazla yüksekliği satırlara dağıtır ve
     animasyonun son karesinde hücreler gerilip sonra doğal boyuta sıçrar.
     start ile satırlar her karede doğal yüksekliğinde kalır. */
  align-content: start;
}

/* Grid hücresi satırın en uzun ürünü kadar yükselir; düğme de hücreyi
   baştan sona doldursun ki iki sütunun alt çizgileri aynı hizada bitsin. */
.items > li { display: grid; }

.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  width: 100%;
  height: 100%;
  padding: 20px 18px;
  border: 0;
  border-right: 1px solid rgba(217, 164, 65, 0.16);
  border-bottom: 1px solid rgba(217, 164, 65, 0.16);
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: default;
  transition: background-color 0.18s ease;
}

.has-js .item { cursor: pointer; }
.has-js .item:hover { background: rgba(217, 164, 65, 0.07); }

.item__text {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  align-self: stretch;
}

.item__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--cream-bright);
  text-wrap: pretty;
}

.item__desc {
  font-size: 13px;
  line-height: 1.65;
  color: rgba(245, 234, 213, 0.55);
  text-wrap: pretty;
}

.item__price {
  margin-top: auto;
  padding-top: 3px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: 0.03em;
  color: var(--brass);
}

.item__thumb {
  display: block;
  flex: none;
  width: 98px;
  height: 98px;
  overflow: hidden;
  border: 1px solid rgba(217, 164, 65, 0.3);
  border-radius: 4px;
  background: var(--coal-slot);
}

/* --- boş menü ----------------------------------------------------------- */

.empty {
  padding: 30px 24px 60px;
  text-align: center;
  border-top: 1px solid var(--hairline);
}

.empty__text {
  margin: 22px auto 0;
  max-width: 32ch;
  font-family: var(--display);
  font-style: italic;
  font-size: 19px;
  line-height: 1.7;
  color: var(--cream-soft);
  text-wrap: pretty;
}

/* --- alt bilgi ---------------------------------------------------------- */

.footer {
  padding: 40px 24px 70px;
  text-align: center;
  border-top: 1px solid var(--hairline);
}

.footer__mark { margin: 0; color: var(--brass); font-size: 13px; }

.footer__name {
  margin: 14px 0 0;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cream-bright);
}

.footer__lines {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.9;
  color: rgba(245, 234, 213, 0.5);
  white-space: pre-line;
}

.footer__vat {
  margin: 10px 0 0;
  font-size: 11px;
  color: rgba(245, 234, 213, 0.32);
}

/* --- ürün detayı (alttan açılan panel) ---------------------------------- */

.detail {
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  margin: auto auto 0;
  padding: 0;
  overflow: auto;
  border: 0;
  border-top: 2px solid var(--brass);
  background: var(--coal-sheet);
  color: var(--cream);
}

.detail::backdrop { background: rgba(10, 7, 5, 0.88); }

.detail[open] { animation: detail-rise 0.22s ease-out; }

@keyframes detail-rise {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .detail[open] { animation: none; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

.detail__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 20px;
  background: rgba(23, 18, 14, 0.96);
  border-bottom: 1px solid rgba(217, 164, 65, 0.25);
}

.detail__cat {
  margin-right: auto;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass);
}

.detail__close {
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid rgba(217, 164, 65, 0.5);
  border-radius: 50%;
  background: transparent;
  color: var(--cream);
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.detail__close:hover { background: rgba(217, 164, 65, 0.18); }

.detail__photo {
  height: 44vh;
  background: var(--coal-slot);
  border-bottom: 1px solid rgba(217, 164, 65, 0.25);
}

.detail__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 22px 40px;
  text-align: center;
}

.detail__name {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(28px, 8vw, 40px);
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cream-bright);
  text-wrap: pretty;
}

.detail__body .ornament { max-width: 260px; margin: 0 auto; }

.detail__desc {
  margin: 0;
  max-width: 42ch;
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  line-height: 1.7;
  color: rgba(245, 234, 213, 0.66);
  text-wrap: pretty;
}

.detail__price-label {
  margin: 6px 0 0;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cream-mute);
}

.detail__price {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: 0.04em;
  color: var(--brass);
}

/* --- dar ekran ---------------------------------------------------------- */

@media (max-width: 380px) {
  .topbar { padding: 10px 14px; }
  .topbar__name { font-size: 18px; letter-spacing: 0.18em; }
  .item { padding: 18px 14px; gap: 12px; }
  .item__thumb { width: 84px; height: 84px; }
}
