:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #15181d;
  --muted: #646b76;
  --line: #e2e5ea;
  --accent: #0f6b4f;
  --accent-ink: #ffffff;
  --accent-soft: #e3f2ec;
  --warn: #9a5b00;
  --warn-soft: #fff3df;
  --bad: #a3271f;
  --bad-soft: #fde9e7;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1a1d23;
    --ink: #eceef2;
    --muted: #9aa1ad;
    --line: #2b3039;
    --accent: #34b583;
    --accent-ink: #08130e;
    --accent-soft: #163327;
    --warn: #f0b154;
    --warn-soft: #33270f;
    --bad: #f08a80;
    --bad-soft: #3a1b18;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button, input, textarea, select { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

.topbar { background: var(--surface); border-top: 3px solid var(--accent); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brandmark { font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brandmark span { color: var(--accent); }
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer;
}
.cart-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cart-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 12px;
}
.cart-count.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.3); } }

.hero { padding: 36px 0 4px; }
.hero h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); max-width: 620px; }
.hero.compact { display: none; }
.recent { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin: 4px 2px 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer;
  font-family: ui-monospace, Consolas, monospace; font-size: 13px;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.search { display: flex; gap: 8px; margin: 20px 0 8px; }
.search input {
  flex: 1; min-width: 0; height: 52px; padding: 0 16px; font-size: 18px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  text-transform: uppercase;
}
.search input::placeholder { text-transform: none; color: var(--muted); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search button {
  height: 52px; padding: 0 26px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer;
}
.search button:disabled { opacity: .6; cursor: progress; }

.status { color: var(--muted); min-height: 22px; margin: 6px 2px 14px; }
.status.err { color: var(--bad); }
.spinner {
  display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.results { display: grid; gap: 10px; padding-bottom: 40px; }
.product {
  display: grid; align-items: center; gap: 16px;
  grid-template-columns: 96px minmax(0, 1fr) 110px 130px 230px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.product.off { opacity: .6; }
.logo {
  height: 48px; display: grid; place-items: center; border-radius: 8px; overflow: hidden;
  background: #fff; border: 1px solid var(--line);
}
.logo img { max-width: 88%; max-height: 80%; object-fit: contain; }
.logo.badge {
  --h: 160;
  background: hsl(var(--h) 60% 96%); border-color: hsl(var(--h) 45% 85%); color: hsl(var(--h) 60% 28%);
  font-weight: 900; font-size: 14px; letter-spacing: .01em; padding: 0 6px; text-align: center; line-height: 1.05;
  font-style: italic; text-transform: uppercase; overflow-wrap: anywhere;
}
.logo.badge.long { font-size: 11px; }
@media (prefers-color-scheme: dark) {
  .logo { background: #f7f8fa; }
  .logo.badge { background: hsl(var(--h) 30% 18%); border-color: hsl(var(--h) 30% 28%); color: hsl(var(--h) 70% 78%); }
}
.brand-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: .01em; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tag.exact { background: var(--accent-soft); color: var(--accent); }
.tag.alt { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.desc { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock span { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.stock .var { background: var(--accent-soft); color: var(--accent); }
.stock .az, .stock .bilinmiyor { background: var(--warn-soft); color: var(--warn); }
.stock .yok { background: var(--bad-soft); color: var(--bad); }
.price { text-align: right; }
.price b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.price small { color: var(--muted); font-size: 11px; }
.buy { display: flex; gap: 8px; justify-content: flex-end; }
.qty { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; height: 40px; }
.qty button { width: 32px; border: 0; background: transparent; cursor: pointer; font-size: 18px; }
.qty button:hover { background: var(--bg); }
.qty input { width: 44px; border: 0; text-align: center; background: transparent; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.add {
  height: 40px; padding: 0 14px; border: 0; border-radius: 10px; cursor: pointer; white-space: nowrap;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
}
.add:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.add.done { background: var(--ink); color: var(--surface); }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 9; }
.cart {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 10;
  display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .22s ease;
}
.cart.open { transform: none; box-shadow: -8px 0 32px rgba(0, 0, 0, .15); }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 0; font-size: 18px; }
.icon-btn { width: 36px; height: 36px; border: 0; background: transparent; font-size: 26px; cursor: pointer; border-radius: 8px; }
.icon-btn:hover { background: var(--bg); }
.cart-lines { flex: 1; overflow-y: auto; padding: 8px 16px; }
.cart-line { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line .logo { height: 36px; }
.cart-line .logo.badge { font-size: 10px; }
.cart-line .meta { min-width: 0; }
.cart-line .meta div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-line .unit { color: var(--muted); font-size: 12px; }
.cart-line .right { display: grid; justify-items: end; gap: 6px; }
.cart-line .qty { height: 32px; }
.cart-line .qty button { width: 28px; }
.cart-line .qty input { width: 38px; }
.cart-line .sum { font-weight: 700; font-variant-numeric: tabular-nums; }
.remove { border: 0; background: transparent; color: var(--bad); font-size: 12px; cursor: pointer; padding: 0; }
.cart-empty { color: var(--muted); text-align: center; padding: 40px 0; }
.cart-foot { padding: 14px 16px 18px; border-top: 1px solid var(--line); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; }
.cart-total b { font-size: 20px; font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; transition: .2s; z-index: 20;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); color: #fff; }

@media (max-width: 760px) {
  .search { margin-top: 18px; }
  .search button { padding: 0 18px; }
  .product {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    grid-template-areas: "logo info price" "stock stock buy";
    gap: 10px 12px;
  }
  .product .logo { grid-area: logo; height: 42px; }
  .product .info { grid-area: info; }
  .product .price { grid-area: price; }
  .product .stock { grid-area: stock; }
  .product .buy { grid-area: buy; }
}

/* ---------- üst menü ---------- */
.topbar-in { gap: 16px; }
.nav { display: flex; gap: 4px; margin-right: auto; margin-left: 12px; }
.nav-link { border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; }
.nav-link:hover { background: var(--bg); color: var(--ink); }
.nav-link.active { color: var(--ink); background: var(--bg); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.link-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 8px; }
.link-btn:hover { color: var(--ink); }

/* ---------- paneller ve formlar ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth { max-width: 460px; margin: 40px auto; }
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 40px; align-items: start; margin: 40px 0; }
.auth-wrap .auth { margin: 0; width: 100%; }
.auth-side {
  border-radius: 18px; padding: 36px; color: #fff; min-height: 420px;
  background: radial-gradient(120% 90% at 100% 0%, #1d8a66 0%, transparent 60%), linear-gradient(160deg, #0f6b4f, #0a4a37);
  box-shadow: var(--shadow);
}
.auth-side-mark { font-weight: 900; font-size: 22px; letter-spacing: -.02em; }
.auth-side-mark span { color: #8fe3bf; }
.auth-side h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.02em; margin: 56px 0 28px; max-width: 420px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.auth-points li { padding-left: 30px; position: relative; color: rgba(255, 255, 255, .82); font-size: 14px; }
.auth-points li::before {
  content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800;
}
.auth-points b { display: block; color: #fff; font-size: 15px; }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 16px; margin: 16px 0; }
  .auth-side { min-height: 0; padding: 22px; }
  .auth-side h1 { font-size: 22px; margin: 14px 0 0; }
  .auth-points, .auth-side-mark { display: none; }
}
.tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.tab { flex: 1; padding: 10px; border: 1px solid var(--line); background: transparent; border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--muted); }
.tab.active { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.form { display: grid; gap: 12px; padding: 20px; }
.form label, .note { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.form small, .note small { color: var(--muted); font-weight: 400; }
.form input, .form textarea, .form select, .note textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); font-weight: 400; font-size: 15px; resize: vertical;
}
.form input:focus, .form textarea:focus, .note textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-msg { margin: 0; min-height: 1em; color: var(--bad); font-size: 14px; }
.form-msg:empty { display: none; }
.form-msg.ok { color: var(--accent); }
.primary {
  height: 44px; padding: 0 18px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
}
.primary:disabled { opacity: .55; cursor: not-allowed; }
.primary.block { width: 100%; }
.secondary {
  height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  background: var(--surface); font-weight: 600;
}
.secondary:hover { background: var(--bg); }
.hint { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }
.notice { max-width: 560px; margin: 48px auto; padding: 28px; text-align: center; }
.notice h2 { margin-top: 0; }
.notice p { color: var(--muted); margin-bottom: 0; }

/* ---------- sepet alt kısmı ---------- */
.cart-foot { display: grid; gap: 12px; }
.cart-changes { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.cart-changes ul { margin: 6px 0; padding-left: 18px; }

/* ---------- siparişler ---------- */
.page-title { font-size: 22px; margin: 28px 0 14px; }
.order-list { display: grid; gap: 10px; padding-bottom: 40px; }
.order summary {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; list-style: none; flex-wrap: wrap;
}
.order summary::-webkit-details-marker { display: none; }
.order[open] summary { border-bottom: 1px solid var(--line); }
.order > :not(summary) { margin: 12px 16px; }
.order-no { font-weight: 800; }
.order-total { margin-left: auto; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--bg); }
.st-alindi, .st-bekliyor { background: var(--warn-soft); color: var(--warn); }
.st-hazirlaniyor, .st-kargoda { background: #e6efff; color: #1f4fb3; }
.st-teslim, .st-onayli, .st-eklendi { background: var(--accent-soft); color: var(--accent); }
.st-iptal, .st-engelli, .st-eklenemedi { background: var(--bad-soft); color: var(--bad); }
@media (prefers-color-scheme: dark) { .st-hazirlaniyor, .st-kargoda { background: #17264a; color: #8fb2ff; } }
table.lines { width: calc(100% - 32px); border-collapse: collapse; font-size: 14px; }
.lines th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.lines td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lines .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 760px) {
  .nav { margin-left: 0; }
  .nav-link { padding: 8px; font-size: 14px; }
  .brandmark { font-size: 17px; }
  .cart-btn span { display: none; }
  .row2 { grid-template-columns: 1fr; }
  .auth { margin-top: 20px; }
}
@media (max-width: 420px) {
  .topbar-in { gap: 6px; }
  .brandmark { font-size: 15px; }
  .nav-link { padding: 6px; font-size: 13px; }
  .cart-btn { padding: 6px 10px; }
  .hero { padding-top: 22px; }
  .hero h1 { font-size: 22px; }
  .link-btn { padding: 4px; font-size: 13px; }
}
