@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("fonts/poppins-regular.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("fonts/poppins-medium.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("fonts/poppins-bold.woff") format("woff"); }

:root {
  --night: #160a1c;      /* logo vinyetinin koyu moru */
  --plum: #22102b;       /* kartlar */
  --plum-2: #2f173b;     /* alanlar */
  --line: #4a2a58;
  --magenta: #e3168a;    /* logo pembesi */
  --magenta-hi: #ff4fae;
  --paper: #fff3f9;
  --muted: #c4a6bc;
  --amber: #ffb648;      /* uyarı, arabanın turuncusundan */
  --red: #ff6b7a;
  --green: #4fd69c;
  --radius: 14px;
  --bar-h: 76px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(227, 22, 138, .38), rgba(227, 22, 138, 0) 60%),
    var(--night);
  background-attachment: fixed;
  color: var(--paper);
  font: 400 15px/1.55 "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}
img { max-width: 100%; display: block; }
a { color: var(--magenta-hi); }
[hidden] { display: none !important; }
h1, h2 { margin: 0; line-height: 1.2; }
:focus-visible { outline: 2px solid var(--magenta-hi); outline-offset: 2px; }

.top, .view, .foot { width: 100%; max-width: 480px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* ---------- üst bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--paper); text-decoration: none; font-weight: 700; font-size: 17px; }
.brand img { border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.08), 0 0 18px rgba(227, 22, 138, .55); }
.top-link { color: var(--paper); text-decoration: none; font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.07); }

/* ---------- ürün ---------- */
.view { padding-top: 10px; padding-bottom: 24px; }
.product { position: relative; border-radius: 20px; overflow: hidden; background: var(--plum); box-shadow: 0 0 0 1px rgba(255, 79, 174, .35), 0 18px 40px -12px rgba(227, 22, 138, .55); }
.product-img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: center 60%; }
.product-info { padding: 14px 16px 16px; }
.product-info h1 { font-size: 22px; font-weight: 700; }
.product-info p { margin: 2px 0 0; color: var(--muted); }
.product-info strong { color: var(--paper); font-weight: 500; }
.product-price { position: absolute; right: 12px; top: 12px; display: flex; align-items: baseline; gap: 4px; padding: 6px 12px; border-radius: 999px; background: rgba(22, 10, 28, .78); backdrop-filter: blur(6px); }
.product-price span { font-weight: 700; font-size: 18px; }
.product-price small { color: var(--muted); font-size: 12px; }

.notice { background: rgba(255, 182, 72, .12); border: 1px solid rgba(255, 182, 72, .5); color: var(--amber); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }

/* ---------- bloklar ---------- */
.block { margin-top: 26px; }
.block h2 { font-size: 17px; font-weight: 700; margin-bottom: 12px; }

.qty-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.qty-grid .gap { grid-column: 1 / -1; height: 2px; }
.qty {
  appearance: none; border: 1px solid var(--line); background: var(--plum); color: var(--paper);
  font: 500 15px "Poppins", system-ui, sans-serif; height: 46px; border-radius: 12px; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: background .15s, border-color .15s, box-shadow .15s;
}
.qty:hover { border-color: var(--magenta); }
.qty[aria-checked="true"] { background: var(--magenta); border-color: var(--magenta-hi); box-shadow: 0 6px 18px -6px rgba(227, 22, 138, .9); font-weight: 700; }

.field { display: block; margin: 0 0 12px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; padding: 0; }
.field input {
  width: 100%; height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--plum-2); color: var(--paper); font: 500 16px "Poppins", system-ui, sans-serif;
}
.field input::placeholder { color: #8d7088; font-weight: 400; }
.field input:focus { outline: none; border-color: var(--magenta-hi); box-shadow: 0 0 0 3px rgba(255, 79, 174, .25); }
.field input[aria-invalid="true"] { border-color: var(--red); }
.qty-custom { margin-top: 12px; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--plum); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.seg button { appearance: none; border: 0; background: transparent; color: var(--muted); font: 500 14px "Poppins", system-ui, sans-serif; height: 38px; border-radius: 9px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--plum-2); color: var(--paper); box-shadow: inset 0 0 0 1px var(--magenta); }

.hint { margin: -4px 0 14px; font-size: 13px; color: var(--muted); }
.warn-inline { margin: -4px 0 14px; font-size: 13px; color: var(--amber); }
.error { margin: -4px 0 14px; font-size: 13px; color: var(--red); font-weight: 500; }

/* ---------- ödeme barı ---------- */
.paybar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 10;
  display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(22, 10, 28, .94); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.paybar-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.paybar-sum span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paybar-sum strong { font-size: 24px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }

.btn-primary, .btn-ghost {
  appearance: none; border: 0; cursor: pointer; font: 700 16px "Poppins", system-ui, sans-serif;
  height: 52px; padding: 0 24px; border-radius: 14px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary { background: var(--magenta); color: #fff; box-shadow: 0 10px 24px -10px rgba(227, 22, 138, .95); }
.btn-primary:hover { background: #f02a98; }
.btn-primary:disabled { background: #5a3a63; color: #b99bb2; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: rgba(255,255,255,.08); color: var(--paper); font-weight: 500; }

/* ---------- onay penceresi ---------- */
dialog { padding: 0; border: 0; background: transparent; color: var(--paper); width: min(440px, calc(100% - 24px)); max-height: calc(100% - 24px); }
dialog::backdrop { background: rgba(10, 4, 14, .75); backdrop-filter: blur(3px); }
.confirm-inner { background: var(--plum); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.confirm-inner h2 { font-size: 19px; margin-bottom: 14px; }
.confirm-product { display: flex; align-items: center; gap: 12px; }
.confirm-product img { border-radius: 10px; width: 80px; height: 53px; object-fit: cover; }
.confirm-product strong { display: block; font-size: 17px; }
.confirm-product span { color: var(--muted); font-size: 14px; }
.confirm-id { margin: 16px 0 12px; padding: 14px; border-radius: 14px; border: 2px solid var(--amber); background: rgba(255, 182, 72, .08); }
.confirm-id span { display: block; font-size: 13px; color: var(--amber); font-weight: 500; }
.confirm-id strong { display: block; font-size: 26px; letter-spacing: .02em; word-break: break-all; line-height: 1.25; margin-top: 2px; }
.confirm-list { margin: 0; }
.confirm-list div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.confirm-list dt { color: var(--muted); font-size: 14px; }
.confirm-list dd { margin: 0; text-align: right; font-weight: 500; word-break: break-word; }
.confirm-list .total dd { font-size: 20px; font-weight: 700; }
.confirm-warn { font-size: 13px; color: var(--amber); margin: 14px 0 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--plum-2); cursor: pointer; font-weight: 500; font-size: 14px; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--magenta); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.confirm-actions button { padding: 0 10px; font-size: 15px; }
#confirm-err { margin: 10px 0 0; }

/* ---------- sipariş durumu ---------- */
.page-title { font-size: 22px; margin: 6px 0 16px; }
.status-card { background: var(--plum); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.status-head { display: flex; gap: 14px; align-items: center; }
.status-dot { width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.s-wait .status-dot { background: rgba(255, 182, 72, .16); color: var(--amber); }
.s-ok .status-dot { background: rgba(79, 214, 156, .16); color: var(--green); }
.s-done .status-dot { background: rgba(227, 22, 138, .2); color: var(--magenta-hi); }
.s-off .status-dot { background: rgba(255,255,255,.08); color: var(--muted); }
.status-head h1 { font-size: 20px; }
.status-desc { color: var(--muted); margin: 12px 0 0; }
.order-no { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--plum-2); }
.order-no small { display: block; color: var(--muted); font-size: 12px; }
.order-no strong { font-size: 18px; letter-spacing: .03em; }
.copy-btn { appearance: none; border: 1px solid var(--line); background: transparent; color: var(--paper); border-radius: 10px; padding: 8px 12px; font: 500 13px "Poppins", system-ui, sans-serif; cursor: pointer; }
.save-tip { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.detail { margin: 16px 0 0; }
.detail div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.detail div:last-child { border-bottom: 0; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; font-weight: 500; text-align: right; }
.detail-product { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
.detail-product img { width: 72px; height: 48px; object-fit: cover; border-radius: 10px; }
.status-card .btn-primary { width: 100%; margin-top: 18px; }
.refresh-note { font-size: 12px; color: var(--muted); text-align: center; margin: 10px 0 0; }

.lookup-form .btn-primary { width: 100%; }
.results { margin-top: 20px; display: grid; gap: 10px; }
.result { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--plum); border: 1px solid var(--line); color: var(--paper); text-decoration: none; }
.result small { display: block; color: var(--muted); font-size: 13px; }
.result strong { font-size: 15px; }
.badge { flex: none; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.08); }
.badge.s-wait { color: var(--amber); background: rgba(255, 182, 72, .14); }
.badge.s-ok { color: var(--green); background: rgba(79, 214, 156, .14); }
.badge.s-done { color: var(--magenta-hi); background: rgba(227, 22, 138, .18); }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }

.foot { padding-top: 8px; padding-bottom: 28px; color: var(--muted); font-size: 13px; text-align: center; }
#view-shop:not([hidden]) ~ .foot { padding-bottom: calc(var(--bar-h) + 28px + env(safe-area-inset-bottom)); }

@media (min-width: 520px) {
  .view { padding-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
