:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #1a1f2b;
  --muted: #5b6474;
  --border: #dde2ea;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #d8f0ed;
  --good: #15803d;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --good-soft: #dcfce7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .05);
  --max: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131a;
    --surface: #171c25;
    --surface-2: #1f2632;
    --text: #e6e9ef;
    --muted: #9aa3b2;
    --border: #2a3240;
    --accent: #2dd4bf;
    --accent-ink: #062320;
    --accent-soft: #12332f;
    --good: #4ade80;
    --warn: #fbbf24;
    --warn-soft: #3a2e0b;
    --good-soft: #12351f;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
button, input { font: inherit; }
a { color: var(--accent); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.02em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* Üst menü */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.logo svg { width: 28px; height: 28px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

/* Bölümler */
section { padding: 56px 0; }
.hero { padding: 64px 0 40px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 12px; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: 12px 20px; border-radius: 10px; font-weight: 600; text-decoration: none; border: 0; cursor: pointer; font-size: 1rem; }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card .num { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.card p { color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.alt-bg { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* Demo */
.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search input { flex: 1 1 240px; min-width: 0; padding: 12px 14px; font-size: 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.chip { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 4px 12px; border-radius: 999px; font-size: .9rem; cursor: pointer; }
.notice { font-size: .9rem; color: var(--warn); margin-top: 12px; }
.results { margin-top: 20px; display: grid; gap: 12px; }
.result { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; text-align: left; width: 100%; font: inherit; color: inherit; cursor: pointer; }
.result:hover { border-color: var(--accent); }
.result .meta { font-size: .9rem; color: var(--muted); }
.price { font-weight: 700; font-size: 1.15rem; white-space: nowrap; }
.detail { margin-top: 20px; }
.detail .card h3 { margin-top: 24px; }
.detail .card h3:first-child { margin-top: 0; }
.detail .card > p { margin-bottom: 8px; }
.detail td, .detail th { white-space: nowrap; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.badge { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badge.out { background: var(--surface-2); color: var(--muted); }
.saving { color: var(--good); font-weight: 600; }
.stars { color: var(--warn); }

/* Metin sayfaları */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; font-size: 1.25rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

/* Alt bilgi */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.disclosure { max-width: 620px; }

/* ---------- Vitrin (ürün kartları, kategoriler, detay penceresi) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: .85rem; }
section.tight { padding: 28px 0; }
.hero .search { margin-top: 24px; max-width: 640px; }
.search-results:not(:empty) { margin-top: 28px; }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }

.demo-banner { background: var(--warn-soft); color: var(--text); border-bottom: 1px solid var(--border); font-size: .9rem; padding: 10px 0; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 1.3rem; }
.section-head a { font-size: .95rem; text-decoration: none; font-weight: 600; }

.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: .95rem; }
.cat-chip:hover { border-color: var(--accent); }
.cat-chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cat-chip .count { font-size: .75rem; color: var(--muted); }
.cat-chip.active .count { color: inherit; opacity: .8; }

.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
/* Kategori vitrini: yana kayan şerit (telefonda ~2.3 kart görünür → kaydırılabildiği belli olur) */
.cards.row { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: calc((100% - 48px) / 5);
  overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px; overscroll-behavior-x: contain; }
.cards.row > * { scroll-snap-align: start; }
@media (max-width: 900px) { .cards.row { grid-auto-columns: calc((100% - 24px) / 3.3); } }
@media (max-width: 480px) { .cards.row { grid-auto-columns: 42%; grid-template-columns: none; } }
.pcard { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.pcard:hover { border-color: var(--accent); }
.pcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb { aspect-ratio: 4 / 3; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 6px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.thumb-icon { font-size: 2.6rem; }
.pcard-brand { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1em; }
.pcard-name { font-weight: 600; font-size: .95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.pcard-meta { font-size: .8rem; color: var(--muted); min-height: 1.2em; }
.pcard-price { margin-top: auto; font-weight: 700; font-size: 1.1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.old { color: var(--muted); font-weight: 400; font-size: .85rem; }
.drop-badge { position: absolute; top: 16px; left: 18px; background: var(--good); color: #fff; font-weight: 700; font-size: .8rem; padding: 2px 8px; border-radius: 999px; }
.demo-badge { position: absolute; top: 16px; right: 18px; background: var(--surface); color: var(--muted); border: 1px solid var(--border); font-size: .7rem; padding: 1px 6px; border-radius: 999px; }

.cat-tools { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin: 20px 0 16px; }
.cat-tools label { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--muted); }
select { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); max-width: 60vw; }
#cat-grid { margin-top: 16px; }

.detail-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--border); border-radius: 16px; padding: 24px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.detail-dialog::backdrop { background: rgba(10, 14, 20, .55); }
.detail-dialog h2 { font-size: 1.35rem; padding-right: 32px; }
.detail-dialog h3 { margin-top: 22px; }
.dialog-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 1rem; }
.drop-note { background: var(--good-soft); border-radius: 10px; padding: 10px 12px; }
.detail-dialog td, .detail-dialog th { white-space: nowrap; }
.alts { display: grid; gap: 8px; }
.alt { display: flex; justify-content: space-between; gap: 12px; text-align: left; font: inherit; color: inherit; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.alt:hover { border-color: var(--accent); }
.alt-price { text-align: right; font-weight: 700; white-space: nowrap; }

@media (max-width: 480px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pcard { padding: 8px 10px 12px; }
  .drop-badge { top: 12px; left: 14px; }
  .demo-badge { top: 12px; right: 14px; }
  .detail-dialog { padding: 20px 16px; }
}

/* ---------- Renkli tema ---------- */
:root {
  --h: 250;                      /* kategori rengi (JS her öğeye ayrı verir) */
  --grad: linear-gradient(120deg, #0d9488 0%, #4f46e5 52%, #db2777 100%);
  --hot: linear-gradient(135deg, #f97316, #e11d48);
  --chip-bg: hsl(var(--h) 95% 95%);
  --chip-border: hsl(var(--h) 75% 84%);
  --chip-ink: hsl(var(--h) 65% 30%);
  --chip-on: hsl(var(--h) 70% 46%);
  --thumb-a: hsl(var(--h) 95% 95%);
  --thumb-b: hsl(calc(var(--h) + 35) 95% 89%);
  --deals-bg: linear-gradient(180deg, #fff7ed 0%, #fdf2f8 100%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --chip-bg: hsl(var(--h) 35% 17%);
    --chip-border: hsl(var(--h) 35% 30%);
    --chip-ink: hsl(var(--h) 85% 84%);
    --chip-on: hsl(var(--h) 60% 42%);
    --thumb-a: hsl(var(--h) 35% 18%);
    --thumb-b: hsl(calc(var(--h) + 35) 35% 24%);
    --deals-bg: linear-gradient(180deg, #2a1610 0%, #2a1020 100%);
  }
}
/* Değişkenler her öğede yeniden hesaplansın diye --h alan öğelerde tekrar tanımlanır */
.pcard, .cat-chip, .showcase {
  --chip-bg: hsl(var(--h) 95% 95%); --chip-border: hsl(var(--h) 75% 84%); --chip-ink: hsl(var(--h) 65% 30%);
  --chip-on: hsl(var(--h) 70% 46%); --thumb-a: hsl(var(--h) 95% 95%); --thumb-b: hsl(calc(var(--h) + 35) 95% 89%);
}
@media (prefers-color-scheme: dark) {
  .pcard, .cat-chip, .showcase {
    --chip-bg: hsl(var(--h) 35% 17%); --chip-border: hsl(var(--h) 35% 30%); --chip-ink: hsl(var(--h) 85% 84%);
    --chip-on: hsl(var(--h) 60% 42%); --thumb-a: hsl(var(--h) 35% 18%); --thumb-b: hsl(calc(var(--h) + 35) 35% 24%);
  }
}

.btn { background: var(--grad); background-size: 140% 100%; color: #fff; box-shadow: 0 4px 14px rgba(79, 70, 229, .3); transition: background-position .3s; }
.btn:hover { background-position: 100% 0; }
.btn.secondary { background: var(--surface-2); color: var(--text); box-shadow: none; }

/* Üst bölüm: canlı renk geçişi */
.hero { background: var(--grad); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto -10% -60% auto; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { color: #fff; }
.hero p.lead { color: rgba(255,255,255,.9); }
.hero .eyebrow { color: #fde68a; }
.hero .search input { border: 0; box-shadow: 0 6px 20px rgba(0,0,0,.18); background: #fff; color: #111827; }
.hero .search .btn { background: #fbbf24; color: #1f2937; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.hero .search .btn:hover { background: #f59e0b; }
.hero .search-results { background: var(--bg); color: var(--text); border-radius: 16px; padding: 16px; }
.hero .search-results:empty { padding: 0; }

/* Kategori düğmeleri: her biri kendi renginde */
.cat-chip { background: var(--chip-bg); border-color: var(--chip-border); color: var(--chip-ink); font-weight: 600; transition: transform .15s, box-shadow .15s; }
.cat-chip:hover { border-color: var(--chip-on); transform: translateY(-2px); box-shadow: 0 4px 12px hsl(var(--h) 70% 50% / .2); }
.cat-chip .count { color: var(--chip-ink); opacity: .7; }
.cat-chip.active { background: var(--chip-on); border-color: var(--chip-on); color: #fff; }

/* Ürün kartları */
.pcard { transition: transform .15s, box-shadow .15s, border-color .15s; }
.pcard:hover { transform: translateY(-3px); border-color: var(--chip-on); box-shadow: 0 10px 24px hsl(var(--h) 60% 40% / .18); }
.thumb { background: linear-gradient(135deg, var(--thumb-a), var(--thumb-b)); }
.pcard-brand { color: var(--chip-ink); font-weight: 600; }
.drop-badge { background: var(--hot); box-shadow: 0 2px 8px rgba(225, 29, 72, .35); }

/* Fiyatı düşenler: sıcak arka plan */
.deals { background: var(--deals-bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 36px 0; }
.deals .section-head h2 { background: var(--hot); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.5rem; }

/* Kategori vitrinleri: başlıkta renkli şerit */
.showcase .section-head h2 { border-left: 5px solid var(--chip-on); padding-left: 10px; }
.showcase .section-head a { color: var(--chip-ink); background: var(--chip-bg); border: 1px solid var(--chip-border); padding: 4px 12px; border-radius: 999px; }
.showcase:nth-of-type(even) { background: hsl(var(--h) 60% 50% / .05); }

/* Menü ve diğer bölümler */
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.card .num { background: var(--grad); color: #fff; }
.alt-bg { background: linear-gradient(180deg, #eef2ff, #f0fdfa); }
@media (prefers-color-scheme: dark) { .alt-bg { background: linear-gradient(180deg, #1a1d35, #0f2522); } }
.drop-note { background: linear-gradient(135deg, #ffedd5, #fce7f3); }
@media (prefers-color-scheme: dark) { .drop-note { background: linear-gradient(135deg, #3b1d0e, #3b0f26); } }
