/* KingShoppers — shared styles for the shop and admin. Hand-written, no build step. */
:root {
  --saffron: #E8740C;
  --saffron-dark: #C25E06;
  --saffron-soft: #FDEBD8;
  --navy: #1B2A4A;
  --navy-2: #26395F;
  --ink: #1D2433;
  --muted: #5F6B7D;
  --line: #E3E6EC;
  --bg: #F2F4F7;
  --card: #FFFFFF;
  --green: #0F7B4B;
  --green-soft: #DDF3E8;
  --red: #C62828;
  --red-soft: #FCE4E4;
  --amber-soft: #FFF4D6;
  --blue-soft: #E3EDFC;
  --radius: 10px;
  --font: "Mukta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
[x-cloak] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .tiny { font-size: .78rem; }
.strike { text-decoration: line-through; color: var(--muted); }
.green { color: var(--green); } .red { color: var(--red); } .bold { font-weight: 700; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.row { display: flex; gap: 12px; align-items: center; } .row.wrap { flex-wrap: wrap; } .spread { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1; min-width: 0; }
.hide-sm { } @media (max-width: 720px) { .hide-sm { display: none !important; } }
.only-sm { display: none; } @media (max-width: 720px) { .only-sm { display: initial; } }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent;
  background: var(--saffron); color: #fff; font-weight: 700; padding: 10px 18px; border-radius: 8px; cursor: pointer;
  line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--saffron-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.navy { background: var(--navy); } .btn.navy:hover { background: var(--navy-2); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); } .btn.ghost:hover { border-color: var(--muted); }
.btn.danger { background: #fff; color: var(--red); border-color: #F2C4C4; } .btn.danger:hover { background: var(--red-soft); }
.btn.green { background: var(--green); color: #fff; }
.btn.sm { padding: 6px 12px; font-size: .875rem; } .btn.block { width: 100%; } .btn.lg { padding: 14px 22px; font-size: 1.05rem; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 4px; }
.input, select.input, textarea.input { width: 100%; padding: 10px 12px; border: 1px solid #CDD2DB; border-radius: 8px; background: #fff; }
.input:focus { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 3px var(--saffron-soft); }
textarea.input { min-height: 90px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--saffron); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.err { color: var(--red); font-size: .85rem; margin-top: 3px; }

/* ---------- Surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-h h2, .card-h h3 { margin: 0; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge.placed, .badge.pending { background: var(--amber-soft); color: #8A5A00; }
.badge.confirmed, .badge.packed { background: var(--blue-soft); color: #1F4F99; }
.badge.out_for_delivery { background: var(--saffron-soft); color: var(--saffron-dark); }
.badge.delivered, .badge.paid, .badge.approved, .badge.active { background: var(--green-soft); color: var(--green); }
.badge.cancelled, .badge.returned, .badge.blocked, .badge.inactive { background: var(--red-soft); color: var(--red); }
.badge.partial { background: var(--blue-soft); color: #1F4F99; }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; }
.flash.ok { background: var(--green-soft); color: var(--green); } .flash.bad { background: var(--red-soft); color: var(--red); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .big { font-size: 2.4rem; }

table.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th { text-align: left; font-weight: 700; font-size: .82rem; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #FAFBFC; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:nth-child(even) td { background: #FBFCFD; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }
.pager { display: flex; gap: 6px; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-size: .9rem; }
.pager .on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- The rate tag: price + margin, the signature element ---------- */
.rate { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.rate .price { font-size: 1.15rem; font-weight: 800; }
.rate .mrp { font-size: .82rem; }
.margin-tag { position: relative; display: inline-block; background: var(--green); color: #fff; font-weight: 800; font-size: .76rem;
  padding: 2px 8px 2px 14px; border-radius: 0 4px 4px 0; line-height: 1.5; }
.margin-tag::before { content: ""; position: absolute; left: -7px; top: 0; border-style: solid; border-width: 10.5px 7px 10.5px 0;
  border-color: transparent var(--green) transparent transparent; }
.margin-tag::after { content: ""; position: absolute; left: 3px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: #fff; }

/* ---------- Shop chrome ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 40; }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.logo { font-weight: 800; font-size: 1.35rem; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo .crown { width: 32px; height: 32px; border-radius: 8px; background: var(--saffron); display: grid; place-items: center; font-size: 1.05rem; }
.searchbar { flex: 1; position: relative; }
.searchbar input { width: 100%; border: 0; border-radius: 8px; padding: 11px 14px 11px 40px; background: #fff; color: var(--ink); }
.searchbar svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.top-actions { display: flex; gap: 6px; align-items: center; }
.top-actions a { padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: .92rem; display: flex; gap: 6px; align-items: center; }
.top-actions a:hover { background: rgba(255,255,255,.1); }
.cart-pill { background: var(--saffron); }
.cart-pill:hover { background: var(--saffron-dark) !important; }
.count { background: #fff; color: var(--saffron-dark); border-radius: 99px; padding: 0 7px; font-size: .78rem; font-weight: 800; }
@media (max-width: 720px) {
  .topbar-in { flex-wrap: wrap; gap: 10px; }
  .searchbar { order: 3; flex-basis: 100%; }
  .logo { font-size: 1.15rem; }
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 16px; }
.shop-main { min-height: 70vh; padding-bottom: 90px; }

.catbar { background: #fff; border-bottom: 1px solid var(--line); }
.catbar-in { max-width: 1240px; margin: 0 auto; display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; scrollbar-width: none; }
.catbar a { white-space: nowrap; padding: 6px 12px; border-radius: 99px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.catbar a.on, .catbar a:hover { background: var(--saffron-soft); color: var(--saffron-dark); }

.hero { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero a, .hero div.banner { scroll-snap-align: start; border-radius: var(--radius); color: #fff; padding: 22px; min-height: 140px; display: flex; flex-direction: column; justify-content: flex-end; background-size: cover; background-position: center; }
.hero .t { font-size: 1.35rem; font-weight: 800; line-height: 1.2; max-width: 22ch; }
.hero .s { opacity: .9; margin-top: 4px; font-size: .95rem; max-width: 40ch; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.cats a { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 6px; text-align: center; font-size: .82rem; font-weight: 600; line-height: 1.25; }
.cats a:hover { border-color: var(--saffron); }
.cats .ic { font-size: 1.7rem; display: block; margin-bottom: 4px; }

.sec-h { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 0 12px; }
.sec-h h2 { margin: 0; }
.sec-h a { color: var(--saffron-dark); font-weight: 700; font-size: .92rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
@media (max-width: 480px) { .grid { grid-template-columns: 1fr 1fr; gap: 8px; } }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.pcard .img { aspect-ratio: 1; border-radius: 8px; background: #F6F7F9; display: grid; place-items: center; overflow: hidden; }
.pcard .img img { width: 100%; height: 100%; object-fit: contain; }
.pcard .ph { font-size: 2.2rem; font-weight: 800; color: #C9CED8; }
.pcard .nm { font-weight: 600; font-size: .92rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.pcard .pk { font-size: .8rem; color: var(--muted); }
.pcard .slab { font-size: .76rem; color: var(--navy); background: var(--blue-soft); border-radius: 6px; padding: 3px 7px; }
.pcard .oos { position: absolute; inset: 10px 10px auto 10px; aspect-ratio: 1; background: rgba(255,255,255,.75); display: grid; place-items: center; font-weight: 800; color: var(--red); border-radius: 8px; }
.pcard .mt { margin-top: auto; }

.stepper { display: flex; align-items: stretch; border-radius: 8px; overflow: hidden; border: 1px solid var(--saffron); height: 38px; }
.stepper button { width: 38px; border: 0; background: var(--saffron); color: #fff; font-size: 1.2rem; font-weight: 800; cursor: pointer; }
.stepper input { flex: 1; min-width: 0; width: 48px; border: 0; text-align: center; font-weight: 800; }
.add-btn { height: 38px; width: 100%; border: 1px solid var(--saffron); color: var(--saffron-dark); background: #fff; border-radius: 8px; font-weight: 800; cursor: pointer; }
.add-btn:hover { background: var(--saffron-soft); }

.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: transparent; pointer-events: none; }
.cartbar a { pointer-events: auto; max-width: 640px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; background: var(--green); color: #fff; border-radius: 10px; padding: 12px 18px; font-weight: 700; box-shadow: 0 6px 18px rgba(15,123,75,.35); }

.sum-row { display: flex; justify-content: space-between; padding: 5px 0; }
.sum-row.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; font-size: 1.15rem; font-weight: 800; }
.pay-opt { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 12px; cursor: pointer; margin-bottom: 8px; }
.pay-opt.on { border-color: var(--saffron); background: #FFF9F2; }
.pay-opt.off { opacity: .5; cursor: not-allowed; }

.two-col { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 30px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.timeline li.done .dot { background: var(--green); border-color: var(--green); }
.timeline li.done::before { background: var(--green); }
.map { width: 100%; height: 340px; border-radius: var(--radius); background: #E8ECF1; z-index: 0; }
.otp-box { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.otp-box .code { font-size: 1.8rem; font-weight: 800; letter-spacing: .25em; color: #FFD9B0; }

.foot { background: var(--navy); color: #C8D0DE; margin-top: 30px; }
.foot .wrap { padding: 26px 16px; font-size: .9rem; }

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; }
.auth-side h1 { font-size: 2.3rem; max-width: 14ch; }
.auth-side ul { padding-left: 18px; color: #C8D0DE; }
.auth-form { display: grid; place-items: center; padding: 24px; }
.auth-form .card { width: 100%; max-width: 400px; padding: 28px; }
@media (max-width: 820px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { padding: 28px 20px; } .auth-side h1 { font-size: 1.6rem; } .auth-side ul { display: none; } }

/* ---------- Admin ---------- */
.adm { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #C8D0DE; padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { color: #fff; padding: 6px 8px 16px; font-size: 1.15rem; }
.side .grp { font-size: .76rem; color: #8392AD; padding: 14px 10px 4px; font-weight: 700; }
.side a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 7px; font-size: .93rem; font-weight: 500; }
.side a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side a.on { background: var(--saffron); color: #fff; font-weight: 700; }
.side .ico { width: 20px; text-align: center; }
.adm-main { min-width: 0; }
.adm-top { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; }
.adm-body { padding: 22px; }
.page-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-h h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .v { font-size: 1.55rem; font-weight: 800; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.stat.warn .v { color: var(--saffron-dark); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .input { width: auto; min-width: 140px; padding: 8px 10px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 6px 12px; border-radius: 99px; font-weight: 600; font-size: .88rem; background: #fff; border: 1px solid var(--line); }
.tabs a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .bar { width: 100%; max-width: 38px; background: var(--saffron); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .bl { font-size: .72rem; color: var(--muted); }
.thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: #F0F2F5; display: grid; place-items: center; font-weight: 800; color: #B4BAC6; font-size: .8rem; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .adm { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; width: 250px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .adm-body { padding: 14px; }
}
@media print {
  .no-print, .side, .adm-top, .topbar, .catbar, .foot, .cartbar { display: none !important; }
  body { background: #fff; } .adm { display: block; } .card { border: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input[type=number] { -moz-appearance: textfield; }

/* ---- SPA navigation progress bar ---- */
.ks-progress{position:fixed;top:0;left:0;height:3px;width:0;z-index:9999;
  background:linear-gradient(90deg,var(--brand,#E8740C),#ffb062);
  border-radius:0 3px 3px 0;opacity:0;pointer-events:none;
  box-shadow:0 0 8px rgba(232,116,12,.6)}
.ks-progress.run{opacity:1;width:92%;transition:width 6s cubic-bezier(.1,.6,.2,1),opacity .15s}
.ks-progress.done{opacity:0;width:100%;transition:width .18s ease-out,opacity .3s ease-in .1s}
@media (prefers-reduced-motion:reduce){.ks-progress{transition:none!important}}

/* ---- brand mark ---- */
.logo{display:inline-flex;align-items:center;gap:9px}
.ks-logo-mark{flex:0 0 auto;display:block}

/* ---- policy / rules pages ---- */
.policy-wrap{display:grid;grid-template-columns:minmax(0,1fr) 240px;gap:18px;align-items:start}
.policy-doc{padding:26px 30px}
.policy-doc h1{margin:0 0 10px;font-size:26px;line-height:1.25}
.policy-lede{margin:0 0 18px;font-size:16px;color:var(--muted,#5A6679);font-weight:600}
.policy-body{font-size:15px;line-height:1.72;max-width:68ch}
.policy-body p{margin:0 0 14px}
.policy-body ul{margin:0 0 16px;padding-left:20px}
.policy-body li{margin:0 0 7px}
.policy-updated{margin:22px 0 0;padding-top:14px;border-top:1px solid var(--line,#E6E9EF)}
.policy-nav{padding:18px 20px;position:sticky;top:84px}
.policy-nav h3{margin:0 0 10px;font-size:14px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted,#5A6679)}
.policy-nav ul{margin:0;padding:0;list-style:none}
.policy-nav li{margin:0 0 9px}
.policy-nav a{font-weight:600}
@media (max-width:860px){.policy-wrap{grid-template-columns:1fr}.policy-nav{position:static}.policy-doc{padding:20px}}
