/* ============================================================
   Vitrun — tasarım sistemi (mağaza + yönetim ortak)
   ============================================================ */
:root {
  --font-display: 'Montserrat', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --bg-sunk: #ececf0;
  --surface: #ffffff;
  --surface-2: #fafafc;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --faint: #8e8e93;
  --line: rgba(0, 0, 0, .08);
  --line-strong: rgba(0, 0, 0, .16);

  --gold: #9c7629;
  --gold-bright: #c9a24a;
  --gold-soft: #f7f0e1;
  --sale: #dc2238;
  --sale-soft: #fdecee;
  --ok: #138a4a;
  --ok-soft: #e6f5ec;
  --warn: #a45708;
  --warn-soft: #fdf1e2;
  --info: #0b63ce;

  --btn: #1d1d1f;
  --btn-ink: #ffffff;
  --btn-hover: #000000;
  --glass: rgba(255, 255, 255, .72);
  --glass-line: rgba(0, 0, 0, .06);
  --focus: 0 0 0 4px rgba(201, 162, 74, .35);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 10px rgba(0, 0, 0, .04);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .04);
  --shadow-3: 0 40px 90px rgba(0, 0, 0, .20);

  --r-xs: 8px;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --r-xl: 34px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  --nav-h: 56px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1240px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-soft: #101012;
    --bg-sunk: #1c1c1e;
    --surface: #161618;
    --surface-2: #1c1c1e;
    --ink: #f5f5f7;
    --ink-2: #d2d2d7;
    --muted: #a1a1a6;
    --faint: #7c7c80;
    --line: rgba(255, 255, 255, .10);
    --line-strong: rgba(255, 255, 255, .20);
    --gold: #dcb76b;
    --gold-bright: #e6c47d;
    --gold-soft: rgba(220, 183, 107, .13);
    --sale: #ff4f62;
    --sale-soft: rgba(255, 79, 98, .14);
    --ok: #36d07a;
    --ok-soft: rgba(54, 208, 122, .13);
    --warn: #ffb35c;
    --warn-soft: rgba(255, 179, 92, .13);
    --info: #4da3ff;
    --btn: #f5f5f7;
    --btn-ink: #000000;
    --btn-hover: #ffffff;
    --glass: rgba(18, 18, 20, .72);
    --glass-line: rgba(255, 255, 255, .08);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-2: 0 12px 32px rgba(0, 0, 0, .5);
    --shadow-3: 0 40px 90px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --bg-soft: #101012;
  --bg-sunk: #1c1c1e;
  --surface: #161618;
  --surface-2: #1c1c1e;
  --ink: #f5f5f7;
  --ink-2: #d2d2d7;
  --muted: #a1a1a6;
  --faint: #7c7c80;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .20);
  --gold: #dcb76b;
  --gold-bright: #e6c47d;
  --gold-soft: rgba(220, 183, 107, .13);
  --sale: #ff4f62;
  --sale-soft: rgba(255, 79, 98, .14);
  --ok: #36d07a;
  --ok-soft: rgba(54, 208, 122, .13);
  --warn: #ffb35c;
  --warn-soft: rgba(255, 179, 92, .13);
  --info: #4da3ff;
  --btn: #f5f5f7;
  --btn-ink: #000000;
  --btn-hover: #ffffff;
  --glass: rgba(18, 18, 20, .72);
  --glass-line: rgba(255, 255, 255, .08);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, .5);
  --shadow-3: 0 40px 90px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-body);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--gold-bright); color: #000; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.container { width: 100%; max-width: calc(var(--maxw) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.ic { width: 20px; height: 20px; flex: none; }

/* ---------- tipografi ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 13px/1.2 var(--font-body); letter-spacing: .02em; color: var(--gold); }
.display { font-size: clamp(40px, 7.4vw, 104px); font-weight: 800; letter-spacing: -0.045em; line-height: .98; }
.h1 { font-size: clamp(34px, 5.4vw, 64px); letter-spacing: -0.04em; line-height: 1.02; }
.h2 { font-size: clamp(28px, 4.2vw, 52px); letter-spacing: -0.035em; line-height: 1.05; }
.h3 { font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -0.025em; }
.lead { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.45; color: var(--muted); letter-spacing: -0.012em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- butonlar ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 22px; border-radius: 999px;
  background: var(--btn); color: var(--btn-ink);
  font: 600 15px/1 var(--font-body); letter-spacing: -0.01em; white-space: nowrap;
  transition: transform .35s var(--ease), background .2s, box-shadow .3s, opacity .2s;
  position: relative; overflow: hidden; isolation: isolate;
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.is-disabled { opacity: .4; pointer-events: none; }
.btn .ic { width: 18px; height: 18px; }
.btn-lg { --h: 54px; padding: 0 30px; font-size: 16px; }
.btn-sm { --h: 36px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-secondary { background: var(--bg-soft); color: var(--ink); }
.btn-secondary:hover { background: var(--bg-sunk); }
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-outline:hover { background: var(--bg-soft); }
.btn-gold { background: linear-gradient(180deg, #e2c27c, #c79f4a); color: #1a1406; }
.btn-gold:hover { background: linear-gradient(180deg, #ebcd8a, #d1aa55); }
.btn-sale { background: var(--sale); color: #fff; }
.btn-sale:hover { background: var(--sale); filter: brightness(1.08); }
.btn-light { background: #f5f5f7; color: #000; }
.btn-light:hover { background: #fff; }
.btn-ghost-light { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .18); }
.btn-link { display: inline-flex; align-items: center; gap: 4px; color: var(--gold); font-weight: 600; }
.btn-link .ic { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.btn-link:hover .ic { transform: translateX(3px); }
.btn.is-loading { color: transparent; pointer-events: none; }
.btn.is-loading .spinner { position: absolute; inset: 0; margin: auto; color: var(--btn-ink); }

.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 999px; color: var(--ink); transition: background .2s, transform .3s var(--ease); position: relative; }
.icon-btn:hover { background: var(--bg-soft); }
.icon-btn:active { transform: scale(.92); }

/* ---------- Apple spinner ---------- */
.spinner { width: 22px; height: 22px; position: relative; display: inline-block; color: var(--muted); }
.spinner i { position: absolute; left: 46%; top: 6%; width: 8%; height: 26%; border-radius: 4px; background: currentColor; transform-origin: 50% 170%; animation: spin-fade 1s linear infinite; opacity: .15; }
.spinner i:nth-child(1) { transform: rotate(0deg); animation-delay: -1s; }
.spinner i:nth-child(2) { transform: rotate(45deg); animation-delay: -.875s; }
.spinner i:nth-child(3) { transform: rotate(90deg); animation-delay: -.75s; }
.spinner i:nth-child(4) { transform: rotate(135deg); animation-delay: -.625s; }
.spinner i:nth-child(5) { transform: rotate(180deg); animation-delay: -.5s; }
.spinner i:nth-child(6) { transform: rotate(225deg); animation-delay: -.375s; }
.spinner i:nth-child(7) { transform: rotate(270deg); animation-delay: -.25s; }
.spinner i:nth-child(8) { transform: rotate(315deg); animation-delay: -.125s; }
@keyframes spin-fade { 0% { opacity: 1; } 100% { opacity: .15; } }

/* ---------- formlar ---------- */
.field { display: grid; gap: 6px; position: relative; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; height: 50px; padding: 0 16px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-size: 16px; transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none; appearance: none;
}
.textarea { height: auto; min-height: 96px; padding: 14px 16px; resize: vertical; line-height: 1.45; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 42px; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold-bright); box-shadow: var(--focus); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--sale); }
.field-error { font-size: 12.5px; color: var(--sale); min-height: 0; }
.field-hint { font-size: 12.5px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }

.switch { position: relative; width: 46px; height: 28px; flex: none; display: inline-block; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--bg-sunk); transition: background .25s; box-shadow: inset 0 0 0 1px var(--line); }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .3s var(--spring); }
.switch input:checked + i { background: #30c15f; }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: var(--focus); }

/* ---------- rozetler ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 99px; font: 600 12px/1 var(--font-body); letter-spacing: 0; white-space: nowrap; background: var(--bg-soft); color: var(--ink-2); }
.badge .ic { width: 13px; height: 13px; }
.badge-sale { background: var(--sale); color: #fff; }
.badge-flash { background: #111; color: #ffd166; }
.badge-gold { background: var(--gold-soft); color: var(--gold); }
.badge-new { background: var(--ink); color: var(--bg); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: rgba(11, 99, 206, .1); color: var(--info); }

/* ---------- açılış ---------- */
.loader {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .7s var(--ease), visibility .7s, filter .7s var(--ease);
}
.loader-inner { display: grid; justify-items: center; gap: 18px; animation: loader-in .9s var(--ease) both; }
.loader-inner img { width: 72px; height: 72px; border-radius: 50%; box-shadow: 0 18px 50px rgba(156, 118, 41, .28); }
.loader-word { font: 600 13px/1 var(--font-display); letter-spacing: .5em; margin-right: -.5em; color: var(--ink); }
.loader-bar { width: 132px; height: 3px; border-radius: 99px; background: var(--bg-sunk); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--ink); transform-origin: 0 50%; transform: scaleX(var(--progress, .04)); transition: transform .45s var(--ease); }
.loader.is-done { opacity: 0; visibility: hidden; filter: blur(8px); }
.loader.is-done .loader-inner { transform: scale(1.08); transition: transform .7s var(--ease); }
@keyframes loader-in { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: 900; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 10px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px;
  border-radius: 18px; background: rgba(29, 29, 31, .92); color: #f5f5f7; box-shadow: var(--shadow-3);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  font-size: 14.5px; animation: toast-in .5s var(--spring) both;
}
.toast img { width: 40px; height: 50px; object-fit: cover; border-radius: 6px; flex: none; }
.toast .ic { color: #36d07a; }
.toast.is-error .ic { color: #ff6b6b; }
.toast-text { flex: 1; min-width: 0; line-height: 1.35; }
.toast-text small { display: block; color: #a1a1a6; font-size: 12.5px; }
.toast a, .toast button { color: #e6c47d; font-weight: 600; font-size: 14px; padding: 8px 10px; border-radius: 10px; white-space: nowrap; }
.toast a:hover, .toast button:hover { background: rgba(255, 255, 255, .08); }
.toast.is-leaving { animation: toast-out .35s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- reveal animasyonları ---------- */
.reveal { opacity: 0; transform: translateY(28px); filter: blur(6px); transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease); transition-delay: calc(var(--d, 0) * 70ms); }
.reveal.is-in { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
}
