/* =====================================================================
   Hızlı Satış (POS) — Tasarım sistemi
   Kategoriler kutu olarak; sade, ikonsuz, hizalı rakamlar.
   ===================================================================== */

:root {
    --ink-900:#0d1117; --ink-800:#161b22; --ink-700:#1c232e; --ink-line:#2d3848;
    --paper:#f4f6f9; --card:#fff; --card-2:#f8fafc; --line:#e3e8ef; --line-2:#eef2f7;
    --text:#0f172a; --muted:#64748b; --muted-2:#94a3b8; --invert:#e6edf6; --invert-muted:#8b98a9;
    --brand:#0d9488; --brand-2:#0f766e; --brand-soft:#d6f0ec;
    --rose:#e11d48; --green:#059669;
    --r-sm:8px; --r:12px; --r-lg:16px;
    --shadow:0 1px 2px rgba(15,23,42,.06),0 4px 16px rgba(15,23,42,.06);
    --shadow-lg:0 12px 40px rgba(15,23,42,.18);
    --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,system-ui,sans-serif;
}
* { box-sizing:border-box; margin:0; padding:0; }
html,body { height:100%; }
body { font-family:var(--font); background:var(--paper); color:var(--text); font-size:14px; -webkit-font-smoothing:antialiased; }
.tnum { font-variant-numeric:tabular-nums; }
button { font-family:inherit; cursor:pointer; border:none; background:none; }
input,select,textarea { font-family:inherit; font-size:14px; }
:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }

/* ===================== İSKELET ===================== */
.app { display:grid; grid-template-rows:56px 1fr; height:100vh; overflow:hidden; }

.topbar {
    background:var(--ink-800); color:var(--invert);
    display:flex; align-items:center; gap:16px; padding:0 18px; border-bottom:1px solid var(--ink-line);
}
.brand { font-weight:700; letter-spacing:-.02em; font-size:17px; white-space:nowrap; }
.searchbox { flex:1; max-width:460px; }
.searchbox input {
    width:100%; height:38px; background:var(--ink-700); color:var(--invert);
    border:1px solid var(--ink-line); border-radius:var(--r); padding:0 14px;
}
.searchbox input::placeholder { color:var(--invert-muted); }
.topbar .spacer { flex:1; }
.topbar a.btn-ghost {
    color:var(--invert); text-decoration:none; padding:8px 16px; border-radius:var(--r-sm);
    border:1px solid var(--ink-line); font-weight:600;
}
.topbar a.btn-ghost:hover { background:var(--ink-700); }

.main { display:grid; grid-template-columns:1fr 380px; overflow:hidden; }

/* ===================== İÇERİK ===================== */
.content { overflow-y:auto; padding:18px 22px 30px; }

.crumbbar { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; gap:12px; }
.crumbs { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.crumb { font-size:14px; font-weight:600; color:var(--muted); padding:4px 6px; border-radius:6px; }
.crumb:hover { color:var(--brand-2); background:var(--brand-soft); }
.crumb.current { color:var(--text); pointer-events:none; }
.crumb-sep { color:var(--muted-2); font-size:14px; }
.back { font-weight:600; color:var(--brand-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:8px 16px; background:var(--card); }
.back:hover { background:var(--brand-soft); border-color:var(--brand); }

.board { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:14px; }

/* Kategori kutusu */
.catbox {
    background:var(--card); border:1px solid var(--line); border-radius:var(--r);
    padding:22px 18px; min-height:104px; text-align:left;
    display:flex; flex-direction:column; justify-content:space-between; gap:10px;
    transition:transform .08s, box-shadow .15s, border-color .15s;
    position:relative; overflow:hidden;
}
.catbox::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--brand); opacity:.85; }
.catbox:hover { transform:translateY(-2px); box-shadow:var(--shadow); border-color:#cfd8e3; }
.catbox:active { transform:translateY(0); }
.cb-name { font-size:16px; font-weight:700; letter-spacing:-.01em; padding-left:8px; }
.cb-count { font-size:12px; color:var(--muted); padding-left:8px; }

/* Ürün kartı (sade, ikonsuz) */
.pcard {
    background:var(--card); border:1px solid var(--line); border-radius:var(--r);
    padding:14px 16px; min-height:104px; text-align:left;
    display:flex; flex-direction:column; transition:transform .08s, box-shadow .15s, border-color .15s;
}
.pcard:hover { transform:translateY(-2px); box-shadow:var(--shadow); border-color:#cfd8e3; }
.pcard:active { transform:translateY(0); }
.pcard .body { display:flex; flex-direction:column; gap:6px; flex:1; }
.pcard .pname { font-weight:600; line-height:1.3; }
.pcard .pdesc { color:var(--muted); font-size:12.5px; line-height:1.35;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.pcard .prow { margin-top:auto; display:flex; align-items:center; justify-content:space-between; gap:8px; padding-top:6px; }
.pcard .price { font-weight:700; font-size:15px; }
.pcard .price.open { color:var(--brand-2); font-size:13px; font-weight:600;
    background:var(--brand-soft); padding:3px 9px; border-radius:20px; }
.pcard .kdv { font-size:11px; color:var(--muted-2); }

.empty { color:var(--muted); padding:60px 20px; text-align:center; line-height:1.6; }

/* ===================== SEPET ===================== */
.cart { background:var(--card); border-left:1px solid var(--line); display:grid; grid-template-rows:auto 1fr auto; overflow:hidden; }
.cart-head { padding:16px 18px 12px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line-2); }
.cart-head h2 { font-size:16px; display:flex; align-items:center; gap:8px; }
.cart-head .count { background:var(--brand-soft); color:var(--brand-2); font-size:12px; font-weight:700; border-radius:20px; padding:2px 9px; }
.cart-head button.clear { color:var(--rose); font-size:12.5px; font-weight:600; padding:6px 8px; border-radius:var(--r-sm); }
.cart-head button.clear:hover { background:#fff1f3; }

.cart-items { overflow-y:auto; padding:8px 12px; }
.citem { border:1px solid var(--line-2); border-radius:var(--r); padding:10px 12px; margin-bottom:8px; }
.citem .top { display:flex; justify-content:space-between; gap:8px; }
.citem .cname { font-weight:600; line-height:1.25; }
.citem .x { color:var(--muted-2); font-size:14px; line-height:1; padding:2px 4px; }
.citem .x:hover { color:var(--rose); }
.citem .opts { margin:6px 0 2px; display:flex; flex-wrap:wrap; gap:5px; }
.citem .opt { font-size:11px; color:var(--muted); background:var(--card-2); border:1px solid var(--line-2); border-radius:6px; padding:2px 7px; }
.citem .opt b { color:var(--text); font-weight:600; }
.citem .opt .plus { color:var(--green); font-weight:600; }
.citem .bottom { display:flex; align-items:center; justify-content:space-between; margin-top:8px; }
.qty { display:flex; align-items:center; gap:2px; border:1px solid var(--line); border-radius:9px; }
.qty button { width:30px; height:30px; font-size:17px; color:var(--brand-2); font-weight:600; display:grid; place-items:center; }
.qty button:hover { background:var(--brand-soft); }
.qty span { min-width:30px; text-align:center; font-weight:600; }
.citem .lineprice { font-weight:700; }

.summary { border-top:1px solid var(--line); padding:14px 18px 16px; background:var(--card-2); }
.summary .row { display:flex; justify-content:space-between; padding:3px 0; color:var(--muted); font-size:13px; }
.summary .row b { color:var(--text); font-weight:600; }
.summary .total { display:flex; align-items:baseline; justify-content:space-between; margin:10px 0 14px; padding-top:12px; border-top:1px dashed var(--line); }
.summary .total .lbl { font-size:13px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
.summary .total .val { font-size:30px; font-weight:800; letter-spacing:-.02em; }

.pay-types { display:flex; gap:8px; margin-bottom:10px; }
.pay-types button { flex:1; padding:11px 8px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--card); color:var(--muted); font-weight:600; font-size:13px; }
.pay-types button.on { border-color:var(--brand); color:var(--brand-2); background:var(--brand-soft); }

.btn-pay { width:100%; height:52px; border-radius:var(--r); background:var(--brand); color:#fff; font-weight:700; font-size:16px; display:flex; align-items:center; justify-content:center; gap:10px; transition:background .15s, transform .05s; }
.btn-pay:hover { background:var(--brand-2); }
.btn-pay:active { transform:scale(.99); }
.btn-pay:disabled { background:#cbd5e1; cursor:not-allowed; }
.btn-pay .amt { margin-left:auto; }

/* ===================== MODAL ===================== */
.modal-bg { position:fixed; inset:0; background:rgba(13,17,23,.55); display:none; align-items:center; justify-content:center; z-index:50; padding:20px; }
.modal-bg.show { display:flex; }
.modal { background:var(--card); border-radius:var(--r-lg); width:100%; max-width:440px; max-height:90vh; overflow:hidden; box-shadow:var(--shadow-lg); display:flex; flex-direction:column; animation:pop .15s ease; }
@keyframes pop { from { transform:translateY(8px) scale(.98); opacity:0; } }
.modal-head { padding:18px 20px 14px; border-bottom:1px solid var(--line-2); }
.modal-head .mname { font-size:18px; font-weight:700; }
.modal-head .mprice { color:var(--brand-2); font-weight:700; margin-top:2px; }
.modal-body { padding:18px 20px; overflow-y:auto; }
.field { margin-bottom:16px; }
.field > label { display:block; font-weight:600; margin-bottom:7px; font-size:13.5px; }
.field .req { color:var(--rose); margin-left:3px; }
.field input[type=text], .field textarea { width:100%; padding:11px 12px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--card); }
.field textarea { min-height:64px; resize:vertical; }
.field input:focus, .field textarea:focus { border-color:var(--brand); outline:none; box-shadow:0 0 0 3px var(--brand-soft); }
.opt-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.opt-pick { border:1px solid var(--line); border-radius:var(--r-sm); padding:11px 12px; text-align:left; display:flex; justify-content:space-between; align-items:center; gap:8px; background:var(--card); color:var(--text); }
.opt-pick:hover { border-color:var(--brand); }
.opt-pick.on { border-color:var(--brand); background:var(--brand-soft); }
.opt-pick .pm { font-size:12px; font-weight:700; color:var(--green); white-space:nowrap; }
.modal-foot { padding:14px 20px 18px; border-top:1px solid var(--line-2); display:flex; gap:10px; align-items:center; }
.qty-mini { display:flex; align-items:center; border:1px solid var(--line); border-radius:var(--r-sm); }
.qty-mini button { width:38px; height:44px; font-size:18px; color:var(--brand-2); font-weight:700; }
.qty-mini span { min-width:34px; text-align:center; font-weight:700; }
.modal-foot .btn-add { flex:1; height:44px; border-radius:var(--r-sm); background:var(--brand); color:#fff; font-weight:700; font-size:15px; }
.modal-foot .btn-add:hover { background:var(--brand-2); }

/* ===================== TOAST ===================== */
.toast-wrap { position:fixed; bottom:22px; left:50%; transform:translateX(-50%); z-index:99; display:flex; flex-direction:column; gap:8px; align-items:center; }
.toast { background:var(--ink-800); color:#fff; padding:11px 18px; border-radius:var(--r); font-weight:500; box-shadow:var(--shadow-lg); animation:rise .2s ease; }
.toast.err { background:var(--rose); }
.toast.ok { background:var(--green); }
@keyframes rise { from { transform:translateY(10px); opacity:0; } }

.spin { width:16px; height:16px; border:2px solid rgba(255,255,255,.4); border-top-color:#fff; border-radius:50%; animation:sp .6s linear infinite; display:inline-block; }
@keyframes sp { to { transform:rotate(360deg); } }

/* ===================== RESPONSIVE ===================== */
@media (max-width:860px) {
    .main { grid-template-columns:1fr; }
    .cart { position:fixed; inset:56px 0 0 auto; width:min(92vw,400px); transform:translateX(100%); transition:transform .2s; z-index:40; box-shadow:var(--shadow-lg); }
    .cart.open { transform:translateX(0); }
}
