:root {
  --red: #9f1d1d;
  --red-dark: #6f1212;
  --gold: #c8922a;
  --ink: #24160f;
  --muted: #6d5848;
  --paper: #fff8f1;
  --card: #fff;
  --line: #eadccb;
  --ok: #1f6b3a;
  --err: #9f1d1d;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
}
img { max-width: 100%; height: auto; }
a { color: var(--red-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button, .button {
  display: inline-block;
  background: var(--red);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.15rem;
  text-decoration: none;
  cursor: pointer;
}
button.secondary, a.secondary { background: transparent; color: var(--red-dark); border: 1px solid var(--red); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.linkish { background: transparent; color: var(--red-dark); padding: 0.35rem 0; }
label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 650; margin: 0.8rem 0; }
input, select, textarea {
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-weight: 450;
}
textarea { resize: vertical; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: #fff;
  padding: 0.4rem 0.6rem;
}
.skip:focus { top: 0.5rem; z-index: 20; }
.wrap { width: min(1120px, calc(100% - 1.5rem)); margin: 0 auto; }
.site-header { background: var(--red-dark); color: #fff; border-bottom: 4px solid var(--gold); }
.header-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 0.55rem 0 0.2rem; }
.site-nav { display: flex; gap: 0.85rem; flex-wrap: wrap; padding: 0.15rem 0 0.55rem; }
.site-nav a { color: #fff; font-weight: 650; text-decoration: none; }
.brand { display: flex; gap: 0.7rem; align-items: center; color: #fff; text-decoration: none; }
.brand img { width: 72px; height: auto; background: #fff; border-radius: 50%; }
.brand strong { display: block; font-size: 1.15rem; }
.brand small, .header-meta { color: #f6e2c4; }
.header-meta { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.phone { color: #fff; font-weight: 700; }
.min-pill { border: 1px solid var(--gold); border-radius: 999px; padding: 0.25rem 0.6rem; color: #fff; }
.page-intro, .review { padding: 1.25rem 0 2rem; }
h1 { font-size: 1.8rem; line-height: 1.15; margin: 0.2rem 0 0.6rem; }
h2 { font-size: 1.25rem; margin: 0 0 0.6rem; }
h3 { margin: 0; font-size: 1rem; }
.fine, .product p, .steps p { color: var(--muted); }
.catalogue { padding-bottom: 1rem; }
.cat-tools { display: grid; gap: 0.6rem; margin-bottom: 0.8rem; }
.cat-tools label { margin: 0; }
.catalogue-grid { display: grid; gap: 1rem; }
.cat-nav { display: none; }
.category { margin: 0 0 0.45rem; }
.category h2 {
  position: sticky;
  top: 0;
  background: var(--paper);
  padding: 0.2rem 0;
  margin-bottom: 0.15rem;
  border-bottom: 2px solid var(--gold);
}
.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5rem auto;
  gap: 0.1rem 0.55rem;
  align-items: center;
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.product-copy p { margin: 0.05rem 0 0; }
.product .linkish { grid-column: 1 / -1; justify-self: start; }
.line-total {
  margin: 0;
  width: 7.5rem;
  font-weight: 750;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.stepper { display: flex; align-items: center; justify-content: flex-end; }
.stepper button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  padding: 0;
}
.stepper input { width: 3.1rem; text-align: center; border-radius: 0; margin: 0; padding: 0.35rem 0.2rem; }
.estimate {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  padding: 0.7rem 1rem;
  background: #fff;
  border-top: 3px solid var(--gold);
  box-shadow: 0 -6px 20px rgba(36, 22, 15, 0.08);
}
.estimate strong { display: block; }
.estimate span { color: var(--muted); font-size: 0.92rem; }
body.public:has(.estimate:not([hidden])) { padding-bottom: 5.6rem; }
.notice {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(36, 22, 15, 0.62);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.notice-card {
  width: min(38rem, 100%);
  max-height: min(90vh, 44rem);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  border-top: 6px solid var(--gold);
  padding: 1.1rem 1.15rem 1.2rem;
}
.eyebrow { margin: 0; color: var(--gold); font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.78rem; }
.site-footer { background: #2a1810; color: #f6efe6; padding: 2rem 0 2.4rem; }
.site-footer section { scroll-margin-top: 1rem; }
.site-footer a { color: #f0d48a; }
.site-footer h2 { color: #fff; }
.site-footer .fine { color: #f6efe6; font-size: 1rem; font-weight: 650; }
.site-footer .panel { color: var(--ink); }
.site-footer .panel h2,
.site-footer .panel h3 { color: var(--ink); }
.site-footer .panel p { color: var(--muted); }
.site-footer li { margin: 0.35rem 0; }
.to-top {
  position: fixed;
  right: 0.85rem;
  bottom: 5.3rem;
  z-index: 6;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
}
.to-top[hidden] { display: none; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; margin: 1rem 0; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; }
.steps span {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-weight: 700;
}
.flash { background: #e8f6ec; border-radius: 10px; padding: 0.7rem 0.8rem; }
.flash-err { background: #fde8e4; }
.min-note { background: #fff4d8; border-radius: 10px; padding: 0.65rem 0.75rem; }
.total-line { font-size: 1.15rem; }
.enquiry-no { font-size: 1.6rem; font-weight: 800; color: var(--red-dark); }
.back { margin-top: 0; }
.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 1rem; }
.auth-card { width: min(28rem, 100%); background: #fff; border-radius: 16px; padding: 1.2rem; border-top: 6px solid var(--gold); }
.auth-card img { width: 84px; height: auto; }
.qr { background: #fff; width: fit-content; padding: 0.4rem; border: 1px solid var(--line); }
.qr svg, .qr img { width: 220px; height: auto; display: block; }
.secret { font-family: Consolas, ui-monospace, monospace; letter-spacing: 0.04em; }
.admin-main { padding-top: 1rem; padding-bottom: 2rem; }
.admin-nav { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.admin-nav a { color: #fff; font-weight: 700; }
.filters, .upload { display: grid; gap: 0.6rem; align-items: end; }
.stack { max-width: 36rem; }
.check { flex-direction: row; align-items: center; }
.check input { width: auto; }
.table-cards { width: 100%; border-collapse: collapse; background: #fff; }
.table-cards th, .table-cards td { text-align: left; padding: 0.55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.badge { display: inline-block; border-radius: 999px; padding: 0.15rem 0.55rem; background: #f6e7d4; font-size: 0.85rem; }
.badge[data-status="delivered"] { background: #d9f2e1; }
.badge[data-status="dropped"] { background: #f3d6d2; }
.badge[data-status="shipped"], .badge[data-status="packed"] { background: #f8ebc8; }
.facts { display: grid; gap: 0.45rem; }
.facts div { display: grid; grid-template-columns: 7rem 1fr; gap: 0.4rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
dialog {
  width: min(760px, 100%);
  max-height: 100%;
  border: 0;
  border-top: 6px solid var(--gold);
  padding: 0 0 1rem;
}
.dialog-bar { display: flex; justify-content: flex-end; padding: 0.5rem 0.6rem 0; position: sticky; top: 0; background: #fff; }
dialog .detail { padding: 0 1rem; }
.pager { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.admin td form { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; margin: 0.25rem 0; }
.admin td select, .admin td button { width: auto; }

@media (min-width: 900px) {
  .cat-tools { grid-template-columns: 1fr 16rem; }
  .cat-jump { display: none; }
  .catalogue-grid { grid-template-columns: 16.5rem 1fr; align-items: start; }
  .cat-nav { display: block; position: sticky; top: 0.6rem; }
  .cat-nav ul { list-style: none; padding: 0; margin: 0; }
  .cat-nav a { display: block; padding: 0.35rem 0.4rem 0.35rem 0; text-decoration: none; overflow-wrap: anywhere; }
  .product { grid-template-columns: minmax(0, 1fr) 7.5rem auto; }
  .filters { grid-template-columns: 1fr 14rem auto; }
  .upload { grid-template-columns: 1fr auto; }
}

@media (max-width: 899px) {
  .public .site-header { position: sticky; top: 0; z-index: 12; }
  .public .cat-tools {
    position: sticky;
    top: var(--header-h, 7.5rem);
    z-index: 11;
    background: var(--paper);
    padding: 0.35rem 0 0.45rem;
  }
  .category { scroll-margin-top: calc(var(--header-h, 7.5rem) + 5.5rem); }
  .site-footer section { scroll-margin-top: calc(var(--header-h, 7.5rem) + 0.75rem); }
  .category h2 { position: static; }
  .brand img { width: 48px; }
  .header-row { align-items: center; }
  .product { grid-template-columns: 1fr auto; padding: 0.35rem 0; }
  .product-copy { grid-column: 1 / -1; }
  .line-total { justify-self: start; }
  .table-cards thead { display: none; }
  .table-cards tr { display: block; margin: 0 0 0.7rem; border: 1px solid var(--line); border-radius: 12px; padding: 0.35rem 0.55rem; background: #fff; }
  .table-cards td { display: flex; justify-content: space-between; gap: 1rem; border: 0; }
  .table-cards td::before { content: attr(data-label); color: var(--muted); font-weight: 700; }
  dialog { width: 100%; height: 100%; max-height: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
