/* The Karkhana ordering site. Warm bakehouse look, mobile first. */
:root {
  --cream: #f6eee1; --paper: #fffaf2; --ink: #2a1c13; --ink2: #4a3626; --muted: #7a6753; --line: #e7dccb; --line2: #d8c8b1;
  --accent: #b6461a; --accent-d: #923612; --accent-s: #f7e2d6; --gold: #e2a043; --gold-s: #fbecd2; --green: #2f6b3f; --green-s: #e3f0e4; --red: #a8261b;
  --serif: "Fraunces", Georgia, "Times New Roman", serif; --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --hindi: "Tiro Devanagari Hindi", "Noto Serif Devanagari", serif;
  --r: 16px; --shadow: 0 1px 2px rgba(42, 28, 19, .06), 0 8px 24px -12px rgba(42, 28, 19, .18);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.5 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .5; z-index: -1;
  background-image: radial-gradient(rgba(122, 103, 83, .09) 1px, transparent 1px); background-size: 18px 18px; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #f7ecd9; padding-top: env(safe-area-inset-top); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--gold); color: var(--ink); display: grid; place-items: center; font: 22px/1 var(--hindi); flex: none; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-t { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-hi { font: 13px/1.2 var(--hindi); color: var(--gold); }
.brand-en { font: 600 19px/1.1 var(--serif); letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top-nav a, .top-nav button { display: inline-flex; align-items: center; gap: 6px; color: #f7ecd9; text-decoration: none; background: none; border: 0; padding: 8px 10px; border-radius: 999px; font-size: 14.5px; font-weight: 500; cursor: pointer; }
.top-nav a:hover, .top-nav button:hover { background: rgba(255, 255, 255, .08); }
.top-nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); }
.top-nav .ic { width: 20px; height: 20px; }
.top-nav .cart-btn { background: var(--gold); color: var(--ink); font-weight: 600; padding: 8px 14px; }
.top-nav .cart-btn:hover { background: #ebb060; }
.top-nav .cart-n { background: var(--ink); color: var(--gold); border-radius: 999px; min-width: 20px; height: 20px; font-size: 12px; display: grid; place-items: center; padding: 0 6px; }
.top-nav .lbl { display: none; }
@media (min-width: 640px) { .top-nav .lbl { display: inline; } }
.ic { width: 20px; height: 20px; flex: none; }

/* ---------- layout ---------- */
.view { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px 120px; outline: none; }
.narrow { max-width: 560px; margin: 0 auto; }
.mid { max-width: 760px; margin: 0 auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(30px, 6vw, 46px); line-height: 1.05; }
h2 { font-size: 24px; line-height: 1.15; }
h3 { font-size: 19px; line-height: 1.2; }
em, .it { font-style: italic; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.page-h { padding: 28px 0 16px; }
.page-h p { margin: 6px 0 0; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 14.5px; margin-top: 18px; }
.back:hover { color: var(--ink); }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--line2); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 11px 20px; font-weight: 600; font-size: 15.5px; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; min-height: 46px; }
.btn:hover { border-color: var(--ink2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #f7ecd9; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(42, 28, 19, .06); }
.btn.block { width: 100%; }
.btn.big { min-height: 54px; font-size: 17px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn .ic { width: 18px; height: 18px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.f { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.f label, .lbl-t { font-weight: 600; font-size: 14.5px; }
.f .hint { font-size: 13.5px; color: var(--muted); margin: 0; }
.opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input:not([type]), textarea, select { width: 100%; border: 1.5px solid var(--line2); border-radius: 12px; background: #fff; padding: 12px 14px; font-size: 16px; min-height: 48px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-s); }
.row2 { display: grid; gap: 0 12px; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; } }
.err { color: var(--red); font-weight: 500; margin: 0 0 12px; }
.code-in { font: 600 30px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 10px; text-align: center; }

/* ---------- hero ---------- */
.hero { position: relative; margin: 18px 0 8px; border-radius: 24px; background: var(--ink); color: #f7ecd9; overflow: hidden; padding: 34px 24px 30px; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #e2a043 0, #c9772a 45%, transparent 70%); opacity: .55; }
.hero > * { position: relative; z-index: 1; }
.hero .kicker { font: 500 13px/1 var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--gold); margin: 0 0 14px; }
.hero h1 { max-width: 15ch; }
.hero h1 em { color: var(--gold); font-weight: 400; }
.hero p.lead { margin: 14px 0 0; max-width: 46ch; color: #e3d3bc; font-size: 16.5px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero .btn:not(.primary) { background: transparent; color: #f7ecd9; border-color: rgba(247, 236, 217, .35); }
.hero .btn:not(.primary):hover { border-color: #f7ecd9; }
.hero .hello { font: italic 400 20px/1.2 var(--serif); color: var(--gold); margin: 0 0 6px; }
@media (min-width: 760px) { .hero { padding: 48px 44px 44px; } .hero::after { width: 380px; height: 380px; right: -80px; top: -100px; } }

.notice { background: var(--gold-s); border: 1px solid #efd3a1; border-radius: 14px; padding: 12px 16px; margin: 14px 0; font-size: 15px; }
.notice.red { background: #f9e1dc; border-color: #eebbb2; }
.notice.green { background: var(--green-s); border-color: #c3dec7; }

/* ---------- order again ---------- */
.again { display: flex; align-items: center; gap: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 14px 0 4px; box-shadow: var(--shadow); }
.again .t { flex: 1; min-width: 0; }
.again .t b { display: block; font-family: var(--serif); font-size: 17px; }
.again .t span { color: var(--muted); font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- catalog ---------- */
.cats { position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 10; display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px 10px; margin: 0 -16px; background: linear-gradient(var(--cream) 80%, transparent); scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line2); background: var(--paper); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: #f7ecd9; border-color: var(--ink); }
.cat-h { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 12px; scroll-margin-top: 130px; }
.cat-h h2 { font-size: 26px; }
.cat-h span { color: var(--muted); font-size: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.prod { display: flex; flex-direction: column; overflow: hidden; }
.prod .ph { aspect-ratio: 16 / 10; background: var(--gold-s); position: relative; overflow: hidden; }
.prod .ph img { width: 100%; height: 100%; object-fit: cover; }
.prod .ph svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.prod .tags { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { background: rgba(255, 250, 242, .92); color: var(--ink2); font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; }
.tag.veg { color: var(--green); }
.prod .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.prod .nm { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.prod h3 { font-size: 20px; }
.prod .price { font-weight: 700; white-space: nowrap; }
.prod .price small { font-weight: 500; color: var(--muted); font-size: 13px; }
.prod .price.req { font-weight: 500; color: var(--muted); font-size: 14px; }
.prod .desc { color: var(--muted); font-size: 14.5px; margin: 0; flex: 1; }
.prod .act { margin-top: 10px; display: flex; gap: 10px; align-items: center; }
.prod .act .btn { flex: 1; }
@media (max-width: 559px) {
  .prod { display: grid; grid-template-columns: 108px minmax(0, 1fr); }
  .prod .ph { aspect-ratio: auto; min-height: 100%; }
  .prod .ph svg { transform: scale(1.5); }
  .prod .tags { left: 6px; top: 6px; }
  .prod .tag { font-size: 11px; padding: 3px 7px; }
  .prod .body { padding: 12px 14px 14px; gap: 4px; }
  .prod h3 { font-size: 18px; }
  .prod .nm { flex-direction: column; gap: 2px; }
  .prod .desc { font-size: 13.5px; }
  .prod .act { margin-top: 8px; }
  .prod .act .btn { min-height: 42px; padding: 8px 14px; font-size: 15px; }
  .step { height: 42px; }
}
.prod.in { border-color: var(--gold); box-shadow: 0 0 0 1.5px var(--gold), var(--shadow); }

.step { display: inline-flex; align-items: center; border: 1.5px solid var(--line2); border-radius: 999px; background: #fff; height: 46px; flex: none; }
.step button { width: 44px; height: 100%; border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink); border-radius: 999px; }
.step button:hover { background: var(--cream); }
.step input { width: 52px; border: 0; text-align: center; font-weight: 700; font-size: 16px; min-height: 0; padding: 0; background: none; box-shadow: none !important; }
.step .u { font-size: 13px; color: var(--muted); padding-right: 12px; margin-left: -4px; white-space: nowrap; }
.prod .act .step { flex: 1; justify-content: space-between; }

/* ---------- bottom cart bar (phones) ---------- */
.cartbar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30; }
.cartbar a { display: flex; align-items: center; gap: 12px; background: var(--accent); color: #fff; text-decoration: none; border-radius: 999px; padding: 14px 20px; font-weight: 600; box-shadow: 0 10px 30px -8px rgba(146, 54, 18, .6); max-width: 560px; margin: 0 auto; }
.cartbar .n { background: rgba(0, 0, 0, .2); border-radius: 999px; padding: 2px 10px; font-size: 14px; }
.cartbar .t { margin-left: auto; }
@media (min-width: 900px) { .cartbar { display: none; } }

/* ---------- cart & checkout ---------- */
.checkout { display: grid; gap: 18px; align-items: start; grid-template-columns: minmax(0, 1fr); }
.checkout > * { min-width: 0; }
@media (min-width: 900px) { .checkout { grid-template-columns: minmax(0, 1fr) 360px; } .summary { position: sticky; top: 84px; } }
.sec { padding: 18px; margin-bottom: 14px; }
.sec h2 { font-size: 21px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.sec h2 .num { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--gold); font: 600 14px/26px var(--sans); text-align: center; flex: none; }
.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line:last-child { border-bottom: 0; }
.line .th { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: var(--gold-s); position: relative; }
.line .th img, .line .th svg { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.line .th svg { transform: scale(1.7); }
.line .nm { font-weight: 600; }
.line .sub { color: var(--muted); font-size: 14px; }
.line .ctl { grid-column: 2; display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.line .amt { font-weight: 700; }
.line .rm { background: none; border: 0; color: var(--muted); font-size: 13.5px; cursor: pointer; text-decoration: underline; padding: 4px; }
@media (min-width: 560px) { .line { grid-template-columns: 56px 1fr auto; } .line .ctl { grid-column: auto; } }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg label { border: 1.5px solid var(--line2); border-radius: 14px; padding: 14px; cursor: pointer; background: #fff; display: flex; gap: 10px; align-items: flex-start; }
.seg label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); background: #fffaf6; }
.seg input { accent-color: var(--accent); margin-top: 3px; }
.seg b { display: block; }
.seg span { font-size: 13.5px; color: var(--muted); }
.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.day { flex: none; width: 74px; border: 1.5px solid var(--line2); border-radius: 14px; background: #fff; padding: 10px 4px; text-align: center; cursor: pointer; }
.day .w { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.day .d { font: 600 24px/1.1 var(--serif); }
.day .m { font-size: 12.5px; color: var(--muted); }
.day[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #f7ecd9; }
.day[aria-pressed="true"] .w, .day[aria-pressed="true"] .m { color: var(--gold); }
.slots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.summary { padding: 18px; }
.summary h2 { font-size: 21px; margin-bottom: 10px; }
.tot { list-style: none; margin: 0 0 14px; padding: 0; }
.tot li { display: flex; justify-content: space-between; padding: 6px 0; color: var(--ink2); }
.tot li.big { border-top: 1.5px solid var(--line2); margin-top: 6px; padding-top: 12px; font-size: 19px; font-weight: 700; color: var(--ink); }
.tot li.big span:first-child { font-family: var(--serif); }
.when { background: var(--cream); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 14.5px; }

/* ---------- orders ---------- */
.olist { display: grid; gap: 12px; }
.ord { padding: 16px; display: grid; gap: 8px; text-decoration: none; color: inherit; }
.ord:hover { border-color: var(--line2); }
.ord .h { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ord .h b { font: 600 19px/1.2 var(--serif); }
.ord .items { color: var(--muted); font-size: 14.5px; margin: 0; }
.ord .f2 { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 600; background: var(--gold-s); color: #7a4f0f; white-space: nowrap; }
.pill.confirmed { background: #e3ebf7; color: #23477a; }
.pill.ready { background: var(--green-s); color: var(--green); }
.pill.done { background: #ece6dd; color: var(--ink2); }
.pill.cancelled { background: #f6dfdb; color: var(--red); }
.track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 16px 0 6px; }
.track div { text-align: center; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.track div::before { content: ""; display: block; height: 6px; border-radius: 6px; background: var(--line); margin-bottom: 8px; }
.track div.on { color: var(--ink); }
.track div.on::before { background: var(--accent); }
.big-ok { text-align: center; padding: 28px 18px; }
.big-ok .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin: 0 auto 14px; }
.big-ok .tick svg { width: 34px; height: 34px; }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv li:last-child { border-bottom: 0; }
.kv li span:first-child { color: var(--muted); }
.kv li span:last-child { text-align: right; }

/* ---------- empty, loading, footer, toast ---------- */
.empty { text-align: center; padding: 40px 16px; }
.empty .art { width: 120px; margin: 0 auto 12px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.loading::before { content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 10px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, var(--line) 0, #f1e8da 50%, var(--line) 100%); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: var(--r); height: 280px; }
@keyframes sh { to { background-position: -200% 0; } }
.foot { background: var(--ink); color: #cdb99b; font-size: 14px; padding: 28px 16px calc(28px + env(safe-area-inset-bottom)); }
.foot-in { max-width: 1120px; margin: 0 auto; display: grid; gap: 14px; }
.foot b { color: #f7ecd9; font: 600 18px/1.2 var(--serif); }
.foot a { color: var(--gold); }
@media (min-width: 760px) { .foot-in { grid-template-columns: 1fr auto; align-items: end; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 50; background: var(--ink); color: #f7ecd9; padding: 12px 18px; border-radius: 999px; font-weight: 500; box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center; }
@media (min-width: 900px) { .toast { bottom: 28px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
