/* ==========================================================================
   Toptan gıda kataloğu — müşteri tarafı
   ========================================================================== */

:root {
  --paper: #f3eee3;
  --paper-2: #e9e2d2;
  --card: #fbf9f4;
  --ink: #1e1c17;
  --ink-2: #4a463d;
  --muted: #7b7467;
  --line: #dcd3c1;
  --line-2: #cbc0aa;
  --brick: #a3412a;
  --brick-d: #86321f;
  --olive: #34472c;
  --olive-l: #e2e8d6;
  --wa: #1f7a4d;

  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1240px;
  --r: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { width: 18px; height: 18px; flex: none; }

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

/* ---------- Duyuru ---------- */
.notice {
  background: var(--brick);
  color: #fff7ef;
  font-size: 13.5px;
  padding: 8px 0;
  text-align: center;
}

/* ---------- Başlık ---------- */
.mast { border-bottom: 1px solid var(--ink); position: relative; }
.mast::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
  border-bottom: 1px solid var(--ink);
}
.mast-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding-top: 30px; padding-bottom: 20px;
}
.brand { text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.brand-name {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.mast-contact { display: flex; gap: 22px; align-items: center; }
.mast-contact a {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; font-weight: 500; font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
.mast-contact a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.mast-contact .wa { color: var(--wa); }

/* ---------- Cari şeridi ---------- */
.cari-bar {
  margin-top: 4px;
  background: var(--ink);
  color: #f1ebdf;
}
.cari-bar.is-in { background: var(--olive); }
.cari-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 64px; padding-top: 12px; padding-bottom: 12px;
}
.cari-lead, .cari-who { display: flex; align-items: center; gap: 12px; font-size: 14.5px; }
.cari-lead strong, .cari-who strong { color: #fff; font-weight: 600; }
.cari-lead .i { opacity: .7; }
.cari-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #b9d48f; flex: none;
  box-shadow: 0 0 0 4px rgba(185, 212, 143, .18);
}
.cari-form { display: flex; gap: 0; flex: 0 1 430px; }
.cari-form input {
  flex: 1; min-width: 0;
  height: 42px; padding: 0 14px;
  background: #fbf8f1; color: var(--ink);
  border: 0; border-radius: var(--r) 0 0 var(--r);
}
.cari-form input::placeholder { color: #8f8879; }
.cari-form button {
  height: 42px; padding: 0 18px;
  background: var(--brick); color: #fff; border: 0; cursor: pointer;
  border-radius: 0 var(--r) var(--r) 0; font-weight: 600; white-space: nowrap;
  transition: background .15s;
}
.cari-form button:hover { background: var(--brick-d); }
.link-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px solid rgba(255,255,255,.28); color: #fff;
  height: 36px; padding: 0 14px; border-radius: var(--r); cursor: pointer; font-size: 14px;
}
.link-btn:hover { border-color: #fff; }

.flash { margin-top: 16px; padding: 12px 16px; border-radius: var(--r); font-size: 14.5px; border: 1px solid; }
.flash-error { background: #f6e3dc; border-color: #e3bba9; color: #7a2a17; }
.flash-ok { background: var(--olive-l); border-color: #c4cfb0; color: var(--olive); }

/* ---------- Katalog yerleşimi ---------- */
.shop {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 48px;
  padding-top: 40px; padding-bottom: 72px;
}

.cats { position: sticky; top: 20px; align-self: start; }
.cats-h {
  font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  padding-bottom: 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px;
}
.cats-list { display: flex; flex-direction: column; }
.cats-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 8px 0 8px 14px; margin-left: -14px;
  text-decoration: none; color: var(--ink-2);
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.cats-list a:hover { color: var(--ink); }
.cats-list a.on { color: var(--ink); font-weight: 600; border-left-color: var(--brick); }
.cats-list .n { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 400; }

/* Raf başlığı */
.shelf-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 32px; flex-wrap: wrap;
  padding-bottom: 22px; border-bottom: 1px solid var(--line-2);
}
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { color: var(--ink); }
.shelf-title h1 { font-family: var(--serif); font-size: clamp(30px, 3.6vw, 42px); line-height: 1.05; letter-spacing: -0.01em; }
.lede { color: var(--ink-2); margin-top: 8px; max-width: 52ch; }

.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tool-row { display: flex; gap: 10px; align-items: center; }
.search { position: relative; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 280px; height: 40px; padding: 0 12px 0 38px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r);
}
.search input:focus { outline: none; border-color: var(--ink); }
.tools select {
  height: 40px; padding: 0 34px 0 12px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237b7467' stroke-width='1.6'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--line-2); border-radius: var(--r);
  appearance: none; cursor: pointer;
}
.view-switch { display: flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.view-switch button, .icon-btn {
  width: 40px; height: 38px; display: grid; place-items: center;
  background: var(--card); border: 0; cursor: pointer; color: var(--muted);
}
.view-switch button + button { border-left: 1px solid var(--line-2); }
.view-switch button.on { background: var(--ink); color: var(--paper); }
.icon-btn { height: 40px; border: 1px solid var(--line-2); border-radius: var(--r); }
.view-switch button:hover:not(.on), .icon-btn:hover { color: var(--ink); }

.result-count { margin: 16px 0 6px; font-size: 13.5px; color: var(--muted); }
.result-count a { color: var(--ink); }

.print-head { display: none; }

/* Gruplar (raflar) */
.group { margin-top: 30px; }
.group-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 16px;
}
.group-head h2 {
  font-family: var(--serif); font-size: 24px; line-height: 1.15;
  display: flex; align-items: baseline; gap: 14px; flex: 1;
}
.group-head h2::after { content: ""; flex: 1; border-bottom: 1px dotted var(--line-2); transform: translateY(-5px); }
.group-n { font-size: 13px; color: var(--muted); white-space: nowrap; text-decoration: none; }
a.group-n:hover { color: var(--ink); }

/* ---------- Ürün kartları ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
  gap: 16px;
}
.card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color .18s, transform .18s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card[hidden] { display: none; }

.card-media {
  position: relative; display: block; aspect-ratio: 4 / 3;
  background: #fff; border-bottom: 1px solid var(--line);
}
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.card.is-out .card-media img, .card.is-out .ph { filter: grayscale(1); opacity: .55; }

.tag {
  position: absolute; top: 10px; left: 10px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: var(--ink); color: var(--paper);
  padding: 4px 8px; border-radius: 3px;
}
.tag-out { background: var(--brick); color: #fff; }

/* Görselsiz ürün yer tutucusu */
.ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 14px 16px;
  background: var(--tone, #e6d8bf);
  color: var(--tone-ink, #6b5530);
  overflow: hidden;
}
.ph::before {
  content: ""; position: absolute; inset: 8px;
  border: 1px solid currentColor; opacity: .18; border-radius: 3px; pointer-events: none;
}
.ph-mono {
  font-family: var(--serif);
  font-size: 58px; line-height: 1; letter-spacing: -0.02em;
  align-self: flex-end; opacity: .9;
}
.ph-cat { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; opacity: .75; }
.ph.t1 { --tone: #eadcc0; --tone-ink: #73592b; }
.ph.t2 { --tone: #dbe1cb; --tone-ink: #485a32; }
.ph.t3 { --tone: #edd6c7; --tone-ink: #8a4129; }
.ph.t4 { --tone: #d8dfe0; --tone-ink: #3f5559; }
.ph.t5 { --tone: #ece1b8; --tone-ink: #7a6018; }
.ph.t6 { --tone: #e0d5dd; --tone-ink: #66445a; }

.card-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 14px; }
.card-meta {
  display: flex; gap: 10px; min-height: 16px;
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.code { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.card-name { font-size: 16px; font-weight: 600; line-height: 1.3; margin-top: 4px; }
.card-name a { text-decoration: none; }
.card-name a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.card-pack { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.card-price {
  margin-top: auto; padding-top: 12px;
  display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap;
  border-top: 1px dashed var(--line); margin-top: 14px;
}
.amt { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.cur { font-size: 13px; font-weight: 600; }
.per { font-size: 13px; color: var(--muted); margin-left: 2px; }
.locked {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 500; color: var(--brick); text-decoration: none;
}
.locked .i { width: 15px; height: 15px; }
.locked:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Liste görünümü ---------- */
.is-list .grid { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
.is-list .card {
  flex-direction: row; align-items: center;
  border-width: 0 0 1px; border-radius: 0; background: transparent;
}
.is-list .card:hover { transform: none; background: var(--card); }
.is-list .card-media { width: 64px; flex: none; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 4px; margin: 10px 0 10px 4px; }
.is-list .card-media img { padding: 4px; }
.is-list .ph { padding: 0; align-items: center; justify-content: center; }
.is-list .ph::before, .is-list .ph-cat, .is-list .tag { display: none; }
.is-list .ph-mono { font-size: 22px; align-self: center; }
.is-list .card-body {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  grid-template-areas: "meta price" "name price" "pack price";
  column-gap: 20px; padding: 10px 8px 10px 16px;
}
.is-list .card-meta { grid-area: meta; }
.is-list .card-name { grid-area: name; margin: 0; font-size: 15px; }
.is-list .card-pack { grid-area: pack; margin: 0; }
.is-list .card-price { grid-area: price; border: 0; margin: 0; padding: 0; justify-content: flex-end; text-align: right; }
.is-list .card.is-out .card-name::after {
  content: "Stokta yok"; margin-left: 8px; font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--brick);
}

/* ---------- Boş durum, notlar ---------- */
.empty { padding: 56px 0; max-width: 46ch; }
.empty-h { font-family: var(--serif); font-size: 24px; margin-bottom: 8px; }
.empty p:not(.empty-h) { color: var(--ink-2); }
.live-empty { color: var(--ink-2); padding: 32px 0; }
.price-note { margin-top: 36px; font-size: 13px; color: var(--muted); max-width: 70ch; }

/* ---------- Ürün detayı ---------- */
.detail { padding-top: 28px; padding-bottom: 72px; }
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.detail-media {
  position: relative; aspect-ratio: 1; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.detail-media img { width: 100%; height: 100%; object-fit: contain; padding: 24px; }
.detail-media .ph-mono { font-size: 140px; }
.detail-media .ph-cat { font-size: 13px; }
.detail-media.is-out img, .detail-media.is-out .ph { filter: grayscale(1); opacity: .55; }
.detail-info h1 { font-family: var(--serif); font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; letter-spacing: -0.01em; }
.specs { margin: 26px 0 0; border-top: 1px solid var(--line-2); }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 500; text-align: right; }
.ok { color: var(--olive); }
.no { color: var(--brick); }
.detail-price { margin: 28px 0 22px; padding: 20px 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.dp-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.dp-amt .amt { font-size: 38px; }
.dp-amt .cur { font-size: 17px; }
.dp-amt .per { font-size: 15px; }
.dp-date { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.dp-date .i { width: 15px; height: 15px; }
.dp-lock { color: var(--ink-2); margin-bottom: 14px; }
.detail-desc { margin-top: 28px; color: var(--ink-2); line-height: 1.65; max-width: 60ch; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  border-radius: var(--r); font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #000; }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; width: 100%; }
.btn-wa:hover { background: #17633e; }
.btn-ghost { background: transparent; color: var(--ink); height: 40px; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.related { margin-top: 72px; }

/* ---------- Alt bilgi ---------- */
.foot { border-top: 1px solid var(--ink); background: var(--paper-2); font-size: 14px; color: var(--ink-2); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-top: 40px; padding-bottom: 32px; }
.foot-brand { font-family: var(--serif); font-size: 22px; color: var(--ink); margin-bottom: 10px; }
.foot-note { max-width: 42ch; }
.foot-h { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.foot-grid p + p { margin-top: 4px; }
.foot-base { padding-top: 14px; padding-bottom: 22px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); }

/* ---------- Duyarlı ---------- */
@media (max-width: 960px) {
  .shop { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
  .cats {
    position: sticky; top: 0; z-index: 5;
    margin: 0 -24px; padding: 10px 24px;
    background: var(--paper); border-bottom: 1px solid var(--line);
  }
  .cats-h { display: none; }
  .cats-list { flex-direction: row; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .cats-list::-webkit-scrollbar { display: none; }
  .cats-list a {
    margin: 0; padding: 7px 14px; white-space: nowrap; flex: none;
    border: 1px solid var(--line-2); border-radius: 999px; background: var(--card);
  }
  .cats-list a.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .cats-list a.on .n { color: #b8b0a0; }
  .shelf { padding-top: 28px; }
  .detail-grid { grid-template-columns: 1fr; gap: 28px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .cats { margin: 0 -16px; padding: 10px 16px; }
  .mast-row { padding-top: 22px; padding-bottom: 16px; align-items: center; }
  .mast-contact span { display: none; }
  .mast-contact a { width: 40px; height: 40px; justify-content: center; border: 1px solid var(--line-2); border-radius: 50%; }
  .mast-contact { gap: 8px; }
  .cari-row { flex-direction: column; align-items: stretch; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
  .cari-bar.is-in .cari-row { flex-direction: row; align-items: center; }
  .cari-lead { font-size: 13.5px; align-items: flex-start; }
  .cari-form { flex-basis: auto; }
  .cari-form button { padding: 0 14px; }
  .shelf-head { align-items: stretch; }
  .tools { width: 100%; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .tool-row { width: 100%; }
  .tool-row select { flex: 1; min-width: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 10px 12px 12px; }
  .card-name { font-size: 14.5px; }
  .card-pack { font-size: 12.5px; }
  .amt { font-size: 17px; }
  .ph-mono { font-size: 42px; }
  .ph { padding: 10px 12px; }
  .ph-cat { font-size: 9.5px; }
  .is-list .card-body { grid-template-areas: "name name" "pack price"; padding-left: 12px; }
  .is-list .card-meta { display: none; }
  .is-list .card-price { margin-top: 2px; }
  .detail-media .ph-mono { font-size: 96px; }
  .foot-grid { grid-template-columns: 1fr; gap: 22px; }
}

/* ---------- Yazdırma: fiyat listesi ---------- */
@media print {
  @page { margin: 14mm 12mm; }
  body { background: #fff; font-size: 11pt; }
  .notice, .mast-contact, .cari-bar, .cats, .tools, .foot, .result-count, .flash, .card-media, .live-empty, .crumbs, .btn { display: none !important; }
  .mast { border: 0; }
  .mast::after { display: none; }
  .mast-row { padding: 0 0 4mm; }
  .shop { display: block; padding: 0; }
  .shelf-head { padding-bottom: 3mm; border-bottom: 1.5pt solid #000; }
  .shelf-title h1 { font-size: 18pt; }
  .eyebrow, .lede { display: none; }
  .print-head { display: block; font-size: 9.5pt; color: #444; margin: 2mm 0 0; }
  .group { margin-top: 6mm; break-inside: auto; }
  .group-head { margin-bottom: 1mm; break-after: avoid; }
  .group-head h2 { font-size: 13pt; }
  .grid { display: block; border-top: .75pt solid #000; }
  .card { display: block; border: 0; border-bottom: .5pt solid #bbb; border-radius: 0; background: none; break-inside: avoid; transform: none !important; }
  .card[hidden] { display: none; }
  .card-body { display: grid; grid-template-columns: 22mm 1fr 34mm 30mm; align-items: baseline; padding: 1.6mm 0; gap: 3mm; }
  .card-meta { order: 0; font-size: 8.5pt; }
  .card-meta span:not(.code) { display: none; }
  .card-name { margin: 0; font-size: 10.5pt; font-weight: 600; }
  .card-pack { margin: 0; font-size: 9.5pt; }
  .card-price { margin: 0; padding: 0; border: 0; justify-content: flex-end; }
  .amt { font-size: 10.5pt; }
  .cur, .per { font-size: 8.5pt; }
  .locked { display: none; }
  .price-note { font-size: 8.5pt; margin-top: 6mm; }
  a { text-decoration: none !important; }
}
