/* ==========================================================================
   DBpixelhouse Booking Portal — stylesheet
   Theme via CSS custom properties; [data-theme="light|dark"] on <html>.
   ========================================================================== */

/* ── Brand font: DIN 2014 ─────────────────────────────────────────────────── */
@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN 2014 Extra Light.otf") format("opentype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN 2014 Extra Light Italic.otf") format("opentype");
  font-weight: 200;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN 2014 Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN 2014 Light Italic.otf") format("opentype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN 2014 Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN 2014 Regular Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN 2014 Demi.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN 2014 Demi Italic.otf") format("opentype");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN 2014 Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN 2014 Bold Italic.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN 2014 Extra Bold.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN 2014 Extra Bold Italic.otf") format("opentype");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --highlight: #FF6A14;
  --highlight-2: #ff8845;
  --highlight-deep: #e0590d;
  --highlight-ink: #0A0A0A;
  --radius-lg: 10px;
  --radius: 7px;
  --radius-sm: 5px;
  --maxw: 1180px;
  --glass-blur: blur(16px) saturate(160%);
  --font: "DIN 2014", "Inter", "Segoe UI", Roboto, Helvetica, Arial, system-ui, sans-serif;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.08);
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  --ring: 0 0 0 3px rgba(255, 106, 20, 0.22);
  /* Viewport-fixed orange glow used on the page background and reused by the
     stuck catalogue bar so it matches the frosted header exactly. */
  --page-glow:
    radial-gradient(46rem 46rem at 12% -8%, rgba(255, 106, 20, 0.16), transparent 60%),
    radial-gradient(40rem 40rem at 105% 8%, rgba(255, 136, 69, 0.12), transparent 60%),
    radial-gradient(38rem 38rem at 50% 120%, rgba(255, 106, 20, 0.10), transparent 60%);
}

/* Dark theme (default) */
:root,
[data-theme="dark"] {
  --bg: #0A0A0A;
  --surface: #161616;
  --surface-2: #1f1c1b;
  --border: #504846;
  --text: #F1F1F1;
  --text-muted: #9BA4A2;
  --muted: #747272;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-bg-strong: rgba(255, 255, 255, 0.10);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-highlight: rgba(255, 255, 255, 0.20);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.38);
}

[data-theme="light"] {
  /* Light mode keeps the original brighter orange on buttons/marks */
  --highlight-deep: var(--highlight-2);
  --bg: #f1f1f1;
  --surface: #e9e9e9;
  --surface-2: #dbdbdb;
  --border: #c8c8c8;
  --text: #0A0A0A;
  --text-muted: #747272;
  --muted: #9BA4A2;
  /* More pronounced frosted glass in light mode: a heavier blur with more
     translucency so the effect actually reads against the near-white page,
     plus a defined edge and a deeper shadow for separation. */
  --glass-blur: blur(24px) saturate(180%);
  --glass-bg: rgba(255, 255, 255, 0.42);
  --glass-bg-strong: rgba(255, 255, 255, 0.58);
  --glass-border: rgba(255, 255, 255, 0.9);
  --glass-highlight: rgba(255, 255, 255, 1);
  /* Softer shadows in light mode — the deep ones read as too heavy on the
     near-white page. */
  --glass-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.10);
  --shadow-sm: 0 1px 5px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--page-glow);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  /* Allow full-bleed sticky bands (e.g. the catalogue bar) to span the viewport
     without adding a horizontal scrollbar. `clip` keeps position:sticky working,
     which `hidden` would break. */
  overflow-x: clip;
}

a { color: var(--highlight); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--highlight-2); text-decoration: none; }

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; }
p { margin: 0 0 1rem; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main { flex: 1 0 auto; padding: 2rem 0 3rem; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: .3px;
}
.brand:hover { text-decoration: none; }
/* DBpixelhouse logo. Two artworks are shipped: the all-orange mark (-02) for
   light backgrounds and the orange + off-white mark (-01) for dark ones. CSS
   shows whichever matches the active theme. */
.brand-logo { display: block; height: 38px; width: auto; }
.brand-logo--dark { display: none; }
[data-theme="dark"] .brand-logo--light { display: none; }
[data-theme="dark"] .brand-logo--dark { display: block; }

.header-nav { display: flex; align-items: center; gap: 1.25rem; }
.header-nav a.navlink { color: var(--text); font-weight: 500; font-size: .95rem; }
.header-nav a.navlink:hover { color: var(--highlight); text-decoration: none; }

/* Theme toggle — a sliding switch with sun/moon icons. The thumb sits left in
   light mode and slides right in dark mode (driven by [data-theme]). */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  width: 58px;
  height: 30px;
  padding: 0 .45rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
}
.theme-toggle:hover { border-color: var(--highlight); }
.theme-toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.theme-toggle .theme-toggle-icon {
  font-size: .8rem;
  line-height: 1;
  z-index: 1;
  transition: opacity var(--transition);
}
.theme-toggle .is-sun { color: var(--highlight); }
.theme-toggle .is-moon { color: var(--text-muted); }
.theme-toggle .theme-toggle-thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--highlight), var(--highlight-deep));
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}
[data-theme="dark"] .theme-toggle .theme-toggle-thumb { transform: translateY(-50%) translateX(28px); }
/* Dim the icon the thumb is not covering so the active mode reads clearly. */
[data-theme="light"] .theme-toggle .is-moon { opacity: .45; }
[data-theme="dark"] .theme-toggle .is-sun { opacity: .45; }

/* Basket icon button in nav */
.basket-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  transition: border-color var(--transition), color var(--transition);
}
.basket-link:hover { border-color: var(--highlight); color: var(--highlight); text-decoration: none; }
.basket-icon { width: 20px; height: 20px; }
.basket-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--highlight);
  color: var(--highlight-ink);
  border: 2px solid var(--surface);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.basket-count[hidden] { display: none; }

/* Floating "back to top" button */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 70;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition), border-color var(--transition), color var(--transition);
}
.scroll-top svg { width: 22px; height: 22px; }
.scroll-top:hover { border-color: var(--highlight); color: var(--highlight); }
.scroll-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
@media (max-width: 560px) {
  .scroll-top { bottom: 1rem; right: 1rem; }
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  padding: 2rem 0 1.5rem;
  margin-top: auto;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-brand .brand { display: inline-flex; }
.footer-social { display: flex; gap: .15rem; flex-wrap: wrap; }
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  transition: transform var(--transition), opacity var(--transition);
}
.footer-social a:hover { transform: translateY(-2px); opacity: .85; text-decoration: none; }
.footer-social .social-icon { width: 24px; height: 24px; object-fit: contain; display: block; }
.footer-col h4 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin: 0 0 .9rem;
}
.footer-contact { font-style: normal; margin-top: .9rem; }
.footer-contact p { color: var(--text-muted); font-size: .9rem; margin: 0 0 .45rem; max-width: 260px; }
.footer-contact a { color: var(--text-muted); }
.footer-contact a:hover { color: var(--highlight); }
.footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
}
.footer-legal { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-legal a { color: var(--text-muted); }
.footer-legal a:hover { color: var(--highlight); text-decoration: none; }

/* ── Glass utility ────────────────────────────────────────────────────────── */
/* Frosted-glass surface: translucent fill + backdrop blur + light top edge.
   Apply .glass to any surface, or use the tokens directly. */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}
.glass-strong { background: var(--glass-bg-strong); }

/* ── Cards / surfaces ─────────────────────────────────────────────────────── */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}
.card + .card { margin-top: 1.25rem; }

.panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.card-grid .card { padding: 1.3rem 1.4rem; }
/* gap handles spacing in the grid — cancel the stacked-card margin so all
   cards share one row height instead of the later ones shrinking/shifting */
.card-grid .card + .card { margin-top: 0; }
.card-grid .card .code { color: var(--text-muted); letter-spacing: .08em; font-size: .72rem; }
.card-grid .card h2 { font-size: 2rem; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font: inherit;
  font-weight: 600;
  padding: .62rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn:hover { border-color: var(--highlight); color: var(--highlight); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--highlight), var(--highlight-deep));
  border-color: transparent;
  color: var(--highlight-ink);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { color: var(--highlight-ink); filter: brightness(1.05); box-shadow: var(--shadow-sm); }
.btn-danger { color: #fff; background: #b3261e; border-color: #b3261e; }
.btn-danger:hover { filter: brightness(1.1); }

/* Data-management page: one card per clearable dataset. */
.data-clear-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.data-clear-grid .card { margin: 0; }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .92rem; }
.field { margin-bottom: 1.1rem; }
.field .hint { font-weight: 400; color: var(--text-muted); font-size: .82rem; margin-top: .3rem; }
.required::after { content: " *"; color: var(--highlight); }

input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="password"], input[type="number"], input[type="date"], input[type="file"],
select, textarea {
  width: 100%;
  /* Never spill outside the field, even when an intrinsic min-width (e.g. a
     <select> with long options, or a date/number control) would otherwise push
     the box wider than its column on mobile. */
  max-width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .7rem;
  transition: var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--highlight);
  box-shadow: var(--ring);
}
textarea { min-height: 90px; resize: vertical; }

.checkbox-row { display: flex; align-items: flex-start; gap: .6rem; }
.checkbox-row input { width: auto; margin-top: .25rem; }
.checkbox-row label { margin: 0; font-weight: 500; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1.25rem; }
.form-grid .col-span-2 { grid-column: 1 / -1; }
/* Let grid cells (and the field inside) shrink below their content's intrinsic
   width so a wide control can't blow the layout out past the screen. */
.form-grid > *, .field { min-width: 0; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 0 0 1.5rem;
}
legend { padding: 0 .5rem; font-weight: 700; color: var(--highlight); }

/* ── Flash messages ───────────────────────────────────────────────────────── */
.flash { border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: 1rem; border: 1px solid; }
.flash-error { background: rgba(179, 38, 30, 0.12); border-color: #b3261e; color: var(--text); }
.flash-success { background: rgba(255, 106, 20, 0.12); border-color: var(--highlight); color: var(--text); }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td {
  text-align: left;
  padding: .7rem .8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data th { font-size: .82rem; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
table.data tbody tr:hover, table.data tr:hover { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.badge-on { color: var(--highlight); border-color: var(--highlight); }
.badge-archived { color: var(--muted); }
.badge-rejected { color: #c0392b; border-color: #c0392b; }
.badge-danger { color: #c0392b; border-color: #c0392b; }
.badge-ok { color: var(--highlight); border-color: var(--highlight); }

/* ── Free accessories (linked products) ───────────────────────────────────── */
/* Rows for products automatically included alongside a chosen item, at no cost. */
.accessory-row td { color: var(--text-muted); }
.accessory-row:hover { background: transparent; }
.accessory-name { padding-left: 1.6rem !important; position: relative; }
.accessory-tag {
  display: inline-block;
  margin-right: .5rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--highlight);
  border: 1px solid var(--highlight);
  vertical-align: middle;
}

/* ── Multi-step checkout ──────────────────────────────────────────────────── */
.checkout-step[hidden] { display: none; }

.checkout-steps {
  list-style: none;
  display: flex;
  gap: .5rem;
  padding: 0;
  margin: 0 0 1.75rem;
  counter-reset: none;
}
.step-pip {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: .75rem .5rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.step-pip-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .9rem;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.step-pip-label { font-size: .82rem; color: var(--text-muted); }
.step-pip.is-active {
  border-color: var(--highlight);
  background: var(--surface-2);
}
.step-pip.is-active .step-pip-num {
  background: linear-gradient(135deg, var(--highlight), var(--highlight-deep));
  color: var(--highlight-ink);
  border-color: transparent;
}
.step-pip.is-active .step-pip-label { color: var(--text); font-weight: 600; }
.step-pip.is-done .step-pip-num {
  background: transparent;
  color: var(--highlight);
  border-color: var(--highlight);
}
.step-pip.is-done .step-pip-label { color: var(--text); }

.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.step-nav .btn { min-width: 8rem; }

@media (max-width: 560px) {
  .step-pip-label { display: none; }
  .checkout-steps { gap: .35rem; }
}

/* ── Hero / access ────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 3rem 0 1.5rem;
}
.hero h1 {
  font-size: 2.9rem;
  background: linear-gradient(135deg, var(--text), var(--highlight));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.lead { color: var(--text-muted); font-size: 1.15rem; max-width: 600px; margin: 0 auto 1.5rem; }

.access-card { max-width: 460px; margin: 1.5rem auto 0; }

/* Show branding banner */
.show-banner {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.show-banner .show-logo {
  width: 110px; height: 110px; object-fit: contain;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .5rem;
}
.show-meta { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin-top: .5rem; }
.show-meta .meta-item { font-size: .92rem; }
.show-meta .meta-item .meta-label { color: var(--text-muted); display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; }

.notice {
  border: 1px solid var(--highlight);
  background: rgba(255, 106, 20, 0.1);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1rem 0;
}
.notice.closed { border-color: #b3261e; background: rgba(179, 38, 30, 0.12); }

/* ── Show hero ─────────────────────────────────────────────────────────────── */
.show-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.show-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--highlight), var(--highlight-2), transparent);
}

/* ── Catalogue toolbar + search ────────────────────────────────────────────── */
.catalogue-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  position: sticky;
  top: 67px;
  z-index: 51;              /* search controls sit above the frosted box (49) and header (50) */
  margin-bottom: 1.75rem;
  /* Full-bleed band so the search aligns with, and extends, the header.
     Content stays aligned to the container via the padding calc. */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: .85rem max(1.25rem, calc(50vw - var(--maxw) / 2 + 1.25rem));
}

/* Single frosted box covering the header AND the stuck catalogue bar, so the two
   read as one continuous panel with ONE blur — no seam where two panels meet.
   Shown only while the bar is stuck (body.bar-stuck, toggled from JS); its height
   is set in JS to reach the bottom of the search bar. */
.sticky-glass {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  z-index: 49;              /* behind the header (50) and bar (51), above the page */
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  pointer-events: none;
  display: none;
}
body.bar-stuck .sticky-glass { display: block; }
/* While stuck, the header drops its own glass so only the single box frosts the
   region (no double blur, no border line cutting across the middle). */
body.bar-stuck .site-header {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom-color: transparent;
}
.search-field { flex: 1; position: relative; }
.search-field::before {
  content: "";
  position: absolute;
  left: 14px; top: 50%;
  width: 16px; height: 16px;
  transform: translateY(-50%);
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  box-shadow: 9px 9px 0 -7px var(--text-muted);
  pointer-events: none;
  opacity: .7;
}
.search-field input {
  width: 100%;
  padding: .8rem 1rem .8rem 2.6rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 1rem;
  color: var(--text);
}
.search-field input::placeholder { color: var(--text-muted); }

/* Admin orders search — reuses the pill search field with rounded buttons. */
.orders-search {
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.orders-search .search-field { flex: 1; min-width: 240px; }
.orders-search .btn { border-radius: 999px; }

/* Terms & conditions card — a lighter shadow than a normal card so it doesn't
   bleed onto the Place-order button, and it drops away once accepted. */
.terms-card {
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-highlight);
  transition: box-shadow var(--transition);
}
.terms-card:has(#terms_accepted:checked) {
  box-shadow: none;
}
.terms-link { white-space: nowrap; }

/* ── Category quick-nav (jump links above the catalogue) ──────────────────── */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 1.75rem;
}
.category-chip {
  display: inline-block;
  padding: .35rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .88rem;
  font-weight: 600;
  transition: var(--transition);
}
.category-chip:hover {
  border-color: var(--highlight);
  color: var(--highlight);
  text-decoration: none;
}

/* ── Item editor (rate card / show equipment): search + accordions ─────────── */
.item-editor-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: .75rem 0 1rem;
  margin-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.item-editor-bar .search-field { margin-bottom: .75rem; }
.item-editor-bar .jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0;
}
.item-editor-bar .category-chip { cursor: pointer; font-size: .82rem; padding: .25rem .7rem; }
details.cat-acc { padding: 0; }
details.cat-acc .cat-body { padding: 0 1.4rem 1.3rem; }
.cat-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
  cursor: pointer;
  font-weight: 700;
  list-style-position: inside;
}
.cat-summary::-webkit-details-marker { color: var(--text-muted); }
.cat-summary:hover { background: var(--surface-2); }
.cat-summary-title { font-size: 1.1rem; }
.cat-summary-meta { display: flex; align-items: center; gap: 1.1rem; color: var(--text-muted); font-size: .85rem; font-weight: 500; }
.cat-include-toggle { font-weight: 600; color: var(--text); cursor: pointer; }
details.cat-acc[open] .cat-summary { border-bottom: 1px solid var(--border); }

/* ── Product catalogue (list) ──────────────────────────────────────────────── */
/* Offset anchor jumps so a category heading clears the sticky header + bar. */
.category-block { margin-bottom: 2.25rem; scroll-margin-top: 130px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.category-title {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: .25rem;
}
.category-desc { color: var(--text-muted); margin: 0 0 1rem; }

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
/* Each catalogue entry is an <li.item> wrapping the visible row plus an optional
   expandable details panel. The divider + search-hide live on the wrapper. */
.item { border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: none; }
/* The [hidden] attribute (set by the live search) must win over any display,
   otherwise non-matching items stay visible and the whole category shows. */
.item[hidden] { display: none; }
.item-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: .40rem 1.25rem;
  transition: background var(--transition);
}
.item-row:hover { background: var(--surface-2); }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; align-items: flex-start; }
.item-desc { font-weight: 600; font-size: 1rem; }

/* Expandable item details (image + specs/notes) */
.item-details-toggle {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  margin-top: .1rem;
  font: inherit;
  font-size: .78rem;
  color: var(--highlight);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.item-details-toggle::after {
  content: "▾";
  font-size: 1.05em;
  line-height: 1;
  transition: transform var(--transition);
}
.item.is-open .item-details-toggle::after { transform: rotate(180deg); }
.item-details-toggle:hover { color: var(--highlight-2); }
/* Smoothly reveal the panel by animating the grid row from 0fr to 1fr — the
   clean way to transition to/from an auto height. The .is-open class is toggled
   on the parent .item from JS. */
.item-details {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 260ms cubic-bezier(0.4, 0, 0.2, 1);
}
.item.is-open .item-details { grid-template-rows: 1fr; }
/* The clipper collapses to 0 (its overflow:hidden lets it shrink below content,
   and it carries no padding of its own so nothing residual is left when closed). */
.item-details-inner { overflow: hidden; min-height: 0; }
.item-details-body {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: .25rem 1.25rem 1rem;
  opacity: 0;
  transition: opacity 220ms ease;
}
.item.is-open .item-details-body { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .item-details, .item-details-body, .item-details-toggle::after { transition: none; }
}
.item-details-img {
  max-width: 220px;
  max-height: 180px;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}
.item-details-info {
  flex: 1;
  min-width: 240px;
  color: var(--text-muted);
  font-size: .9rem;
}
.item-code {
  font-size: .76rem;
  color: var(--text-muted);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.item-price {
  color: var(--highlight);
  font-weight: 400;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 84px;
  text-align: right;
}
/* Darker, higher-contrast price in light mode (orange is too light there). */
[data-theme="light"] .item-price { color: var(--text); }
.item-actions { display: flex; align-items: center; gap: .6rem; }
/* "N in basket" reminder shown next to a product's Add button. */
.item-in-basket {
  font-size: .8rem;
  font-weight: 600;
  color: var(--highlight);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
[data-theme="light"] .item-in-basket { color: var(--text); }

.no-results { text-align: center; color: var(--text-muted); padding: 2.5rem 1rem; }

.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }
.qty-stepper button { background: transparent; border: none; color: var(--text); width: 34px; height: 38px; font-size: 1.2rem; cursor: pointer; transition: color var(--transition); }
.qty-stepper button:hover { color: var(--highlight); }
.qty-stepper input { width: 48px; text-align: center; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); border-radius: 0; background: transparent; padding: .3rem 0; -moz-appearance: textfield; appearance: textfield; }
/* Hide native number-input spin buttons so the value stays centred */
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

@media (max-width: 560px) {
  .item-row { flex-wrap: wrap; gap: .5rem 1rem; }
  .item-main { flex-basis: 100%; }
  .item-actions { margin-left: auto; }
}

/* ── FAQ list (confirmation "what happens next") ──────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 1.25rem; }
.faq-item + .faq-item { padding-top: 1.25rem; border-top: 1px solid var(--border); }
.faq-question { font-size: 1rem; margin: 0 0 .4rem; }
.faq-answer { color: var(--text-muted); font-size: .92rem; }

/* ── Policies (text blocks appended to the quote / checkout) ───────────────── */
.policy-block + .policy-block { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.policy-name { font-size: 1rem; margin: 0 0 .4rem; }
.policy-body { color: var(--text-muted); font-size: .9rem; }

/* ── Rendered rich text (item info, policy text) ──────────────────────────── */
.rich-content > *:first-child { margin-top: 0; }
.rich-content > *:last-child { margin-bottom: 0; }
.rich-content p, .rich-content div { margin: 0 0 .6rem; }
.rich-content div:empty { margin: 0; }
.rich-content ul, .rich-content ol { margin: 0 0 .6rem; padding-left: 1.25rem; }
.rich-content li { margin: .12rem 0; }
.rich-content h1, .rich-content h2, .rich-content h3, .rich-content h4 { margin: .8rem 0 .4rem; line-height: 1.2; color: var(--text); }
.rich-content h1 { font-size: 1.2rem; }
.rich-content h2 { font-size: 1.1rem; }
.rich-content h3 { font-size: 1rem; }
.rich-content h4 { font-size: .95rem; }
.rich-content strong, .rich-content b { font-weight: 700; color: var(--text); }
.rich-content a { color: var(--highlight); }
.rich-content a:hover { color: var(--highlight-2); }
.rich-content blockquote { margin: 0 0 .6rem; padding: .15rem 0 .15rem .8rem; border-left: 3px solid var(--border); color: var(--text-muted); }
.rich-content code { background: var(--surface-2); padding: .1rem .3rem; border-radius: var(--radius-sm); font-size: .85em; }
.rich-content pre { background: var(--surface-2); padding: .6rem .8rem; border-radius: var(--radius-sm); overflow-x: auto; }
.rich-content pre code { background: none; padding: 0; }
.rich-content hr { border: none; border-top: 1px solid var(--border); margin: .8rem 0; }

/* ── WYSIWYG editor (Trix) ─────────────────────────────────────────────────── */
/* Theme Trix's toolbar + editor to match the app's inputs in both palettes. */
trix-toolbar .trix-button-group {
  border-color: var(--border);
  background: var(--surface);
  margin-bottom: .5rem;
}
trix-toolbar .trix-button {
  background: transparent;
  border-bottom: none;
  color: var(--text);
}
trix-toolbar .trix-button:not(:first-child) { border-left: 1px solid var(--border); }
trix-toolbar .trix-button:not(:disabled):not(.trix-active):hover { background: var(--surface-2); }
trix-toolbar .trix-button.trix-active { background: var(--highlight); }
/* Trix's icons are dark SVGs; lighten them in dark mode so they stay visible. */
[data-theme="dark"] trix-toolbar .trix-button--icon::before { filter: invert(0.92); }
trix-editor.rich-editor {
  display: block;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 9em;
  padding: .7rem .8rem;
  font-size: 1rem;
}
trix-editor.rich-editor:focus { outline: none; border-color: var(--highlight); box-shadow: var(--ring); }
/* Keep the editor and its content inside the column on narrow screens (long
   words / pasted URLs would otherwise widen the page). */
trix-editor.rich-editor { max-width: 100%; overflow-wrap: break-word; word-break: break-word; }
trix-toolbar { max-width: 100%; }
/* On phones, let the toolbar buttons wrap onto multiple rows instead of forcing
   a sideways scroll / overflow of the form. */
@media (max-width: 640px) {
  trix-toolbar .trix-button-row { flex-wrap: wrap; overflow-x: visible; row-gap: .35rem; }
  trix-toolbar .trix-button-group { margin-bottom: .35rem; }
  trix-toolbar .trix-button--icon { max-width: none; width: 2.4em; }
}
trix-editor.rich-editor h1 { font-size: 1.2rem; }
trix-editor.rich-editor a { color: var(--highlight); }
/* Link-insert dialog */
trix-toolbar .trix-dialog {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
trix-toolbar .trix-dialog .trix-input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ── Basket ───────────────────────────────────────────────────────────────── */
.basket-table .remove { color: #b3261e; cursor: pointer; background: none; border: none; font: inherit; }
.basket-summary { display: flex; justify-content: flex-end; }
.summary-box { min-width: 280px; }
.summary-row { display: flex; justify-content: space-between; padding: .35rem 0; }
.summary-row.total { border-top: 1px solid var(--border); margin-top: .4rem; padding-top: .6rem; font-weight: 700; font-size: 1.15rem; }
.summary-row.total .amount { color: var(--highlight); }
.summary-row.saving { color: var(--highlight); font-weight: 600; }
/* Price-on-application marker (shown wherever a price would be). */
.poa {
  color: var(--highlight);
  font-weight: 600;
  letter-spacing: .3px;
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

/* Instant custom tooltip (ui.js), reused position:fixed element. */
.tooltip-pop {
  position: fixed;
  z-index: 200;
  max-width: 240px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .45rem .65rem;
  font-size: .8rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
  text-align: center;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 90ms ease, transform 90ms ease;
}
.tooltip-pop.is-visible { opacity: 1; transform: translateY(0); }
/* Small arrow — points down when above the target, up when flipped below. */
.tooltip-pop::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  top: 100%;
  border-top-color: var(--border);
}
.tooltip-pop.is-below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--border);
}

/* Early-bird notice in the show header. */
.eb-banner {
  display: inline-block;
  margin: .5rem 0 .25rem;
  padding: .3rem .75rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--highlight-ink);
  background: linear-gradient(135deg, var(--highlight), var(--highlight-deep));
}
/* Late-surcharge variant: a calm, neutral note (prices are shown all-in), not a
   promotional gradient and not an alarming warning. */
.eb-banner.surcharge-banner {
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
}
/* Upcoming-surcharge reminder (before the date): an attention-grabbing nudge to
   order now, using the highlight colour as an outline rather than a solid fill so
   it reads as a heads-up, not a confirmed early-bird discount. */
.eb-banner.surcharge-upcoming-banner {
  color: var(--highlight);
  background: var(--surface);
  border: 1px solid var(--highlight);
}
.summary-rows { min-width: 280px; }
/* Struck-through "was" (pre-early-bird) price next to the discounted price. */
.was { color: var(--text-muted); margin-right: .35rem; text-decoration: line-through; }
.empty-state { text-align: center; color: var(--text-muted); padding: 3rem 1rem; }

/* ── Modal (recommended-kit prompt) ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
.modal {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.5rem 1.3rem;
}
.modal-close {
  position: absolute;
  top: .6rem;
  right: .8rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.kit-justification {
  margin: .9rem 0;
  padding: .75rem .9rem;
  background: var(--surface);
  border-left: 3px solid var(--highlight);
  border-radius: var(--radius-sm);
  font-size: .9rem;
}
.kit-justification > :first-child { margin-top: 0; }
.kit-justification > :last-child { margin-bottom: 0; }
/* Per-day service: the checkbox/label on the left, a day-count stepper pushed to
   the right of the line (matching the portal's quantity steppers). */
.service-option { display: flex; align-items: center; gap: 1rem; }
.service-option .checkbox-row { flex: 1; margin: 0; }
.service-days { display: flex; align-items: center; gap: .5rem; margin-left: auto; flex: 0 0 auto; }
.service-days-label { font-size: .85rem; color: var(--text-muted); }
.kit-list { display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0; }
.kit-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
}
.kit-row .kit-name { flex: 1; }
.kit-row .kit-cost { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kit-extra { text-align: right; padding-top: .4rem; border-top: 1px solid var(--border); }

/* ── Quote PDF designer (full-page side-by-side editor + live preview) ──────── */
.color-input { width: 100%; height: 42px; padding: 2px; cursor: pointer; }

.designer-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--bg);
  background-image: var(--page-glow);
  display: flex;
  flex-direction: column;
}
.designer-topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.designer-topbar .spacer { flex: 1; }
.designer-body {
  flex: 1;
  display: grid;
  grid-template-columns: var(--controls-w, 380px) 7px 1fr;
  min-height: 0;            /* let children scroll */
}
.designer-controls {
  overflow-y: auto;
  padding: 1.25rem;
  min-width: 0;
}
/* Draggable divider between the controls and the preview. */
.designer-gutter {
  background: var(--border);
  cursor: col-resize;
  position: relative;
}
.designer-gutter::before {
  content: "";
  position: absolute;
  inset: 0 -4px;            /* widen the hit area */
}
.designer-gutter:hover, body.is-resizing .designer-gutter { background: var(--highlight); }
/* While dragging, stop the preview iframe from swallowing pointer events. */
body.is-resizing { cursor: col-resize; user-select: none; }
body.is-resizing #preview-frame { pointer-events: none; }
.designer-controls fieldset { margin-bottom: 1rem; }
.designer-controls .field-row { display: flex; gap: .75rem; }
.designer-controls .field-row .field { flex: 1; }
/* Visual / HTML tabs */
.designer-tabs { display: flex; gap: .25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.designer-tab {
  font: inherit;
  font-weight: 600;
  padding: .5rem .9rem;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.designer-tab:hover { color: var(--text); }
.designer-tab.is-active { color: var(--highlight); border-bottom-color: var(--highlight); }
.code-area { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .8rem; white-space: pre; }
.designer-controls-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}
/* Preview pane: grey "desk" with the quote sitting as a padded white page. */
.designer-preview {
  position: relative;
  min-width: 0;
  background: var(--surface-2);
  padding: 1.5rem;
  display: flex;
  justify-content: center;
}
.designer-preview-status {
  position: absolute;
  top: .6rem;
  right: 1rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.designer-preview #preview-frame {
  width: 100%;
  max-width: 820px;
  height: 100%;
  border: none;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow);
}
@media (max-width: 900px) {
  .designer-body { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .designer-gutter { display: none; }
  .designer-controls { border-bottom: 1px solid var(--border); }
}

/* ── Admin layout ─────────────────────────────────────────────────────────── */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; gap: 1.75rem; }
/* A grid item defaults to min-width:auto, which lets a wide child (a data table
   or the Trix toolbar) stretch the track past the viewport and scroll the whole
   page sideways. min-width:0 lets the column shrink so children scroll/stack
   within it instead. */
.admin-content { min-width: 0; }
.admin-nav { position: sticky; top: 88px; align-self: start; }
.admin-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.admin-nav a {
  display: block;
  padding: .55rem .8rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
}
.admin-nav a:hover { background: var(--surface-2); text-decoration: none; }
.admin-nav a.active { background: var(--highlight); color: var(--highlight-ink); }
@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { position: static; }
  .admin-nav ul { flex-direction: row; flex-wrap: wrap; }
}

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.inline-form { display: inline; }

.toolbar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }

/* Utility */
.muted { color: var(--text-muted); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.gap-1 { gap: .5rem; }
.stack > * + * { margin-top: 1rem; }
.pill-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.divider { height: 1px; background: var(--border); border: 0; margin: 1.5rem 0; }

@media (max-width: 560px) {
  .header-nav { gap: .6rem; }
  .brand .brand-tag { display: none; }
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.8rem; }
}

/* ── Cookie consent banner ─────────────────────────────────────────────────
   Frosted glass band pinned to the bottom of the viewport, themed to match
   the header. Hidden via the [hidden] attribute until cookie-consent.js
   reveals it; .is-visible drives the slide-up/fade transition. */
.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transform: translateY(100%);
  opacity: 0;
  transition: transform var(--transition), opacity var(--transition);
}
.cookie-consent[hidden] { display: none; }
.cookie-consent.is-visible { transform: translateY(0); opacity: 1; }
.cookie-consent-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.cookie-consent-text {
  flex: 1 1 320px;
  font-size: .92rem;
  color: var(--text);
  line-height: 1.5;
}
.cookie-consent-text strong { display: block; margin-bottom: .15rem; }
.cookie-consent-actions {
  display: flex;
  gap: .6rem;
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .cookie-consent-actions { width: 100%; }
  .cookie-consent-actions .btn { flex: 1; }
}

/* ── Print (Download quote / order as PDF via the browser) ─────────────────── */
@media print {
  .site-header, .site-footer, .cookie-consent, .scroll-top,
  .admin-nav, .actions, .btn, .step-nav, .no-print { display: none !important; }
  body { background: #fff !important; background-image: none !important; color: #000; }
  main { padding: 0 !important; }
  .admin-shell { display: block !important; }
  .card, .show-hero, .item-list {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    background: #fff !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    break-inside: avoid;
  }
  a[href]::after { content: ""; } /* don't print raw URLs after links */
}

/* ── Date inputs ───────────────────────────────────────────────────────────
   The native calendar-picker glyph is a dark SVG that all but disappears on the
   dark theme. Invert it in dark mode so it stays visible, and make it obviously
   clickable in both. */
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .9; }
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.7);
  opacity: .95;
}

/* ── Equipment page: bar actions + Add-quantity prompt ─────────────────────── */
.catalogue-bar-actions { display: flex; gap: .5rem; flex-shrink: 0; }

/* Compact modal used by the "how many?" prompt after clicking Add. */
.modal.modal-sm { max-width: 400px; }
.qty-stepper-lg { display: flex; width: 100%; height: 52px; margin: 1.1rem 0 .25rem; }
.qty-stepper-lg button { width: 60px; height: 100%; font-size: 1.5rem; }
.qty-stepper-lg input { flex: 1; width: auto; height: 100%; font-size: 1.25rem; }

/* Per-step checkout validation notice (list of issues). */
.step-errors { margin-top: 0; }
.step-errors ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.step-errors li { margin: .1rem 0; }

/* ══════════════════════════════════════════════════════════════════════════
   Mobile / touch refinements
   Larger hit areas on touch devices and sensible stacking on small screens so
   the whole portal works comfortably on a phone.
   ══════════════════════════════════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .qty-stepper button { min-width: 44px; min-height: 44px; }
  .checkbox-row input { width: 22px; height: 22px; margin-top: .15rem; }
  .item-details-toggle { padding: .3rem 0; }
  .remove, .modal-close { min-height: 40px; }
  /* 16px inputs stop iOS Safari zooming in when a field is focused. */
  input, select, textarea { font-size: 16px; }
}

@media (max-width: 640px) {
  .catalogue-bar { flex-wrap: wrap; }
  .catalogue-bar .search-field { flex-basis: 100%; }
  .catalogue-bar-actions { width: 100%; }
  .catalogue-bar-actions .btn { flex: 1; }
}

@media (max-width: 560px) {
  main { padding: 1.25rem 0 2rem; }
  .container { padding: 0 1rem; }
  .card { padding: 1.1rem; }
  .show-hero { padding: 1.25rem; }
  .show-banner { gap: 1rem; }
  .show-banner .show-logo { width: 76px; height: 76px; }
  .page-head { align-items: flex-start; }
  /* Stack wizard navigation and modal actions so buttons are full-width and the
     primary action sits on top (column-reverse). */
  .step-nav { flex-direction: column-reverse; gap: .6rem; }
  .step-nav .btn { width: 100%; min-width: 0; }
  .modal { padding: 1.2rem 1.1rem 1rem; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .kit-row { flex-wrap: wrap; }
  .summary-box, .summary-rows { min-width: 0; width: 100%; }
  .basket-summary { display: block; }
}

/* ── Responsive data tables ────────────────────────────────────────────────
   Below this width, tables with a header row (marked .has-labels by ui.js)
   stack into one card per row with the column heading shown beside each value,
   so wide tables (basket, admin orders/equipment) stay fully on screen with no
   horizontal scroll. Headerless tables keep the normal scrollable layout. */
@media (max-width: 720px) {
  table.data.has-labels,
  table.data.has-labels tbody,
  table.data.has-labels tr,
  table.data.has-labels td { display: block; width: 100%; }
  table.data.has-labels thead { display: none; }
  table.data.has-labels tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .35rem .8rem;
    margin-bottom: .7rem;
    background: var(--surface);
  }
  table.data.has-labels tr:hover { background: var(--surface); }
  table.data.has-labels td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: .45rem 0;
    text-align: right;
  }
  table.data.has-labels tr td:last-child { border-bottom: none; }
  table.data.has-labels td::before {
    content: attr(data-label);
    font-weight: 600;
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .4px;
    color: var(--text-muted);
    text-align: left;
    flex: 0 0 auto;
  }
  /* Cells with no heading (e.g. an actions column) span the row full-width. */
  table.data.has-labels td:not([data-label]) { justify-content: flex-end; }
  table.data.has-labels td:not([data-label])::before { content: none; }
  /* The basket quantity stepper shouldn't be squeezed in a stacked cell. */
  table.data.has-labels .qty-stepper { flex: 0 0 auto; }
}
