/* Shared by the customer pages and the admin panel: fonts, colours, order list. */
/* Baloo 2 (Ek Type) and Mukta (Ek Type), SIL Open Font License 1.1, see assets/fonts/OFL-*.txt */
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/baloo-2-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/baloo-2-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/baloo-2-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/mukta-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/mukta-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/mukta-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/mukta-latin-700-normal.woff2) format("woff2"); }

/* Colours come from the shop logo: Nepal blue and crimson, saffron orange, yellow, India green. */
:root {
  --ink: #0B2D72;          /* Nepal flag blue: header, headings */
  --ink-soft: #1D4BA8;
  --crimson: #D7192F;      /* main buttons */
  --crimson-dark: #AE1224;
  --orange: #FF8A1F;
  --orange-deep: #F2611D;
  --yellow: #FFCE1F;
  --paper: #FFFFFF;
  --bg: #FFF6EA;           /* warm page background */
  --field: #FFFDF9;
  --field-line: #D9C4AA;
  --text: #1F2133;
  --muted: #5E6175;
  --rule: #EED9C0;
  --wa: #14833F;
  --wa-dark: #0E6630;
  --warn-bg: #FFF1C9;
  --warn-ink: #6B4500;
  --focus: #1D4BA8;
  --display: "Baloo 2", "Mukta", system-ui, sans-serif;
  --ui: "Mukta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
img { display: block; max-width: 100%; }
a { color: var(--ink-soft); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Text buttons ---------- */
.link-btn {
  padding: 0; border: 0; background: none;
  font: inherit; font-size: .9rem; color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.link-btn:hover { color: var(--ink); }
.link-btn.danger { color: var(--crimson-dark); }

/* ---------- Store tags ---------- */
.store-tag {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; line-height: 1.6; white-space: nowrap;
  background: #EEF0F5; color: #3B4256;
}
.st-amazon { background: #FFE9C7; color: #7A4300; }
.st-flipkart { background: #DDE8FF; color: #183D8F; }
.st-myntra { background: #FFDDE8; color: #9A0F3B; }
.st-ajio { background: #D9F2E6; color: #0D6243; }
.st-tata1mg { background: #FFE2D8; color: #932A10; }
.st-snapdeal { background: #ECE2FF; color: #5426A6; }

/* ---------- Order list (assets/js/cart.js) ---------- */
.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px 14px;
  padding: 16px 0;
  border-bottom: 1.5px dashed var(--rule);
}
.item:first-child { padding-top: 8px; }
.item:last-child { border-bottom: 0; padding-bottom: 4px; }
.item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.item-top .link-btn { font-size: .85rem; flex: none; }
.item.is-new { animation: arrive 1.8s ease-out; }
@keyframes arrive { from { background-color: #FFF0C2; } to { background-color: transparent; } }
.item-media {
  width: 76px; height: 76px;
  border-radius: 12px; overflow: hidden;
  background: #FFF1DF;
  display: grid; place-items: center;
}
.item-media img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.item-media .ph { font-family: var(--display); font-weight: 800; font-size: 1.6rem; color: #D9A66B; }
.item-main { min-width: 0; }
.item-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: 4px 0 4px;
  color: var(--text); font-weight: 500; line-height: 1.3; text-decoration: none;
  overflow-wrap: anywhere;
}
a.item-title:hover { text-decoration: underline; }
.item-prices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; }
.item-npr { font-family: var(--display); font-weight: 800; font-size: 1.35rem; color: var(--ink); line-height: 1.25; }
.item-inr { font-size: .88rem; color: var(--muted); }
.item-line { font-size: .88rem; color: var(--muted); }
.item-warn { margin: 6px 0 0; font-size: .86rem; color: var(--warn-ink); background: var(--warn-bg); border-radius: 6px; padding: 3px 8px; display: inline-block; }
.item-status { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }

.price-entry {
  grid-column: 1 / -1;
  background: var(--warn-bg);
  border-radius: 12px;
  padding: 10px 12px 12px;
}
.price-entry p { margin: 0 0 8px; font-size: .9rem; color: var(--warn-ink); }
.price-entry.is-edit { background: #EEF3FF; }
.price-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.price-row label { font-size: .9rem; font-weight: 600; color: var(--ink); }
.inr-field { display: inline-flex; align-items: center; border: 1.5px solid var(--field-line); border-radius: 10px; background: #fff; overflow: hidden; }
.inr-field span { padding: 0 4px 0 12px; color: var(--muted); font-weight: 600; }
.inr-field input { width: 110px; border: 0; padding: 10px 10px 10px 2px; font: inherit; font-weight: 600; background: transparent; color: var(--text); }
.inr-field input:focus { outline: none; }
.inr-field:focus-within { border-color: var(--ink-soft); box-shadow: 0 0 0 3px rgba(29, 75, 168, .22); }

/* Size / colour, free size and quantity */
.item-controls {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px 10px;
}
.variant { grid-column: 1 / -1; min-width: 0; }
.variant label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.variant .req { color: var(--crimson); }
.variant input {
  width: 100%; font: inherit; font-size: .98rem;
  padding: 9px 11px; border: 1.5px solid var(--field-line); border-radius: 10px; background: var(--field); color: var(--text);
}
.variant input:focus { outline: none; border-color: var(--ink-soft); background: #fff; box-shadow: 0 0 0 3px rgba(29, 75, 168, .22); }
.variant input:disabled { background: #F4EFE7; color: var(--muted); border-style: dashed; }
.variant-err { margin: 4px 0 0; font-size: .84rem; font-weight: 600; color: var(--crimson-dark); }
.item.needs-size .variant input { border-color: var(--crimson); background: #FFF5F6; }
.free-chip {
  grid-column: 1; justify-self: start;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px 7px 9px; min-height: 40px;
  border: 1.5px solid var(--field-line); border-radius: 999px; background: #fff;
  font-size: .92rem; font-weight: 600; color: var(--ink); cursor: pointer; user-select: none;
}
.free-chip input { width: 18px; height: 18px; margin: 0; accent-color: var(--orange-deep); }
.free-chip:has(input:checked) { background: #FFF0C9; border-color: #F2B33A; }
.free-chip:focus-within { box-shadow: 0 0 0 3px rgba(29, 75, 168, .22); }
.qty { grid-column: 2; display: inline-flex; align-items: stretch; border: 1.5px solid var(--field-line); border-radius: 10px; overflow: hidden; background: #fff; }
.qty button { width: 40px; border: 0; background: #FFF1DF; color: var(--ink); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.qty button:hover { background: #FFE4C2; }
.qty input { width: 46px; border: 0; text-align: center; font: inherit; font-weight: 700; padding: 8px 0; -moz-appearance: textfield; appearance: textfield; background: #fff; color: var(--text); }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: none; background: #FFFBF4; }
.qty:focus-within { border-color: var(--ink-soft); }
@media (min-width: 560px) {
  .item-controls { grid-template-columns: minmax(0, 1fr) auto auto; }
  .variant { grid-column: 1; }
  .free-chip { grid-column: 2; }
  .qty { grid-column: 3; }
}

.is-loading .skel {
  display: block; height: 12px; border-radius: 6px; margin: 6px 0;
  background: linear-gradient(90deg, #FBE8D2 0%, #FFF6EA 40%, #FBE8D2 80%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.is-loading .skel.short { width: 55%; }
.is-loading .item-media { animation: shimmer 1.2s linear infinite; background: linear-gradient(90deg, #FBE8D2 0%, #FFF6EA 40%, #FBE8D2 80%); background-size: 200% 100%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.totals { margin: 0; display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.totals .pending dt { color: var(--warn-ink); font-weight: 600; }
.totals .grand { margin-top: 8px; padding-top: 12px; border-top: 1.5px solid var(--rule); }
.totals .grand dt { color: var(--ink); font-weight: 700; font-size: 1.1rem; }
.totals .grand dd { font-family: var(--display); font-weight: 800; font-size: 2.05rem; line-height: 1; color: var(--crimson); }

/* ---------- Form fields ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: .92rem; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.field .opt { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  display: block; width: 100%;
  font: inherit; color: var(--text);
  padding: 11px 12px;
  border: 1.5px solid var(--field-line); border-radius: 10px;
  background: var(--field);
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink-soft); background: #fff; box-shadow: 0 0 0 3px rgba(29, 75, 168, .22); }
.field [aria-invalid="true"] { border-color: var(--crimson); }
.form-msg { margin: 8px 0 0; color: var(--crimson-dark); font-weight: 600; font-size: .95rem; }
.form-msg:empty { display: none; }
.form-msg[data-kind="progress"], .form-msg[data-kind="info"] { color: var(--muted); font-weight: 400; }
.price-entry .name-field { margin-top: 10px; }
.price-entry .name-field label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.price-entry .name-field input { width: 100%; font: inherit; padding: 9px 11px; border: 1.5px solid var(--field-line); border-radius: 10px; background: #fff; }
.opt { font-weight: 400; color: var(--muted); }
