/* File: public_html/public/assets/css/app.css · Last updated: 2026-10-21 15:42 IST */
/* =============================================================================
   Bafna Devices — storefront + admin stylesheet
   Mobile-first. Breakpoints: 640 (large phone) · 768 (tablet) · 1024 (laptop) · 1280 (desktop) · 1536 (wide)
   No framework: ~20 KB unminified, zero render-blocking third parties.
   ============================================================================= */

/* ---------- Design tokens (sampled from the BD logo) ---------- */
:root {
  /* Brand blues */
  --blue-900: #0b2545;   /* deep navy — top bar, footer */
  --blue-800: #123a6b;
  --blue-700: #1b5fae;   /* primary (logo wordmark blue) */
  --blue-600: #2270c4;
  --blue-500: #3a8ad6;   /* logo gradient mid */
  --blue-300: #8cc3ee;   /* logo gradient light */
  --blue-100: #e3f0fb;
  --blue-50:  #f2f8fd;

  /* Neutrals */
  --gray-900: #16202c;   /* body text */
  --gray-700: #3d4b5c;
  --gray-600: #56657a;   /* muted text — 5.9:1 on white */
  --gray-400: #a7b3c2;
  --gray-300: #d3dbe5;   /* borders */
  --gray-200: #e4e9f0;
  --gray-100: #f3f6fa;   /* page alt background */
  --white:    #ffffff;

  /* Status */
  --green-700: #17784b;  --green-50: #e8f6ee;
  --amber-700: #8a5300;  --amber-50: #fff5e0;  --amber-300: #f5c46b;
  --red-700:   #b3261e;  --red-50:   #fdecea;

  /* Type */
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.125rem;
  --fs-xl: 1.375rem; --fs-2xl: 1.75rem; --fs-3xl: clamp(1.9rem, 1.3rem + 2.4vw, 3rem);

  /* Space, radius, shadow */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4rem;
  --radius-sm: 4px; --radius: 8px; --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, .06);
  --shadow:    0 4px 14px rgba(11, 37, 69, .08);
  --shadow-lg: 0 18px 40px rgba(11, 37, 69, .16);
  --focus: 0 0 0 3px rgba(58, 138, 214, .45);

  --container: 1320px;
  --header-z: 50;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-sans); font-size: var(--fs-md); line-height: 1.55;
  color: var(--gray-900); background: var(--white); -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, dl, figure { margin: 0; }
:where(ul[role="list"]) { list-style: none; padding: 0; }  /* :where → zero specificity, components can add padding */
a { color: var(--blue-700); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--blue-800); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
[hidden] { display: none !important; }
code { font-family: var(--font-mono); font-size: .9em; background: var(--gray-100); padding: 0 .3em; border-radius: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.125rem; height: 1.125rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: .875rem; height: .875rem; }
.icon--lg { width: 1.5rem; height: 1.5rem; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s-4); top: -100px; z-index: 100; background: var(--blue-700); color: var(--white); padding: var(--s-2) var(--s-4); border-radius: var(--radius); }
.skip-link:focus { top: var(--s-2); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s-4); }
@media (min-width: 768px) { .container { padding-inline: var(--s-5); } }

.mono { font-family: var(--font-mono); letter-spacing: -.01em; }
.muted { color: var(--gray-600); }
.small { font-size: var(--fs-sm); }
main:focus { outline: none; }

/* ---------- Buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-5); border: 1px solid transparent; border-radius: var(--radius);
  font-weight: 600; font-size: var(--fs-sm); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--blue-700); color: var(--white); }
.btn--primary:hover { background: var(--blue-800); color: var(--white); }
.btn--dark { background: var(--blue-900); color: var(--white); }
.btn--dark:hover { background: var(--blue-800); color: var(--white); }
.btn--ghost { background: var(--white); border-color: var(--gray-300); color: var(--gray-900); }
.btn--ghost:hover { border-color: var(--blue-500); color: var(--blue-700); }
.btn--sm { min-height: 36px; padding: 0 var(--s-3); }
.btn--lg { min-height: 52px; padding: 0 var(--s-6); font-size: var(--fs-md); }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.btn[disabled] { opacity: .6; cursor: progress; }

.field { margin: 0 0 var(--s-5); padding: 0; border: 0; }
.field > label:not(.choice), .field > legend { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--s-2); padding: 0; }
.field input[type="email"], .field input[type="password"], .field input[type="text"], .field input[type="file"], textarea {
  width: 100%; min-height: 44px; padding: var(--s-2) var(--s-3); background: var(--white);
  border: 1px solid var(--gray-300); border-radius: var(--radius);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--blue-500); }
.choice { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-2) 0; font-size: var(--fs-sm); cursor: pointer; }
.choice input { margin-top: .2rem; width: 1.1rem; height: 1.1rem; accent-color: var(--blue-700); flex: none; }

.alert { padding: var(--s-3) var(--s-4); border-radius: var(--radius); border: 1px solid; margin: var(--s-4) 0; font-size: var(--fs-sm); }
.alert--success { background: var(--green-50); border-color: #b5e2c9; color: var(--green-700); }
.alert--error   { background: var(--red-50);   border-color: #f3c1bc; color: var(--red-700); }
.alert--info    { background: var(--blue-50);  border-color: var(--blue-100); color: var(--blue-800); }
.alert--warning { background: var(--amber-50); border-color: var(--amber-300); color: var(--amber-700); }
.alert code { font-family: var(--font-mono); font-size: .85em; overflow-wrap: anywhere; }

.chip { display: inline-block; padding: .2rem .6rem; border: 1px solid var(--gray-300); border-radius: 999px; background: var(--white);
  font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--gray-700); text-decoration: none; }
.chip:hover { border-color: var(--blue-500); color: var(--blue-700); }
.tag { display: inline-block; padding: .05rem .45rem; border-radius: var(--radius-sm); background: var(--gray-100); color: var(--gray-700);
  font-family: var(--font-mono); font-size: var(--fs-xs); }
.badge { position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #e8590c; color: var(--white); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

/* ---------- Top utility bar ---------- */
.topbar { background: var(--blue-900); color: #cfe0f3; font-size: var(--fs-xs); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 34px; }
.topbar ul { display: flex; gap: var(--s-5); }
.topbar li { display: flex; align-items: center; gap: var(--s-2); }
.topbar .icon { width: 14px; height: 14px; color: var(--blue-300); }
.topbar a { color: #e6f0fb; text-decoration: none; display: inline-flex; align-items: center; gap: var(--s-1); }
.topbar a:hover { color: var(--white); text-decoration: underline; }
.topbar__usp li:not(:first-child), .topbar__links li:not(:first-child) { display: none; }
@media (min-width: 768px)  { .topbar__links li { display: flex !important; } }
@media (min-width: 1024px) { .topbar__usp li { display: flex !important; } }
@media (max-width: 639px)  { .topbar__links { display: none !important; } .topbar__inner { justify-content: center; } }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: var(--header-z); background: var(--white); border-bottom: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); }
.header-main {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "toggle brand actions" "search search search";
  align-items: center; column-gap: var(--s-3); row-gap: var(--s-2); padding-block: var(--s-2) var(--s-3);
}
.nav-toggle { grid-area: toggle; }
.brand { grid-area: brand; justify-self: start; }
.brand img { height: 46px; width: auto; }
.search { grid-area: search; }
.header-actions { grid-area: actions; display: flex; gap: var(--s-1); }

@media (min-width: 1024px) {
  .header-main { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand search actions"; column-gap: var(--s-6); padding-block: var(--s-3); }
  .header-main .nav-toggle { display: none; }
  .brand img { height: 58px; }
}

.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; border-radius: var(--radius); cursor: pointer; color: var(--gray-900); }
.icon-btn:hover { background: var(--gray-100); }

.header-action { position: relative; display: flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-2);
  color: var(--gray-900); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; border-radius: var(--radius); }
.header-action:hover { background: var(--gray-100); color: var(--blue-700); }
.header-action__label { display: none; }
.cart-icon { position: relative; }
@media (min-width: 1024px) { .header-action__label { display: inline; } }

/* Search: brand select + input + button, joined */
.search { position: relative; display: flex; min-width: 0; height: 46px; border: 2px solid var(--blue-700); border-radius: var(--radius); background: var(--white); }
.search:focus-within { box-shadow: var(--focus); }
.search__brand { display: none; border: 0; border-right: 1px solid var(--gray-300); background: var(--gray-100); padding: 0 var(--s-3);
  font-size: var(--fs-sm); color: var(--gray-700); border-radius: 6px 0 0 6px; max-width: 170px; cursor: pointer; }
@media (min-width: 768px) { .search__brand { display: block; } }
.search__field { position: relative; flex: 1; min-width: 0; }
.search__input { width: 100%; height: 100%; border: 0; padding: 0 var(--s-3); background: transparent; font-family: var(--font-mono); font-size: 15px; }
.search__input::placeholder { font-family: var(--font-sans); color: var(--gray-600); }
.search__input:focus-visible { box-shadow: none; outline: none; }
.search__submit { display: flex; align-items: center; gap: var(--s-2); border: 0; padding: 0 var(--s-4); background: var(--blue-700); color: var(--white);
  font-weight: 600; font-size: var(--fs-sm); cursor: pointer; border-radius: 0 4px 4px 0; }
.search__submit:hover { background: var(--blue-800); }
.search__submit-label { display: none; }
@media (min-width: 640px) { .search__submit-label { display: inline; } }

.search__suggest { position: absolute; left: -2px; right: -2px; top: calc(100% + 4px); z-index: 60; margin: 0; padding: var(--s-1) 0; list-style: none;
  background: var(--white); border: 1px solid var(--gray-300); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 360px; overflow-y: auto; }
.search__suggest li a { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) var(--s-3); color: var(--gray-900); text-decoration: none; font-size: var(--fs-sm); }
.search__suggest li a[aria-selected="true"], .search__suggest li a:hover { background: var(--blue-50); }
.search__suggest .mono { font-weight: 600; }

/* ---------- Category bar + mega menu (desktop) ---------- */
.catbar { display: none; background: var(--blue-700); }
@media (min-width: 1024px) { .catbar { display: block; } }
.catbar__inner { display: flex; align-items: stretch; gap: var(--s-2); min-height: 44px; }
.catbar__quick { display: flex; flex: 1; min-width: 0; overflow: hidden; }
.catbar__quick li { display: flex; }
.catbar__quick a, .catbar__brands { display: flex; align-items: center; align-self: stretch; padding: 0 var(--s-3); color: #eaf3fc; text-decoration: none; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
.catbar__quick a:hover, .catbar__brands:hover { background: rgba(255, 255, 255, .12); color: var(--white); }

.mega { position: static; }
.mega { display: flex; }
.mega__toggle { display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-4); border: 0;
  background: var(--blue-900); color: var(--white); font-weight: 600; font-size: var(--fs-sm); cursor: pointer;
  text-decoration: none; white-space: nowrap; }
.mega__toggle:visited { color: var(--white); }
.mega__toggle:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--white); }
.mega__toggle:hover, .mega__toggle[aria-expanded="true"] { background: var(--blue-800); }
.mega__caret { transform: rotate(90deg); transition: transform .15s; }
.mega__toggle[aria-expanded="true"] .mega__caret { transform: rotate(-90deg); }

.mega__panel { position: absolute; left: 0; right: 0; top: 100%; z-index: 55;
  display: grid; grid-template-columns: 300px 1fr; max-width: var(--container); margin-inline: auto;
  background: var(--white); border: 1px solid var(--gray-200); border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 170px); overflow: hidden;
  /* The row must be told to fit the container. An implicit `auto` row sizes to its CONTENT, so the
     13-item list stayed 506px tall inside a shorter panel and the overflow was simply clipped away.
     minmax(0, 1fr) caps the row at the panel's height; min-height: 0 below lets the columns shrink
     into it; their own overflow-y: auto then does the scrolling. All three are needed. */
  grid-template-rows: minmax(0, 1fr); }
/* min-height: 0 is load-bearing. A grid item's automatic minimum size is its CONTENT height, so
   without this the roots list refuses to shrink, the panel's max-height clips it with overflow:hidden,
   and `overflow-y: auto` below never activates — the last categories simply vanish on a short window.
   13 categories need ~506px; on a 768px-tall laptop the panel gets calc(100vh - 170px) = 598px, and on
   a shorter window far less. With min-height: 0 the column scrolls and every category stays reachable. */
.mega__roots, .mega__subs { min-height: 0; }
.mega__roots { background: var(--gray-100); border-right: 1px solid var(--gray-200); padding: var(--s-2) 0; overflow-y: auto;
  overscroll-behavior: contain; }
.mega__root { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-4); color: var(--gray-900); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.mega__root span { flex: 1; }
.mega__root .icon { color: var(--blue-600); }
.mega__chev { opacity: 0; color: var(--gray-400); }
.mega__root:hover, .mega__root.is-active { background: var(--white); color: var(--blue-700); box-shadow: inset 3px 0 0 var(--blue-700); }
.mega__root.is-active .mega__chev { opacity: 1; }
.mega__subs { padding: var(--s-5) var(--s-6); overflow-y: auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='%23e3f0fb' stroke-width='2'%3E%3Cpath d='M220 40h-60l-20 20v60l-30 30H40'/%3E%3Cpath d='M220 90h-40l-20 20v80'/%3E%3Ccircle cx='40' cy='150' r='5'/%3E%3Ccircle cx='160' cy='190' r='5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right bottom; }
.mega__title { display: flex; align-items: baseline; gap: var(--s-3); font-size: var(--fs-lg); margin-bottom: var(--s-4); }
.mega__title a { color: var(--gray-900); text-decoration: none; }
.mega__title .muted { font-size: var(--fs-sm); font-weight: 400; }
.mega__links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-1) var(--s-5); }
.mega__links a { display: flex; justify-content: space-between; padding: var(--s-2) 0; border-bottom: 1px solid var(--gray-200); color: var(--gray-700); text-decoration: none; font-size: var(--fs-sm); }
.mega__links a:hover { color: var(--blue-700); border-color: var(--blue-300); }
.mega__links .count { color: var(--gray-400); font-variant-numeric: tabular-nums; }
.mega__all { display: inline-block; margin-top: var(--s-5); font-weight: 600; font-size: var(--fs-sm); }

/* ---------- Mobile drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 80; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(11, 37, 69, .5); cursor: pointer; } /* cursor: iOS Safari only fires click on a <div> that looks clickable */
.drawer__panel { position: absolute; top: 0; bottom: 0; left: 0; width: 88vw; max-width: 360px; background: var(--white); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: calc(var(--s-6) + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-lg); animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .drawer__panel { animation: none; } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4); border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; background: var(--white); }
.drawer__label { padding: var(--s-4) var(--s-4) var(--s-2); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-600); }
.drawer__group summary { display: flex; align-items: center; gap: var(--s-3); min-height: 48px; padding: 0 var(--s-4); cursor: pointer; font-weight: 500; list-style: none; border-bottom: 1px solid var(--gray-200); }
.drawer__group summary::-webkit-details-marker { display: none; }
.drawer__group summary::after { content: "+"; margin-left: auto; font-size: 1.25rem; color: var(--gray-600); }
.drawer__group[open] summary::after { content: "−"; }
.drawer__group summary .icon { color: var(--blue-600); }
.drawer__group ul { background: var(--gray-100); padding: var(--s-1) 0; }
.drawer__group a, .drawer__list a { display: block; padding: var(--s-3) var(--s-4) var(--s-3) 3.25rem; color: var(--gray-900); text-decoration: none; font-size: var(--fs-sm); }
.drawer__list a { padding-left: var(--s-4); border-bottom: 1px solid var(--gray-200); }
html.drawer-open, body.drawer-open { overflow: hidden; }
a.icon-btn { text-decoration: none; }
.icon-btn, .drawer__group summary, .mega__toggle { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--white);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='240' fill='none' stroke='%23ffffff' stroke-opacity='.08' stroke-width='2'%3E%3Cpath d='M0 40h90l30 30h80l20-20h140'/%3E%3Cpath d='M0 120h60l20 20h120l30-30h130'/%3E%3Cpath d='M0 200h140l20-20h60l30 30h110'/%3E%3Ccircle cx='90' cy='40' r='5'/%3E%3Ccircle cx='200' cy='70' r='5'/%3E%3Ccircle cx='80' cy='140' r='5'/%3E%3Ccircle cx='230' cy='110' r='5'/%3E%3Ccircle cx='160' cy='180' r='5'/%3E%3Ccircle cx='250' cy='210' r='5'/%3E%3C/svg%3E"),
    radial-gradient(1200px 500px at 85% 0%, #2e7fd0 0%, transparent 60%),
    linear-gradient(135deg, var(--blue-900) 0%, var(--blue-800) 55%, var(--blue-700) 100%);
}
.hero__grid { display: grid; gap: var(--s-6); padding-block: var(--s-7); }
@media (min-width: 1024px) { .hero__grid { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); align-items: center; padding-block: var(--s-8); gap: var(--s-8); } }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-300); margin-bottom: var(--s-3); }
.hero__title { font-size: var(--fs-3xl); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; max-width: 18ch; }
.hero__title span { color: var(--blue-300); }
.hero__lead { margin-top: var(--s-4); max-width: 58ch; color: #d4e4f5; font-size: var(--fs-lg); }
.search--hero { margin-top: var(--s-5); height: auto; border: 0; background: transparent; gap: var(--s-2); flex-wrap: wrap; }
.search--hero .search__input { flex: 1 1 260px; height: 52px; border-radius: var(--radius); background: var(--white); color: var(--gray-900); padding: 0 var(--s-4); font-size: 16px; }
.search--hero:focus-within { box-shadow: none; }
.search--hero .search__input:focus-visible { box-shadow: 0 0 0 3px var(--blue-300); }
.search--hero .btn { flex: 0 0 auto; }
@media (max-width: 479px) { .search--hero .btn { flex: 1 1 100%; } }
.hero__popular { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-4); font-size: var(--fs-sm); }
.hero__popular .muted { color: #b8cde4; }
.hero .chip { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .25); color: var(--white); }
.hero .chip:hover { background: rgba(255, 255, 255, .18); }

.bom-card { background: var(--white); color: var(--gray-900); border-radius: var(--radius-lg); padding: var(--s-5); box-shadow: var(--shadow-lg); }
.bom-card__title { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-lg); }
.bom-card__title .icon { color: var(--blue-700); }
.bom-card__hint { margin: var(--s-2) 0 var(--s-3); color: var(--gray-600); font-size: var(--fs-sm); }
.bom-card textarea { font-family: var(--font-mono); font-size: var(--fs-sm); resize: vertical; margin-bottom: var(--s-3); }

/* ---------- Trust strip ---------- */
.trust { background: var(--blue-50); border-bottom: 1px solid var(--blue-100); }
.trust__list { display: grid; grid-template-columns: 1fr; gap: var(--s-4); padding-block: var(--s-5); }
@media (min-width: 640px)  { .trust__list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .trust__list { grid-template-columns: repeat(4, 1fr); } }
.trust li { display: flex; gap: var(--s-3); align-items: flex-start; }
.trust .icon { color: var(--blue-700); margin-top: 2px; }
.trust strong { display: block; font-size: var(--fs-sm); }
.trust span { display: block; font-size: var(--fs-xs); color: var(--gray-600); }

/* ---------- Sections ---------- */
.section { padding-block: var(--s-7); }
.section--alt { background: var(--gray-100); }
.section--tight { padding-top: 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-5); }
.section__title, .page-title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.01em; }
.page-title { margin-bottom: var(--s-4); }
.section__link { font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }
.empty { padding: var(--s-6); border: 1px dashed var(--gray-300); border-radius: var(--radius-lg); text-align: center; color: var(--gray-600); }
.empty p + p { margin-top: var(--s-2); }

/* Category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: var(--s-4); }
.cat-tile { display: flex; flex-direction: column; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); background: var(--white); transition: border-color .15s, box-shadow .15s; }
.cat-tile:hover { border-color: var(--blue-300); box-shadow: var(--shadow); }
.cat-tile__main { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon name" "icon count"; column-gap: var(--s-3); padding: var(--s-4); color: var(--gray-900); text-decoration: none; }
.cat-tile__icon { grid-area: icon; display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius); background: var(--blue-50); color: var(--blue-700); }
.cat-tile__name { grid-area: name; font-weight: 700; line-height: 1.3; align-self: end; }
.cat-tile__count { grid-area: count; font-size: var(--fs-xs); color: var(--gray-600); }
.cat-tile__subs { border-top: 1px solid var(--gray-200); padding: var(--s-2) var(--s-4) var(--s-3); margin-top: auto; }
.cat-tile__subs a { display: block; padding: .2rem 0; font-size: var(--fs-sm); color: var(--gray-700); text-decoration: none; }
.cat-tile__subs a:hover { color: var(--blue-700); text-decoration: underline; }

/* Brand tiles — text wordmarks */
.brand-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
@media (min-width: 768px)  { .brand-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .brand-grid { grid-template-columns: repeat(5, 1fr); } }
.brand-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 96px; padding: var(--s-4); text-align: center;
  background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); text-decoration: none; color: var(--blue-900); }
.brand-tile:hover { border-color: var(--blue-500); color: var(--blue-700); }
.brand-tile__name { font-weight: 800; font-size: var(--fs-md); letter-spacing: -.01em; overflow-wrap: anywhere; }
@media (max-width: 399px) { .brand-tile { padding: var(--s-3) var(--s-2); } .brand-tile__name { font-size: var(--fs-sm); } }
.brand-tile__count { font-size: var(--fs-xs); color: var(--gray-600); }
.captcha { margin: 0 0 var(--s-4); min-height: 65px; }
.req { color: var(--red-700); font-weight: 700; }
.panel--danger { border-color: var(--red-700); }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.notif__btn { display: grid; gap: 2px; width: 100%; text-align: left; padding: var(--s-3) var(--s-4); border: 1px solid var(--gray-300); border-radius: var(--radius); background: var(--white); font: inherit; color: inherit; cursor: pointer; }
.notif--unread .notif__btn { border-left: 4px solid var(--blue-700); background: #f3f8fe; }
.notif__title { font-weight: 700; } .notif__body { color: var(--gray-700); font-size: var(--fs-sm); } .notif__time { color: var(--gray-600); font-size: var(--fs-xs); }
.notif__btn:hover { border-color: var(--blue-500); } .notif__btn:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.admin-bar__bell { position: relative; display: inline-flex; padding: var(--s-2); color: #cfe0f3; } .admin-bar__bell .icon { width: 22px; height: 22px; }
.prefs { display: grid; gap: var(--s-3); }
.prefs__row { margin: 0; padding: var(--s-3) var(--s-4); border: 1px solid var(--gray-300); border-radius: var(--radius); }
.prefs__row legend { padding: 0; float: left; width: 100%; margin-bottom: var(--s-2); } .prefs__row legend span { display: block; }
.prefs__choices { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); clear: both; }
.admin-head .badge, .page-title .badge { position: static; display: inline-block; vertical-align: middle; margin-left: var(--s-2); }
.diff { margin: 0; } .diff li { margin: 0 0 2px; } .diff__k { display: inline-block; min-width: 7em; color: var(--gray-600); font-family: var(--font-mono); font-size: var(--fs-xs); }
.row--group td { background: var(--gray-50, #f4f6f9); }
.panel--danger .panel__title { color: var(--red-700); }
.admin-grid { display: grid; gap: var(--s-5); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .admin-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: var(--fs-sm); background: var(--gray-50, #f4f6f9); border-radius: var(--radius); padding: var(--s-3); margin: 0; }
.contact-grid { display: grid; gap: var(--s-5); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.field textarea { width: 100%; max-width: 100%; }
/* "Can't find it?" prompt on categories / listings / search */
.finder { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin: 0 0 var(--s-5); }
.finder__input { flex: 1 1 260px; height: 44px; padding: 0 var(--s-4); border: 1px solid var(--gray-300); border-radius: var(--radius); background: var(--white); font-size: 16px; }
.finder__input:focus-visible { border-color: var(--blue-500); outline: 2px solid var(--blue-500); outline-offset: 1px; }
.ask { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); align-items: center; justify-content: space-between; margin-top: var(--s-6); padding: var(--s-5); border: 1px dashed var(--gray-300); border-radius: var(--radius); background: var(--white); }
.ask__text { margin: 0; max-width: 60ch; }
.ask__text strong { display: block; font-size: var(--fs-md); }
.ask .btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.captcha .cf-turnstile { max-width: 100%; }
/* Brands page tools: find + sort */
.brand-tools { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin: 0 0 var(--s-5); }
.brand-tools__input { flex: 1 1 240px; height: 44px; padding: 0 var(--s-4); border: 1px solid var(--gray-300); border-radius: var(--radius); background: var(--white); font-size: 16px; }
.brand-tools__input:focus-visible { border-color: var(--blue-500); outline: 2px solid var(--blue-500); outline-offset: 1px; }
.segmented { display: inline-flex; border: 1px solid var(--gray-300); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.segmented__btn { min-height: 44px; padding: 0 var(--s-4); border: 0; background: transparent; color: var(--gray-900); font: inherit; font-weight: 600; cursor: pointer; }
.segmented__btn + .segmented__btn { border-left: 1px solid var(--gray-300); }
.segmented__btn.is-active { background: var(--blue-700); color: var(--white); }
.segmented__btn:focus-visible { outline: 2px solid var(--blue-500); outline-offset: -2px; }

/* Product cards */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--s-4); }
.pcard { display: flex; flex-direction: column; padding: var(--s-4); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); background: var(--white); }
.pcard:hover { border-color: var(--blue-300); box-shadow: var(--shadow); }
.pcard__top { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
.pcard__brand { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--blue-700); }
.pcard__mpn { font-family: var(--font-mono); font-size: var(--fs-lg); font-weight: 700; word-break: break-all; }
.pcard__mpn a { color: var(--gray-900); text-decoration: none; }
.pcard__mpn a:hover { color: var(--blue-700); text-decoration: underline; }
.pcard__name { margin-top: var(--s-1); font-size: var(--fs-sm); color: var(--gray-700); line-height: 1.4; }
.pcard__sku { margin-top: var(--s-2); font-size: var(--fs-xs); color: var(--gray-600); }
.pcard__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3); margin-top: auto; padding-top: var(--s-4); }
.pcard__price { font-weight: 800; font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.pcard__price .muted { font-size: var(--fs-xs); font-weight: 400; }
.pcard__tier { font-size: var(--fs-xs); color: var(--green-700); }
.pcard__add { display: flex; gap: var(--s-1); }
.qty { width: 72px; min-height: 36px; padding: 0 var(--s-2); border: 1px solid var(--gray-300); border-radius: var(--radius); text-align: right; font-variant-numeric: tabular-nums; }
.stock { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--fs-xs); font-weight: 600; }
.stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stock--in { color: var(--green-700); } .stock--low { color: var(--amber-700); } .stock--out { color: var(--red-700); }
/* Sourced to order: not a failure state like "out of stock", so it reads blue rather than red. */
.stock--order { color: var(--blue-700); }

/* Price on request */
.price-request { margin-top: var(--s-2); font-weight: 800; font-size: var(--fs-xl); color: var(--blue-800); }
.pcard__price--request { font-size: var(--fs-base); color: var(--blue-700); }
.quote-form { border-top: 1px solid var(--gray-200); padding-top: var(--s-4); }
.quote-form__title { margin: 0; font-size: var(--fs-base); font-weight: 700; }
.quote-form .form-grid { gap: var(--s-3); }
details#quote > summary { cursor: pointer; color: var(--blue-700); }
details#quote[open] > summary { margin-bottom: var(--s-2); font-weight: 600; }

/* Policy notice */
.notice { display: flex; gap: var(--s-4); padding: var(--s-5); background: var(--amber-50); border: 1px solid var(--amber-300); border-left-width: 5px; border-radius: var(--radius-lg); }
.notice > .icon { color: var(--amber-700); margin-top: 2px; }
.notice__title { font-size: var(--fs-md); margin-bottom: var(--s-1); }
.notice p { font-size: var(--fs-sm); color: var(--gray-700); max-width: 90ch; margin-bottom: var(--s-2); }
.notice a { font-weight: 600; font-size: var(--fs-sm); }

/* Tables */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); background: var(--white); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table caption { text-align: left; padding: var(--s-3) var(--s-4); font-weight: 700; }
.table th, .table td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--gray-200); text-align: left; vertical-align: top; }
.table thead th { background: var(--gray-100); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--gray-700); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table--compact td, .table--compact th { padding: var(--s-2) var(--s-3); }
.error-list { color: var(--red-700); }

/* ---------- Footer ---------- */
.site-footer { background: var(--blue-900); color: #c3d4e8; font-size: var(--fs-sm); margin-top: var(--s-6); }
.footer-grid { display: grid; gap: var(--s-6); padding-block: var(--s-7); grid-template-columns: 1fr; }
@media (min-width: 640px)  { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-title { color: var(--white); font-size: var(--fs-sm); font-weight: 700; margin-bottom: var(--s-3); }
.footer-col li { margin-bottom: var(--s-2); }
.footer-col a { color: #dbe7f5; text-decoration: none; }
.footer-col a:hover { color: var(--white); text-decoration: underline; }
.footer-col--about p + p { margin-top: var(--s-3); }
.footer-meta { color: #9fb6d0; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding-block: var(--s-4); font-size: var(--fs-xs); color: #9fb6d0; }
.footer-disclaimer { margin-top: var(--s-1); max-width: 110ch; }

/* ---------- Error / minimal pages ---------- */
.minimal__main { max-width: 640px; padding-block: var(--s-7); }
.plain-list { list-style: none; padding: 0; margin: 0 0 var(--s-4); }
.maint-banner { margin: 0; padding: var(--s-2) var(--s-4); background: #fff4d6; color: #5c3d00; border-bottom: 1px solid #f0d58a; font-size: var(--fs-sm); text-align: center; }
.error-page { margin-top: var(--s-6); }
.error-page__code { font-family: var(--font-mono); font-size: 3rem; font-weight: 800; color: var(--blue-300); line-height: 1; }
.error-page h1 { margin: var(--s-2) 0; }
.error-page > p { margin-bottom: var(--s-4); color: var(--gray-700); }
.search--inline { height: auto; border: 0; gap: var(--s-2); margin-bottom: var(--s-4); }
.search--inline input { flex: 1; min-width: 0; min-height: 44px; border: 1px solid var(--gray-300); border-radius: var(--radius); padding: 0 var(--s-3); font-family: var(--font-mono); }
.search--inline:focus-within { box-shadow: none; }
.btn--wrap { white-space: normal; overflow-wrap: anywhere; text-align: center; max-width: 100%; }

/* ---------- Admin ---------- */
body.admin { background: var(--gray-100); }
.admin-bar { background: var(--blue-900); color: var(--white); }
.admin-bar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); min-height: 60px; padding-block: var(--s-2); }
.admin-bar__brand { display: flex; align-items: center; gap: var(--s-3); color: var(--white); text-decoration: none; font-weight: 700; }
.admin-bar__brand img { background: var(--white); border-radius: var(--radius-sm); padding: 2px 4px; height: 36px; width: auto; }
.admin-nav { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.admin-nav a, .admin-nav__soon { display: block; padding: var(--s-2) var(--s-3); border-radius: var(--radius); color: #cfe0f3; text-decoration: none; font-size: var(--fs-sm); }
.admin-nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); color: var(--white); font-weight: 600; }
.admin-nav__soon { opacity: .5; cursor: not-allowed; }
.admin-bar__user { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); }
.admin-main { padding-block: var(--s-6); }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.admin-head .page-title { margin: 0; }
.admin-cols { display: grid; gap: var(--s-5); }
@media (min-width: 1024px) { .admin-cols { grid-template-columns: 3fr 2fr; align-items: start; } }
.panel { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: var(--s-5); margin-bottom: var(--s-5); box-shadow: var(--shadow-sm); }
.panel__title { font-size: var(--fs-lg); margin-bottom: var(--s-4); }
.panel--help { background: var(--blue-50); border-color: var(--blue-100); }
.help-list { padding-left: 1.1rem; font-size: var(--fs-sm); color: var(--gray-700); }
.help-list li { margin-bottom: var(--s-2); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); margin-bottom: var(--s-4); }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats div { padding: var(--s-3) var(--s-4); background: var(--gray-100); border-radius: var(--radius); }
.stats dt { font-size: var(--fs-xs); color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; }
.stats dd { margin: 0; font-size: var(--fs-2xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.stats .ok { color: var(--green-700); } .stats .bad { color: var(--red-700); }
.confirm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-4); margin-bottom: var(--s-4); background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--radius); font-size: var(--fs-sm); }
.confirm-bar__actions { display: flex; gap: var(--s-2); }
.auth-card { max-width: 400px; margin: var(--s-7) auto; background: var(--white); padding: var(--s-6); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.auth-card img { height: 64px; width: auto; margin: 0 auto var(--s-4); }
.auth-card h1 { font-size: var(--fs-xl); text-align: center; margin-bottom: var(--s-5); }

/* ---------- Checkout policy acknowledgement ---------- */
.policy-ack { border: 2px solid var(--amber-300); background: var(--amber-50); border-radius: var(--radius-lg); padding: var(--s-5); }
.policy-ack__title { font-size: var(--fs-lg); margin-bottom: var(--s-3); }
.policy-ack__body { max-height: 220px; overflow-y: auto; padding: var(--s-3) var(--s-4); background: var(--white); border: 1px solid var(--gray-300);
  border-radius: var(--radius); font-size: var(--fs-sm); margin-bottom: var(--s-4); }
.policy-ack__body ul { padding-left: 1.2rem; margin: var(--s-2) 0; }
.policy-ack__body p + p { margin-top: var(--s-2); }
.policy-ack .choice { font-size: var(--fs-md); padding: var(--s-2) 0; }
.policy-ack.has-error { border-color: var(--red-700); }
.policy-ack__error { color: var(--red-700); font-weight: 600; font-size: var(--fs-sm); margin-top: var(--s-2); }

@media print { .topbar, .site-header, .site-footer, .drawer { display: none !important; } }

/* ---------- Admin: lists, filters, badges, detail pages ---------- */
.status { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.status--ok { background: var(--green-50); color: var(--green-700); }
.status--warn { background: var(--amber-50); color: var(--amber-700); }
.status--bad { background: var(--red-50); color: var(--red-700); }
.status--info { background: var(--blue-100); color: var(--blue-800); }
.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: flex-end; margin-bottom: var(--s-4); }
.filters label { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-xs); font-weight: 600; color: var(--gray-700); }
.filters input, .filters select, .form-grid input, .form-grid select, .form-grid textarea, .inline-form input, .inline-form select {
  min-height: 40px; padding: 0 var(--s-3); border: 1px solid var(--gray-300); border-radius: var(--radius); background: var(--white); font-size: var(--fs-sm); }
.form-grid textarea { padding: var(--s-2) var(--s-3); min-height: 90px; }
.tabs { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-bottom: var(--s-4); border-bottom: 1px solid var(--gray-300); }
.tabs a { padding: var(--s-2) var(--s-3); color: var(--gray-700); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--blue-700); border-bottom-color: var(--blue-700); }
.tabs .count { color: var(--gray-600); font-weight: 400; }
.pager { display: flex; align-items: center; justify-content: center; gap: var(--s-3); margin-top: var(--s-4); }
.table tr.is-low td { background: #fffaf0; }
.table td .sub { display: block; font-size: var(--fs-xs); color: var(--gray-600); }
.form-grid { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 768px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .span-2 { grid-column: span 2; } }
.form-grid label { display: flex; flex-direction: column; gap: var(--s-1); font-size: var(--fs-sm); font-weight: 600; }
.form-grid .hint, .form-grid label .muted { font-weight: 400; font-size: var(--fs-xs); color: var(--gray-600); }
/* A checkbox inside a form grid: ".form-grid label" (column flex) and ".form-grid input" (width 100%)
   both outrank .choice on specificity, which stacks the box above its text and stretches it full width.
   Put the row back. */
.form-grid label.choice { flex-direction: row; align-items: center; gap: var(--s-2); }
/* min-height always beats height, and the shared field rule sets 40px — so reset it too, or the box
   renders 18px wide and 40px tall. */
.form-grid label.choice input[type="checkbox"] {
  width: 1.1rem; height: 1.1rem; min-height: 0; flex: none; margin-top: 0; padding: 0; }
.form-grid label.choice .hint { display: inline; }
.ai-draft { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.ai-draft .hint { flex: 1 1 240px; }
.ai-draft .btn--warn { background: var(--amber-50); border-color: var(--amber-300); color: var(--amber-700); }
.detail-grid { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); }
.detail-grid > *, .admin-cols > * { min-width: 0; }
@media (min-width: 1024px) { .detail-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-1) var(--s-4); font-size: var(--fs-sm); }
.kv dt { color: var(--gray-600); } .kv dd { margin: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: flex-end; }
.inline-form label { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-xs); font-weight: 600; }
.stack > * + * { margin-top: var(--s-3); }
.timeline { list-style: none; padding: 0; margin: 0; font-size: var(--fs-sm); }
.timeline li { padding: var(--s-2) 0; border-bottom: 1px solid var(--gray-200); }
.dash-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin-bottom: var(--s-5); }
.dash-card { display: block; padding: var(--s-5); background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); text-decoration: none; color: var(--gray-900); }
.dash-card:hover { border-color: var(--blue-300); box-shadow: var(--shadow); }
.dash-card__num { display: block; font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.dash-card__label { color: var(--gray-600); font-size: var(--fs-sm); }
.dash-card--alert .dash-card__num { color: var(--red-700); }
.btn--danger { background: var(--white); border-color: #f3c1bc; color: var(--red-700); }
.btn--danger:hover { background: var(--red-50); color: var(--red-700); }
.field-error { color: var(--red-700); font-size: var(--fs-xs); font-weight: 600; }
[aria-invalid="true"] { border-color: var(--red-700) !important; }
.mt-4 { margin-top: var(--s-4); } .mt-5 { margin-top: var(--s-5); } .grow { flex: 1; }
.text-danger { color: var(--red-700); } .nowrap { white-space: nowrap; }
.form-grid :is(input, select, textarea), .filters :is(input, select), .inline-form :is(input, select, textarea) { font-weight: 400; color: var(--gray-900); }

/* ---------- Storefront: catalogue, product page, cart, checkout, orders ---------- */
.section--first { padding-top: var(--s-5); }
.section__subtitle { font-size: var(--fs-xl); font-weight: 800; margin-bottom: var(--s-3); }
.narrow { max-width: 860px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: var(--s-1); list-style: none; padding: 0; margin: 0 0 var(--s-3); font-size: var(--fs-sm); color: var(--gray-600); }
.crumbs li + li::before { content: "/"; margin-right: var(--s-1); color: var(--gray-400); }
.crumbs a { color: var(--gray-700); text-decoration: none; } .crumbs a:hover { color: var(--blue-700); text-decoration: underline; }
.listing-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.listing-head .page-title { margin: 0; }
.subcat-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.chip--lg { font-family: var(--font-sans); font-size: var(--fs-sm); padding: .35rem .8rem; }
.listing-filters { padding: var(--s-3) var(--s-4); background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); }
.listing-filters .choice { align-self: center; }
.cat-index { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.cat-index h2 { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-lg); margin-bottom: var(--s-2); }
.cat-index h2 a { display: flex; align-items: center; gap: var(--s-2); color: var(--gray-900); text-decoration: none; }
.cat-index h2 .icon { color: var(--blue-700); }
.cat-index li { padding: .2rem 0; font-size: var(--fs-sm); }

.pdp { display: grid; gap: var(--s-6); }
/* Mobile order: part header → price/buy box → description & specs. Desktop: buy box in a sticky right column. */
.pdp { grid-template-areas: "gallery" "main" "buy" "body"; }
.pdp__gallery { grid-area: gallery; min-width: 0; }
.pdp__main { grid-area: main; } .pdp__buy { grid-area: buy; } .pdp__body { grid-area: body; }
@media (min-width: 1024px) {
  .pdp { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "gallery buy" "main buy" "body buy"; grid-template-rows: auto auto 1fr; align-items: start; }
  .pdp__buy { position: sticky; top: 180px; }
}
.pdp__brand a { font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-decoration: none; }
.pdp__mpn { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); font-weight: 800; word-break: break-all; margin: var(--s-1) 0; }
.pdp__name { font-size: var(--fs-lg); color: var(--gray-700); margin-bottom: var(--s-4); }
.pdp__stock { font-size: var(--fs-md); }
.pdp__total { margin: 0; align-self: center; }
.pdp__assure { list-style: none; padding: 0; margin: var(--s-4) 0 0; border-top: 1px solid var(--gray-200); font-size: var(--fs-sm); color: var(--gray-700); }
.pdp__assure li { display: flex; gap: var(--s-2); align-items: flex-start; padding-top: var(--s-2); }
.pdp__assure .icon { color: var(--blue-700); margin-top: 2px; }
.qty--lg { width: 110px; min-height: 44px; font-size: var(--fs-md); }
tr.is-current td { background: var(--blue-50); font-weight: 700; }

.cart-table td { vertical-align: middle; }
.totals dt, .totals dd { padding: 2px 0; }
.totals dd { text-align: right; font-variant-numeric: tabular-nums; }
.totals { grid-template-columns: 1fr auto; }
.totals__grand { font-weight: 800; font-size: var(--fs-lg); border-top: 1px solid var(--gray-200); padding-top: var(--s-2) !important; }
.summary-lines { list-style: none; padding: 0; margin: 0; font-size: var(--fs-sm); }
.summary-lines li { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-1) 0; border-bottom: 1px dashed var(--gray-200); }
.checkout-fieldset { border: 0; padding: 0; margin: 0; }
.checkout-fieldset legend { font-weight: 700; font-size: var(--fs-lg); margin-bottom: var(--s-2); padding: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.progress { display: flex; flex-wrap: wrap; gap: var(--s-1); list-style: none; padding: 0; margin: var(--s-4) 0; counter-reset: step; }
.progress li { flex: 1 1 100px; padding: var(--s-2) var(--s-3); border-top: 4px solid var(--gray-200); font-size: var(--fs-sm); color: var(--gray-600); }
.progress li.is-done { border-color: var(--green-700); color: var(--gray-900); }
.progress li.is-current { border-color: var(--blue-700); color: var(--blue-800); font-weight: 700; }

.prose h2 { font-size: var(--fs-xl); margin: var(--s-5) 0 var(--s-2); }
.prose p, .prose li { color: var(--gray-700); }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li + li { margin-top: var(--s-2); }
.prose .panel ul { padding-left: 1.2rem; }
p.notice { display: block; }
fieldset { min-width: 0; }
.form-grid :is(input, select, textarea) { width: 100%; min-width: 0; }

.prose .lead { font-size: var(--fs-lg); color: var(--gray-700); }
.not-italic { font-style: normal; line-height: 1.6; }
.listing-intro { max-width: 70ch; color: var(--gray-700); margin: 0 0 var(--s-4); }

/* ---------- GST invoice (print view) ---------- */
.inv-body { background: var(--gray-100); }
.inv { max-width: 900px; margin: var(--s-5) auto; padding: var(--s-6); background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); font-size: var(--fs-sm); }
.inv__toolbar { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-5); }
.inv__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); padding: var(--s-4); background: var(--blue-900, #0b2545); color: var(--white); border-radius: var(--radius); }
.inv__head .muted { color: #c8d6e8; }
.inv__co { font-size: var(--fs-lg); font-weight: 700; margin: 0; }
.inv__title { text-align: right; font-size: var(--fs-lg); }
.inv__meta { display: grid; grid-template-columns: 1fr auto; gap: var(--s-5); margin: var(--s-4) 0; }
.inv__meta p { margin: 0 0 var(--s-1); }
.inv__kv { display: grid; grid-template-columns: auto auto; gap: 2px var(--s-4); margin: 0; }
.inv__kv dt { color: var(--gray-600); } .inv__kv dd { margin: 0; text-align: right; }
.inv__parties { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); margin-bottom: var(--s-3); }
.inv__party { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: var(--s-3); }
.inv__party h2 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--gray-600); margin: 0 0 var(--s-2); }
.inv__party p { margin: 0; }
.inv__table { min-width: 720px; }
.inv__table th { white-space: nowrap; }
.inv__totals { display: grid; grid-template-columns: 1fr minmax(240px, 320px); gap: var(--s-5); align-items: start; margin-top: var(--s-4); }
.inv__foot { display: grid; grid-template-columns: 1fr auto; gap: var(--s-5); margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--gray-200); }
.inv__sign { text-align: right; min-width: 220px; }
.inv__sign p:first-child { margin-bottom: var(--s-6); }
@media (max-width: 720px) {
  .inv { padding: var(--s-4); }
  .inv__meta, .inv__parties, .inv__totals, .inv__foot { grid-template-columns: 1fr; }
  .inv__kv dd { text-align: left; }
  .inv__sign { text-align: left; }
}
@media print {
  .no-print { display: none !important; }
  .inv-body { background: #fff; }
  .inv { box-shadow: none; margin: 0; max-width: none; padding: 0; }
  .inv__head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-wrap { overflow: visible; }
}

/* ---------- Admin: users ---------- */
.form-grid__actions { align-self: end; }
@media (min-width: 768px) { .form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.table tr.is-muted td { color: var(--gray-600); background: var(--gray-50, #fafbfc); }
.row-actions summary { list-style: none; display: inline-flex; }
.row-actions summary::-webkit-details-marker { display: none; }
.row-actions[open] summary { background: var(--gray-100); }
.row-actions .inline-form label { font-size: var(--fs-xs); }

/* ---------- Admin: product photos ---------- */
.img-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--s-3); }
.img-grid__item { position: relative; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: var(--s-2); background: var(--white); display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.img-grid__item.is-primary { border-color: var(--blue-500); }
.img-grid__item img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; background: var(--white); border-radius: var(--radius); }
.img-grid__badge { position: absolute; top: var(--s-2); left: var(--s-2); background: var(--blue-700); color: var(--white); font-size: var(--fs-xs); font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.img-grid__actions { display: flex; flex-direction: column; gap: var(--s-1); }
.img-grid__actions .btn { width: 100%; }
input[type="file"] { max-width: 100%; min-width: 0; }
.form-grid label, .stack label { min-width: 0; }

/* ---------- Product photos (storefront) ---------- */
.pdp__gallery-main { border: 1px solid var(--gray-200); border-radius: var(--radius-lg); background: var(--white); padding: var(--s-3); }
.pdp__gallery-main img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; }
.pdp__thumbs { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: flex; gap: var(--s-2); flex-wrap: wrap; }
.pdp__thumb { display: block; width: 64px; height: 64px; padding: 2px; border: 2px solid var(--gray-200); border-radius: var(--radius); background: var(--white); cursor: pointer; }
.pdp__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pdp__thumb.is-active, .pdp__thumb:hover { border-color: var(--blue-500); }
.pdp__thumb:focus-visible { outline: 3px solid var(--blue-300, #9cc4f0); outline-offset: 2px; }
.pcard__img { display: block; margin: calc(-1 * var(--s-4)) calc(-1 * var(--s-4)) var(--s-3); border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow: hidden; background: var(--white); border-bottom: 1px solid var(--gray-200); }
.pcard__img img { display: block; width: 100%; height: 160px; object-fit: contain; }

/* ---- Admin rich-text editor */
.rte { border: 1px solid var(--gray-300); border-radius: var(--radius); background: var(--white); }
.rte__bar { display: flex; flex-wrap: wrap; gap: 2px; padding: var(--s-2); border-bottom: 1px solid var(--gray-200); background: var(--gray-100); border-radius: var(--radius) var(--radius) 0 0; position: sticky; top: 0; z-index: 1; }
.rte__bar button { min-height: 32px; padding: 0 var(--s-3); border: 1px solid transparent; border-radius: var(--radius-sm, 4px); background: transparent; font: inherit; font-size: var(--fs-sm); cursor: pointer; color: var(--gray-800); }
.rte__bar button:hover, .rte__bar button[aria-pressed="true"] { background: var(--white); border-color: var(--gray-300); }
.rte__bar button:focus-visible { outline: 2px solid var(--blue-700); outline-offset: 1px; }
.rte__sep { width: 1px; background: var(--gray-300); margin: 4px var(--s-1); }
.rte__area { min-height: 260px; max-height: 70vh; overflow: auto; padding: var(--s-4); outline: none; }
.rte__area p, .rte__area ul, .rte__area ol, .rte__area h2, .rte__area h3 { margin-bottom: var(--s-3); }
.rte__area:focus { box-shadow: inset 0 0 0 2px var(--blue-100, #dbeafe); }
.rte__area:empty::before { content: "Start typing…"; color: var(--gray-500); }
.rte__source { width: 100%; border: 0; border-radius: 0; padding: var(--s-4); font-size: var(--fs-sm); min-height: 260px; }
.rte__count { margin: 0; padding: var(--s-2) var(--s-4); border-top: 1px solid var(--gray-200); }
.rte__count.is-over { color: var(--red-700, #b91c1c); font-weight: 600; }
.export-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: calc(var(--s-4) * -1 + 0px) 0 var(--s-4); }
.export-bar .hint { flex: 1 1 100%; color: var(--gray-600); font-size: var(--fs-xs); }

/* ---- Admin: export panel + bulk stock sheet */
.export-details { margin-bottom: var(--s-4); padding: 0; }
.export-details > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-3);
  padding: var(--s-3) var(--s-4); cursor: pointer; font-size: var(--fs-sm); font-weight: 600; list-style: none; }
.export-details > summary::-webkit-details-marker { display: none; }
.export-details > summary::before { content: "▸"; color: var(--gray-600); font-weight: 400; }
.export-details[open] > summary::before { content: "▾"; }
.export-details[open] > summary { border-bottom: 1px solid var(--gray-200); }
.export-details > summary .hint { font-weight: 400; color: var(--gray-600); font-size: var(--fs-xs); }
.export-details > summary:hover { background: var(--gray-100); }
.export-details > summary:focus-visible { outline: 2px solid var(--blue-700); outline-offset: -2px; }
.export-bar { display: grid; gap: var(--s-3); padding: var(--s-4); }
.export-bar p { margin: 0; }
.export-bar .hint { display: block; font-weight: 400; color: var(--gray-600); font-size: var(--fs-xs); }
.export-bar__grid { display: grid; gap: var(--s-2) var(--s-4); margin: 0; }
.export-bar__grid dt { font-weight: 600; font-size: var(--fs-sm); }
.export-bar__grid dd { margin: 0 0 var(--s-2); display: flex; flex-wrap: wrap; gap: var(--s-2); }
@media (min-width: 720px) { .export-bar__grid { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .export-bar__grid dd { margin-bottom: 0; } }
.stock-sheet__bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); margin-bottom: var(--s-3); }
.stock-sheet__bar .panel, .stock-sheet__bar p { margin: 0; }
.stock-sheet__find, .stock-sheet__note { flex: 1 1 220px; display: block; font-size: var(--fs-sm); font-weight: 600; }
.stock-sheet__find input, .stock-sheet__note input { width: 100%; margin-top: var(--s-1); }
.stock-sheet__count { flex: 0 0 auto; }
.stock-sheet__input { width: 7.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.stock-sheet tr.is-changed { background: var(--amber-50); }
.stock-sheet tr.is-changed .stock-sheet__input { border-color: var(--amber-300); font-weight: 700; }
.stock-sheet [data-delta] { font-variant-numeric: tabular-nums; }
/* Phones: drop the columns you don't need while counting so the grid fits without sideways scrolling
   (Brand·Category, Reserved and Change; a reserved-stock clash is still explained on save). */
@media (max-width: 720px) {
  .stock-sheet__input { width: 5rem; }
  .stock-sheet th:nth-child(3), .stock-sheet td:nth-child(3),
  .stock-sheet th:nth-child(4), .stock-sheet td:nth-child(4),
  .stock-sheet th:nth-child(7), .stock-sheet td:nth-child(7) { display: none; }
  .stock-sheet__bar { gap: var(--s-2); }
  .stock-sheet__count { flex: 1 1 100%; }
  .stock-sheet th, .stock-sheet td { padding: var(--s-2); font-size: var(--fs-xs); }
  .stock-sheet td:first-child { max-width: 5.5rem; }
  .stock-sheet td:first-child .sub { display: none; }   /* MPN: the name carries it, the row is narrow */
  /* Two lines of the name is enough to recognise the part; the SKU column is the one being matched
     against the shelf label, and the full name is in the link's tooltip and on the product page. */
  .stock-sheet td:nth-child(2) { max-width: 10rem; }
  .stock-sheet td:nth-child(2) a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; overflow-wrap: anywhere; }
}
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.panel__head .panel__title { margin: 0; }
.status--neutral { background: var(--gray-100); color: var(--gray-700); }
.break-all { overflow-wrap: anywhere; word-break: break-all; }
.totals-row { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: 0; }
.totals-row dt { font-size: var(--fs-xs); color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; }
.totals-row dd { margin: 0 var(--s-4) 0 0; font-variant-numeric: tabular-nums; }
@media (min-width: 560px) { .totals-row { display: grid; grid-template-columns: repeat(5, auto); justify-content: start; }
  .totals-row dt { grid-row: 1; } .totals-row dd { grid-row: 2; } }

/* ------------------------------------------------ Insights sparklines
   A 30-day visitor count drawn inline in the table row. No library, no script: the SVG is built
   server-side in app/Views/admin/insights.php, so it works under the strict CSP and prints. */
.spark { display: block; overflow: visible; }
.spark polyline {
  fill: none;
  stroke: var(--blue-600);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
@media (prefers-contrast: more) { .spark polyline { stroke-width: 2; } }

/* ------------------------------------------------ Home: category + brand split
   Two columns from 1024px up, stacked below it. Source order is categories then brands, which is
   also the order wanted on a phone, so no ordering tricks are needed — the DOM is already right. */
.home-split__grid { display: grid; gap: var(--s-7); }
.home-split__col { min-width: 0; }                 /* without this, a long brand name blows the column out */

@media (min-width: 1024px) {
  .home-split__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: var(--s-6); align-items: start; }
  /* Both grids are sized for a full-width row; inside a half-width column they need fewer tracks.
     5 brand tiles across a half column would be ~110px each — unreadable. */
  .home-split .cat-grid   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 2 across, not 3: wider tiles read better in half a container, and 18 brands over 9 rows comes
     closer to the height of the category column beside it than 6 rows ever could. */
  .home-split .brand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .home-split .cat-grid { grid-template-columns: minmax(0, 1fr); }   /* tiles keep their sub-links readable */
}

/* ------------------------------------------------ Admin: folded diagnostics panel */
.panel--fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: var(--s-3); }
.panel--fold > summary::-webkit-details-marker { display: none; }
.panel--fold > summary::after {
  content: ""; width: .5rem; height: .5rem; margin-left: auto; flex: none;
  border-right: 2px solid var(--gray-600); border-bottom: 2px solid var(--gray-600);
  transform: rotate(45deg); transition: transform .15s;
}
.panel--fold[open] > summary::after { transform: rotate(-135deg); }
.panel--fold > summary:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.panel__fold { margin-top: var(--s-4); }

/* The admin logo now leaves the dashboard, so make it look like a link on hover. */
.admin-bar__brand:hover span:first-of-type { text-decoration: underline; }

/* ------------------------------------------------ Representative (borrowed) product images
   A part too small to photograph shows its category's picture. It must never read as a photo OF
   this part: the detail page carries a sentence, the card a corner flag, and both are muted so a
   real photo still looks like the stronger signal. */
.pdp__gallery-main--representative img { opacity: .94; }
.pdp__repnote {
  margin-top: var(--s-3); padding: var(--s-3) var(--s-4);
  background: var(--amber-50); border: 1px solid var(--amber-300); border-radius: var(--radius);
  color: var(--gray-700); font-size: var(--fs-sm); line-height: 1.5;
}
.pcard__img--rep { position: relative; }
.pcard__repflag {
  position: absolute; left: var(--s-2); bottom: var(--s-2);
  padding: 2px var(--s-2); border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .92); border: 1px solid var(--gray-300);
  color: var(--gray-600); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .01em;
}
.content-image-preview {
  width: auto; max-width: 200px; height: auto; border: 1px solid var(--gray-300);
  border-radius: var(--radius); background: var(--white);
}

/* Show / hide password. The button sits inside the field's right-hand padding, which is reserved at a
   fixed width so the typed text never runs underneath it and nothing shifts when the label swaps
   between "Show" and "Hide". The input keeps its existing border and background — the rule at the top
   of this file already covers type="text" alongside type="password", so revealing changes nothing
   visually except the characters. */
.pw { position: relative; display: block; }
/* The type selectors are needed, not decorative: the base field rule near the top of this file
   is `.field input[type="password"], …`, which outranks a plain `.pw input` and put the padding
   back to 12px wherever a password box sits inside a .field — i.e. sign-in, reset and setup, but
   NOT register, which uses bare labels. A long password then ran underneath the Show/Hide button
   on exactly the page people use most. Matching the same shape makes the two rules equal and the
   later one (this) win. */
.pw input[type="password"], .pw input[type="text"] { width: 100%; padding-right: 4.5rem; }
/* Height follows the field rather than a forced 44px minimum. Every customer-facing password box is
   already min-height:44px (see .field input above), so the tap target is met there without help; the
   only shorter ones are the 40px admin inline forms, which are staff-only on a desktop with a mouse.
   Forcing 44px there made the button hang 4px below the field and pushed its label out of line. */
.pw__toggle {
  position: absolute; top: 0; right: 0; height: 100%; min-width: 4rem;
  padding: 0 var(--s-3); border: 0; background: none; color: var(--blue-700);
  font: inherit; font-size: var(--fs-sm); font-weight: 600; line-height: 1; cursor: pointer;
}
.pw__toggle:hover { color: var(--blue-900); text-decoration: underline; }
.pw__toggle:focus-visible { outline: 2px solid var(--blue-500); outline-offset: -2px; border-radius: var(--radius); }

/* ---------- UPI payment (manual QR route) ---------- */
/* The QR is the only thing on the page that MUST stay crisp and square-ish, so it is capped by width
   rather than stretched to the panel: a QR scaled past its natural size gets soft and phones give up
   on it. 18rem is comfortably scannable on a 360px phone held at arm's length and still fits beside
   the form on a laptop. The white plate matters too — a dark-mode or tinted background behind a QR
   lowers the contrast the camera is looking for. */
.upi-qr { margin: var(--s-5) 0 0; text-align: center; }
.upi-qr img {
  display: block; width: 100%; max-width: 18rem; height: auto; margin: 0 auto var(--s-3);
  background: #fff; padding: var(--s-3); border: 1px solid var(--gray-300); border-radius: var(--radius-lg);
}
.upi-steps { margin: 0; padding-left: var(--s-5); display: grid; gap: var(--s-2); font-size: var(--fs-sm); }
.upi-steps li { padding-left: var(--s-1); }
/* The claim list in the admin queue: one card per waiting payment, widest field (the reference) on its
   own line so a 12-digit UTR never wraps mid-number where staff are comparing it against a statement. */
.upi-claim { border: 1px solid var(--gray-300); border-radius: var(--radius); padding: var(--s-4); display: grid; gap: var(--s-3); }
.upi-claim + .upi-claim { margin-top: var(--s-4); }
.upi-claim__utr { font-size: var(--fs-lg); font-weight: 700; letter-spacing: .04em; }
.upi-claim__warn { color: var(--red-700); font-weight: 600; }

/* ------------------------------------------------ Admin: grouped nav menus
   Fifteen links in one row read as a list, not a menu. Each group is a native <details>, so the
   menus work with the keyboard and with JavaScript switched off; app.js only adds one-open-at-a-time,
   Escape and click-outside. The panel anchors to the <li> on a desktop and to the whole bar on a
   phone, where a 13rem box hanging off the right edge of a 360px screen is the usual failure. */
.admin-bar__inner { position: relative; }
.admin-menu { position: relative; }
.admin-menu > details > summary {
  display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3);
  border-radius: var(--radius); color: #cfe0f3; font-size: var(--fs-sm);
  cursor: pointer; white-space: nowrap; list-style: none;
}
.admin-menu > details > summary::-webkit-details-marker { display: none; }   /* Safari keeps its own triangle */
.admin-menu > details > summary::after {
  content: ''; width: .4em; height: .4em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-.15em) rotate(45deg); transition: transform .15s;
}
.admin-menu > details[open] > summary::after { transform: translateY(.12em) rotate(-135deg); }
.admin-menu > details > summary:hover,
.admin-menu > details[open] > summary { background: rgba(255, 255, 255, .12); color: var(--white); }
.admin-menu > details > summary:focus-visible { outline: 2px solid var(--white); outline-offset: 1px; }
/* The group holding the page you are on, so you can see where you are without opening anything. */
.admin-menu[data-current] > details > summary { color: var(--white); font-weight: 600; }

.admin-menu__panel {
  position: absolute; z-index: 60; top: calc(100% + var(--s-2)); left: 0;
  min-width: 13rem; padding: var(--s-2); background: var(--white);
  border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.admin-menu--end .admin-menu__panel { left: auto; right: 0; }
.admin-menu__panel a {
  display: block; padding: var(--s-2) var(--s-3); border-radius: var(--radius);
  color: var(--gray-900); text-decoration: none; font-size: var(--fs-sm); white-space: nowrap;
}
.admin-menu__panel a:hover { background: var(--gray-100); color: var(--blue-700); }
.admin-menu__panel a[aria-current="page"] { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }

@media (max-width: 639px) {
  /* Anchor to the bar, not the button: full width, so nothing can be pushed off-screen. */
  .admin-menu { position: static; }
  .admin-menu__panel,
  .admin-menu--end .admin-menu__panel { left: var(--s-4); right: var(--s-4); min-width: 0; }
}

/* ------------------------------------------------ Versioned policy body
   Justified, because that is how this business sets its documents — but only where the measure is wide
   enough to take it. Below 640px a justified paragraph in a ~40-character column opens rivers of white
   space between the words and is harder to read, not more formal, so the phone keeps a ragged right
   edge. hyphens:auto softens the rest; the page is lang="en-IN", so the browser has a dictionary to
   break words on. This cannot be set in the editor: HtmlSanitizer drops style and class from
   admin-authored HTML, which is the reason that content is safe to publish in the first place. */
.policy-body p, .policy-body li { text-align: justify; hyphens: auto; }
/* A closing sentence after a list ("Delivery charges are not refunded in any other circumstance.")
   otherwise sits flush against the last bullet and reads as part of it, which inverts its meaning. */
.policy-body ul + p, .policy-body ol + p { margin-top: var(--s-3); }
@media (max-width: 639px) {
  .policy-body p, .policy-body li { text-align: left; hyphens: none; }
}
