/* ---------------------------------------------------------------------------
   Outsource China — storefront
   Dense catalogue browsing, but the primary action is always "Request Quote".
   Nothing here says cart, checkout or buy.
--------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 34px; font-weight: 800; letter-spacing: -.04em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p  { margin: 0 0 1em; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.hide { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Header ---------------------------------------------------------------- */

.masthead { background: var(--nav); color: var(--nav-text); position: sticky; top: 0; z-index: 60; }

.masthead a { color: var(--nav-text); text-decoration: none; }
.masthead a:hover { color: #fff; }

.masthead__main {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; max-width: var(--maxw); margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand) 0%, #d97a12 100%);
  color: #1c1305; font-weight: 900; font-size: 14px; flex: none;
}
.brand__text small {
  display: block; font-size: 10px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--nav-text-muted); margin-top: -2px;
}

/* Search — the widest thing in the header, as on any catalogue site */
/* The field and the button are one control, so only the outer corners are
   rounded. The selectors carry [type="search"] deliberately: the generic form
   styles further down this file have the same specificity, and being later
   would otherwise win and round all four corners of the input. */
.searchbar {
  flex: 1 1 auto; display: flex; position: relative;
  min-width: 0; max-width: 780px; border-radius: var(--radius);
}

.searchbar input[type="search"],
.searchbar button {
  height: 42px;
  border: none;
  font-size: 14px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.searchbar input[type="search"] {
  flex: 1 1 auto; min-width: 0; width: auto;
  padding: 0 14px;
  background: var(--surface); color: var(--text);
  border-radius: var(--radius) 0 0 var(--radius);
}

/* The ring belongs to the whole bar, not to the field inside it. */
.searchbar input[type="search"]:focus { outline: none; box-shadow: none; }
.searchbar input[type="search"]::placeholder { color: var(--text-subtle); }
.searchbar input[type="search"]::-webkit-search-cancel-button { margin-right: 2px; }

.searchbar button {
  flex: none;
  background: var(--brand); color: var(--brand-contrast);
  padding: 0 20px; border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer; font-weight: 700;
}
.searchbar button:hover { background: var(--brand-hover); }

.searchbar:focus-within { box-shadow: 0 0 0 2px var(--brand); }

.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 80;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
}
.suggest a {
  display: flex; gap: 12px; align-items: center; padding: 9px 12px;
  color: var(--text); border-bottom: 1px solid var(--border);
}
.suggest a:last-child { border-bottom: none; }
.suggest a:hover, .suggest a.is-active { background: var(--surface-hover); text-decoration: none; }
.suggest img {
  width: 40px; height: 40px; object-fit: contain; background: var(--photo-plate);
  border-radius: var(--radius-sm); flex: none;
}
.suggest__meta { font-size: 12px; color: var(--text-muted); }

/* Header actions */
.hdr-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.hdr-link {
  display: flex; flex-direction: column; justify-content: center;
  padding: 6px 10px; border-radius: var(--radius-sm); line-height: 1.2;
  border: 1px solid transparent; font-size: 13px;
}
.hdr-link:hover { border-color: var(--nav-border); background: var(--nav-2); }
.hdr-link small { font-size: 11px; color: var(--nav-text-muted); }
.hdr-link strong { font-weight: 700; }

/* Account menu. The <summary> is the .hdr-link, so it has to lose the native
   marker in both the modern and the WebKit-prefixed form. */
.hdr-menu { position: relative; }
.hdr-menu > summary { list-style: none; cursor: pointer; }
.hdr-menu > summary::-webkit-details-marker { display: none; }
.hdr-menu > summary::marker { content: ""; }
.hdr-menu[open] > summary { border-color: var(--nav-border); background: var(--nav-2); }
.hdr-menu__caret { font-size: 10px; opacity: .7; }
.hdr-menu[open] .hdr-menu__caret { opacity: 1; }
.hdr-menu__pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 90; min-width: 210px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; padding: 4px;
}
.hdr-menu__pop a,
.hdr-menu__pop button {
  display: block; width: 100%; text-align: left; font-size: 13px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text); background: none; border: none; font-family: inherit; cursor: pointer;
}
.hdr-menu__pop a:hover,
.hdr-menu__pop button:hover { background: var(--surface-hover); text-decoration: none; color: var(--text); }
.hdr-menu__pop form { margin: 4px 0 0; border-top: 1px solid var(--border); padding-top: 4px; }
.hdr-menu__pop button { font-weight: 600; color: var(--danger); }

/* Badge beside the label, not above it: .hdr-link is a column, so this has to
   set flex-direction back to row explicitly. */
.hdr-rfq { flex-direction: row; align-items: center; gap: 9px; }
.hdr-rfq__count {
  background: var(--brand); color: var(--brand-contrast); font-weight: 800;
  min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px;
  display: grid; place-items: center; font-size: 12px; flex: none;
}
/* The two lines are wrapped in a span, so they need their own column. */
.hdr-rfq__text { display: flex; flex-direction: column; line-height: 1.2; }

/* Category strip */
.subnav { background: var(--nav-2); border-top: 1px solid var(--nav-border); }
.subnav__inner {
  display: flex; gap: 2px; align-items: center; max-width: var(--maxw);
  margin: 0 auto; padding: 0 12px; overflow-x: auto; scrollbar-width: none;
}
.subnav__inner::-webkit-scrollbar { display: none; }
.subnav a {
  padding: 8px 11px; font-size: 13px; color: var(--nav-text-muted);
  white-space: nowrap; border-bottom: 2px solid transparent;
}
.subnav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.subnav a.is-active { color: #fff; border-bottom-color: var(--brand); }
.subnav a.subnav__assistant { color: var(--brand-on-dark); font-weight: 600; }
.subnav a.subnav__projects { color: var(--brand-on-dark); font-weight: 600; }

/* Projects reads as its own destination, in the same amber as the quote button. */
.hdr-projects {
  border-color: rgba(242, 160, 50, .45);
  background: rgba(242, 160, 50, .1);
}
.hdr-projects strong { color: var(--brand-on-dark); }
.hdr-projects:hover, .hdr-projects.is-active { border-color: var(--brand); background: rgba(242, 160, 50, .18); }

/* Theme switch */
.theme-switch { display: inline-flex; background: var(--nav-2); border: 1px solid var(--nav-border); border-radius: 999px; padding: 2px; }
.theme-switch button {
  border: none; background: none; color: var(--nav-text-muted); cursor: pointer;
  padding: 4px 8px; border-radius: 999px; font-size: 12px; line-height: 1; display: grid; place-items: center;
}
.theme-switch button:hover { color: #fff; }
.theme-switch button[aria-pressed="true"] { background: var(--brand); color: var(--brand-contrast); }

/* --- Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 9px 15px; border-radius: 999px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit; text-decoration: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-hover); text-decoration: none; color: var(--text); }
.btn--brand {
  background: var(--brand); border-color: var(--brand); color: var(--brand-contrast);
  box-shadow: var(--shadow-sm);
}
.btn--brand:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-contrast); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-hover); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--surface-hover); }
.btn--danger { color: var(--danger); border-color: var(--border); }
.btn--danger:hover { background: var(--danger-subtle); }
.btn--block { width: 100%; }
.btn--lg { padding: 12px 20px; font-size: 15px; }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }

/* --- Forms ----------------------------------------------------------------- */

label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[disabled], select[disabled] { background: var(--surface-sunken); color: var(--text-subtle); }

.field { margin-bottom: 14px; }
.field__error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.field__hint { color: var(--text-subtle); font-size: 12px; margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text); font-weight: 400; }
.check input { width: auto; margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* --- Cards, panels, badges ------------------------------------------------- */

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: 0 10px 28px rgba(16, 24, 32, .05);
}
.panel__head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.panel__head h2, .panel__head h3 { margin: 0; }
.panel__body { padding: 18px; }
.panel__foot { padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-sunken); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .01em;
  background: var(--surface-sunken); color: var(--text-muted); border: 1px solid var(--border);
}
.badge--live   { background: var(--success-subtle); color: var(--success); border-color: transparent; }
.badge--draft  { background: var(--surface-sunken); color: var(--text-muted); }
.badge--review { background: var(--warning-subtle); color: var(--warning); border-color: transparent; }
.badge--brand  { background: var(--brand-subtle);  color: var(--warning); border-color: transparent; }
.badge--info   { background: var(--info-subtle);   color: var(--info); border-color: transparent; }
.badge--warn   { background: var(--warning-subtle); color: var(--warning); border-color: transparent; }
.badge--danger { background: var(--danger-subtle); color: var(--danger); border-color: transparent; }
.badge--muted  { background: var(--surface-sunken); color: var(--text-subtle); }

.alert {
  padding: 11px 14px; border-radius: var(--radius); font-size: 13px;
  border: 1px solid transparent; margin-bottom: 14px;
}
.alert--success { background: var(--success-subtle); color: var(--success); }
.alert--error   { background: var(--danger-subtle);  color: var(--danger); }
.alert--info    { background: var(--info-subtle);    color: var(--info); }
.alert--warn    { background: var(--warning-subtle); color: var(--warning); }

.flashes { position: fixed; top: 78px; right: 20px; z-index: 200; max-width: 380px; }
.flashes .alert { box-shadow: var(--shadow-lg); }

/* --- Stat tiles ------------------------------------------------------------
   Used by the admin dashboard AND the buyer account dashboard, so they belong
   here rather than in admin.css, which the account pages never load. */

.stats {
  display: grid; gap: 12px; margin-bottom: 20px;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 16px 18px;
  display: block; color: var(--text);
  box-shadow: 0 8px 22px rgba(16, 24, 32, .04);
}
a.stat:hover {
  border-color: var(--border-strong); box-shadow: var(--shadow);
  text-decoration: none; color: var(--text);
}
.stat__label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); font-weight: 700;
}
.stat__value { font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; line-height: 1.1; }
.stat__note { font-size: 11.5px; color: var(--text-subtle); margin-top: 2px; }
.stat--alert .stat__value { color: var(--danger); }
.stat--good  .stat__value { color: var(--success); }
/* A tile that is an action rather than a number. */
.stat--action .stat__value {
  font-size: 15px; font-weight: 700; color: var(--accent); margin-top: 8px;
}
a.stat--action:hover .stat__value { color: var(--accent-hover); }

/* --- Breadcrumbs ----------------------------------------------------------- */

.crumbs { font-size: 12px; color: var(--text-muted); padding: 12px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--text-muted); }
.crumbs span::after { content: "›"; margin-left: 6px; color: var(--text-subtle); }

/* --- Product card ---------------------------------------------------------- */

.grid-products {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}

.pcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .14s, border-color .14s, transform .14s;
}
.pcard:hover { box-shadow: var(--shadow-lg); border-color: var(--border-strong); transform: translateY(-2px); }

/* Every tile is the same square, whatever shape the photo is: the box sets the
   size, and `contain` fits the product inside it without cropping or stretching.
   aspect-ratio needs the fallback below for older Safari/Firefox, where an
   unsupported ratio would collapse the row to uneven heights. */
.pcard__media {
  position: relative; display: block; background: var(--photo-plate);
  aspect-ratio: 1 / 1; overflow: hidden;
}
@supports not (aspect-ratio: 1 / 1) {
  .pcard__media { height: 0; padding-bottom: 100%; }
  .pcard__media img { position: absolute; inset: 0; }
}
.pcard__media img {
  width: 100%; height: 100%; object-fit: contain; padding: 12px;
}
.pcard__flags { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.pcard__save {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(255,255,255,.92); color: #55606b;
  display: grid; place-items: center; cursor: pointer; font-size: 14px;
}
.pcard__save:hover { color: var(--danger); }

.pcard__body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 7px; flex: 1 1 auto; }
.pcard__title {
  font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard__title:hover { color: var(--accent); text-decoration: underline; }
.pcard__meta { font-size: 11.5px; color: var(--moq); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.pcard__actions { margin-top: auto; padding-top: 4px; }

/* --- Category page layout -------------------------------------------------- */

.catalog { display: grid; grid-template-columns: 250px 1fr; gap: 22px; align-items: start; padding-bottom: 40px; }
.facets { position: sticky; top: 96px; }
.facet { border-bottom: 1px solid var(--border); padding: 13px 0; }
.facet:last-child { border-bottom: none; }
.facet h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 8px; }
.facet label { font-weight: 400; color: var(--text); font-size: 13px; margin-bottom: 5px; }
.facet__count { color: var(--text-subtle); font-size: 11px; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 14px; flex-wrap: wrap;
}
.toolbar select { width: auto; padding: 6px 10px; font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: var(--accent-subtle); color: var(--accent); border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.chip a { color: inherit; font-weight: 800; }

/* --- Product detail -------------------------------------------------------- */

.pdp { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr) 310px; gap: 26px; align-items: start; padding-bottom: 40px; }

/* The detail page is free to show any shape — the frame flexes between a
   minimum and maximum height and the photo sits inside it uncropped. */
.gallery__main {
  background: var(--photo-plate); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  display: grid; place-items: center;
  min-height: 320px; max-height: 620px;
}
.gallery__main img {
  width: 100%; height: auto; max-height: 620px;
  object-fit: contain; padding: 18px;
}
.gallery__thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery__thumbs button {
  width: 62px; height: 62px; padding: 4px; background: var(--photo-plate);
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.gallery__thumbs button.is-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: contain; }

.pdp__title { font-size: 23px; line-height: 1.3; margin-bottom: 8px; }
.pdp__flags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

/* Qty-break pricing is the headline number for a wholesale buyer */

.specs { width: 100%; border-collapse: collapse; }
.specs th, .specs td { padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: top; }
.specs th { text-align: left; width: 40%; color: var(--text-muted); font-weight: 600; background: var(--surface-sunken); }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: none; }

/* The quote box — where "Add to cart" would be on a shop */
.quotebox { position: sticky; top: 96px; }
.quotebox__headline { font-size: 17px; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }
.quotebox__note { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.quotebox dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; }
.quotebox dt { color: var(--text-muted); }
.quotebox dd { margin: 0; font-weight: 600; text-align: right; }

.trust { display: grid; gap: 10px; }
.trust__item { display: flex; gap: 10px; font-size: 12.5px; color: var(--text-muted); }
.trust__item span:first-child { color: var(--success); font-weight: 800; flex: none; }

/* --- Home ------------------------------------------------------------------ */

.hero {
  background: linear-gradient(150deg, var(--nav) 0%, var(--nav-2) 55%, #24405f 100%);
  color: var(--nav-text); border-radius: var(--radius-lg); padding: 40px;
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 32px; align-items: center;
  margin: 18px 0 22px; overflow: hidden;
}
.hero h1 { font-size: 33px; line-height: 1.18; margin-bottom: 12px; letter-spacing: -.025em; }
.hero p { color: var(--nav-text-muted); font-size: 15px; max-width: 52ch; }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero__card {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-lg); padding: 20px; backdrop-filter: blur(6px);
}
.hero__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hero__steps li { display: flex; gap: 12px; font-size: 13.5px; color: var(--nav-text); }
.hero__steps b {
  flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand);
  color: var(--brand-contrast); display: grid; place-items: center; font-size: 12px;
}
.hero__steps small { display: block; color: var(--nav-text-muted); font-size: 12px; }

/* Flex rather than grid so the last row fills instead of leaving a hole where
   the item count does not divide by the column count. */
.cat-tiles { display: flex; flex-wrap: wrap; gap: 14px; }
.cat-tile {
  flex: 1 1 180px; max-width: 260px;
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; text-align: center; color: var(--text); transition: box-shadow .14s, transform .14s;
}
.cat-tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; color: var(--text); }
.cat-tile strong { display: block; font-size: 14px; }
.cat-tile small { color: var(--text-subtle); font-size: 11.5px; margin-top: auto; padding-top: 4px; }

/* The category mark. Every branch is the same size, so a row of photos, icons
   and monograms still lines up. */
.cat-mark {
  width: 44px; height: 44px; margin-bottom: 10px; flex: none;
  display: grid; place-items: center; border-radius: 12px; overflow: hidden;
}
.cat-mark--photo { background: var(--photo-plate); }
.cat-mark--photo img { width: 100%; height: 100%; object-fit: cover; }
.cat-mark--icon {
  font-size: 24px; line-height: 1; background: var(--surface-sunken);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font);
}
.cat-mark--text {
  font-size: 15px; font-weight: 800; letter-spacing: .02em;
  color: hsl(var(--mark-hue) 62% 34%);
  background: hsl(var(--mark-hue) 68% 94%);
  box-shadow: inset 0 0 0 1px hsl(var(--mark-hue) 55% 86%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cat-mark--text {
    color: hsl(var(--mark-hue) 70% 76%);
    background: hsl(var(--mark-hue) 40% 20%);
    box-shadow: inset 0 0 0 1px hsl(var(--mark-hue) 35% 30%);
  }
}
:root[data-theme="dark"] .cat-mark--text {
  color: hsl(var(--mark-hue) 70% 76%);
  background: hsl(var(--mark-hue) 40% 20%);
  box-shadow: inset 0 0 0 1px hsl(var(--mark-hue) 35% 30%);
}

.section { margin: 30px 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section__head h2 { margin: 0; }

/* --- Spotlight ------------------------------------------------------------
   The best-sellers band. It breaks out of .wrap to full bleed and carries the
   navigation's dark ground, so it reads as a different kind of thing from the
   grids above and below it rather than as one more row of cards.

   Two zones: one hero product on the left, then a snapping rail of ranked
   cards. The rank badges are what a price would be doing on a shop — they let
   a buyer see what moves without us quoting a figure.
--------------------------------------------------------------------------- */

/* Full bleed by being outside .wrap, not by out-denting with vw — see the
   note in catalog/home.php. The inner div does the centring instead. */
.spotlight {
  background: linear-gradient(135deg, var(--nav) 0%, var(--nav-2) 62%, #223c58 100%);
  color: var(--nav-text);
  margin: 34px 0; padding: 34px 20px;
  position: relative; overflow: hidden;
}
/* A soft brand glow behind the hero product, kept off assistive tech. */
.spotlight::before {
  content: ""; position: absolute; top: -160px; left: -80px; width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(242,160,50,.22) 0%, transparent 68%);
  pointer-events: none;
}
.spotlight__inner { position: relative; max-width: var(--maxw); margin: 0 auto; }

.spotlight__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 20px;
}
.spotlight__head h2 { font-size: 27px; letter-spacing: -.025em; margin: 0 0 6px; }
.spotlight__head p { color: var(--nav-text-muted); margin: 0; font-size: 14px; max-width: 62ch; }
.spotlight__eyebrow {
  display: inline-block; margin-bottom: 9px; font-size: 11px; font-weight: 800;
  letter-spacing: .13em; text-transform: uppercase; color: var(--brand-on-dark);
}

.spotlight__nav { display: flex; gap: 8px; flex: none; }
.spotlight__arrow {
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 19px; line-height: 1;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  color: var(--nav-text); display: grid; place-items: center;
  transition: background .14s, border-color .14s;
}
.spotlight__arrow:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.32); }

/* The ranked rail */
/* One rail, edge to edge. align-items: start keeps a short card from stretching
   to its tallest neighbour and opening a hole above "Request a quote". */
.spotlight__rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 232px;
  align-items: start;
  gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 6px; scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.28) transparent;
}
.spotlight__rail::-webkit-scrollbar { height: 6px; }
.spotlight__rail::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); border-radius: 3px; }

.scard {
  scroll-snap-align: start;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .14s, border-color .14s, background .14s;
}
.scard:hover {
  transform: translateY(-3px); background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.3);
}
.scard__media {
  position: relative; display: block; background: var(--photo-plate);
  aspect-ratio: 1 / 1; overflow: hidden;
}
@supports not (aspect-ratio: 1 / 1) {
  .scard__media { height: 0; padding-bottom: 100%; }
  .scard__media img { position: absolute; inset: 0; }
}
/* cover, not contain: these are mixed lifestyle and cutout photos, and letting
   each keep its own shape on a white plate turned the row into dark rectangles
   floating in white bands of different sizes. */
.scard__media img { width: 100%; height: 100%; object-fit: cover; }
.scard__body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 7px; flex: 1 1 auto; }
.scard__title {
  font-size: 13px; font-weight: 600; color: var(--nav-text); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  /* Reserve both lines so a one-line title does not raise its card's MOQ and
     button above its neighbours'. */
  min-height: calc(1.35em * 2);
}
.scard__title:hover { color: #fff; text-decoration: underline; }
.scard__meta { font-size: 11.5px; color: var(--nav-text-muted); }
.scard__body form { margin-top: auto; }

.srank {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  background: var(--brand); color: var(--brand-contrast);
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  border-radius: 999px; padding: 3px 9px;
}

/* --- Rotating rails ---------------------------------------------------------
   A rail is a native horizontal scroller that app.js advances on a timer
   (data-rail-auto). The spotlight is the dark one; .prail is the same idea with
   the ordinary product cards, used across the site. The progress line under a
   rail tracks its scroll position, so a buyer can see there is more and how far
   through they are. */

.prail { position: relative; }
.prail__head { align-items: flex-end; }
.prail__nav { display: flex; align-items: center; gap: 8px; flex: none; }
.prail__more { font-size: 13px; margin-right: 6px; white-space: nowrap; }
.prail__arrow {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  font: inherit; font-size: 19px; line-height: 1; display: grid; place-items: center;
  transition: background .12s, border-color .12s, transform .12s;
}
.prail__arrow:hover { background: var(--surface-hover); border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* Same cards as the grids, one line. Overrides .grid-products' auto-fill. */
.grid-products.prail__track {
  grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 256px;
  overflow-x: auto; scroll-snap-type: x proximity;
  padding: 6px 2px 12px; margin: -6px -2px 0;
  scrollbar-width: none;
}
.grid-products.prail__track::-webkit-scrollbar { display: none; }
.grid-products.prail__track > .pcard { scroll-snap-align: start; }

/* Soft fade at the right edge: there is more this way. */
.prail::after {
  content: ""; position: absolute; right: 0; top: 46px; bottom: 14px; width: 56px;
  background: linear-gradient(90deg, transparent, var(--bg));
  pointer-events: none;
}

.rail-progress { height: 3px; border-radius: 999px; background: var(--border); overflow: hidden; margin-top: 4px; }
.rail-progress i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--brand));
  transform-origin: left; transform: scaleX(var(--p, .15));
  transition: transform .45s cubic-bezier(.2, .7, .3, 1);
}
.rail-progress--dark { background: rgba(255,255,255,.14); margin-top: 12px; }
.spotlight__rail { scrollbar-width: none; }
.spotlight__rail::-webkit-scrollbar { display: none; }

@media (max-width: 760px) {
  .grid-products.prail__track { grid-auto-columns: 180px; }
  .prail__arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rail-progress i { transition: none; }
}

.btn--ghost-light {
  background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: var(--nav-text);
}
.btn--ghost-light:hover { background: rgba(255,255,255,.2); color: #fff; }

@media (max-width: 900px) {
  .spotlight { padding-top: 26px; padding-bottom: 26px; }
  .spotlight__head h2 { font-size: 22px; }
  .spotlight__nav { display: none; }
  .spotlight__rail { grid-auto-columns: 165px; }
}

/* --- Assistant ------------------------------------------------------------- */

.assistant {
  display: grid; gap: 18px; align-items: start; padding: 16px 0 30px;
  grid-template-columns: 250px minmax(0, 1fr) 330px;
}

/* History rail */
.chat-side {
  position: sticky; top: 96px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-side__panel { display: flex; flex-direction: column; min-height: 0; }
.chat-side__steps {
  margin: 6px 0 0; padding-left: 18px; font-size: 12.5px;
  color: var(--text-muted); display: grid; gap: 5px;
}

.chat-history { overflow-y: auto; max-height: 46vh; padding: 6px; }
.chat-history a {
  display: block; padding: 8px 10px; margin-bottom: 2px;
  border-radius: var(--radius-sm); color: var(--text);
  border: 1px solid transparent;
}
.chat-history a:hover { background: var(--surface-hover); text-decoration: none; color: var(--text); }
.chat-history a.is-active { background: var(--accent-subtle); border-color: var(--accent); }
.chat-history__title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: 13px; font-weight: 600; line-height: 1.35;
}
.chat-history__meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-top: 3px; font-size: 11px; color: var(--text-subtle);
}
.chat { display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 480px; }
.chat__log { flex: 1 1 auto; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.chat__form { border-top: 1px solid var(--border); padding: 12px; display: flex; gap: 8px; align-items: flex-end; }
.chat__form textarea { min-height: 44px; max-height: 160px; }

.msg { display: flex; gap: 10px; max-width: 84%; }
.msg--user { margin-left: auto; flex-direction: row-reverse; }
.msg__avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; background: var(--accent-subtle); color: var(--accent);
}
.msg--user .msg__avatar { background: var(--brand-subtle); color: var(--warning); }
.msg__bubble {
  background: var(--surface-sunken); border: 1px solid var(--border);
  padding: 10px 13px; border-radius: var(--radius-lg); font-size: 13.5px; line-height: 1.55;
}
.msg--user .msg__bubble { background: var(--accent-subtle); border-color: transparent; }
.msg__bubble p:last-child { margin-bottom: 0; }
.msg__bubble ul, .msg__bubble ol { margin: 0 0 8px; padding-left: 20px; }
.msg__bubble ul:last-child, .msg__bubble ol:last-child { margin-bottom: 0; }
.msg__bubble li { margin-bottom: 3px; }
.msg__bubble strong { font-weight: 650; }

/* A message carrying cards needs the full width — the prose does not. */
.msg:has(.cards), .msg:has(.draft) { max-width: 100%; }

.chat__form { transition: opacity .15s ease; }
.chat__form.is-busy { opacity: .6; }
.chat__hint {
  padding: 0 12px 10px; margin: 0; font-size: 11.5px; color: var(--text-subtle);
}

.chat__head { align-items: center; }
.chat__presence {
  display: flex; align-items: center; gap: 8px; margin-top: 3px;
  font-size: 12px; color: var(--text-muted);
}
.chat__presence i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--text-subtle); display: block; flex: none;
}
.chat__presence i.is-live {
  background: #1f9d55; box-shadow: 0 0 0 4px rgba(31, 157, 85, .16);
  animation: livepulse 1.8s ease-in-out infinite;
}
@keyframes livepulse {
  50% { box-shadow: 0 0 0 7px rgba(31, 157, 85, 0); }
}

.chat__form { flex-direction: column; align-items: stretch; }
.chat__compose { display: flex; gap: 8px; align-items: flex-end; }
.chat__compose textarea { flex: 1 1 auto; min-width: 0; }
.chat__pending { display: flex; flex-wrap: wrap; gap: 6px; }
.chat__pending[hidden] { display: none; }
.chat-chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.chat-chip::after { content: " ×"; color: var(--text-subtle); font-weight: 500; }
.chat-clip {
  width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--border);
  display: grid; place-items: center; cursor: pointer; color: var(--text-muted);
  background: var(--surface); flex: none;
}
.chat-clip:hover { color: var(--nav); border-color: var(--brand); }

.msg--staff .msg__avatar { background: var(--nav); color: var(--brand-on-dark); }
.msg--staff .msg__bubble { border-color: rgba(242, 160, 50, .45); }
.msg--in .msg__bubble { background: var(--surface); }
.msg--out { margin-left: auto; flex-direction: row-reverse; }
.msg--out .msg__avatar { background: var(--brand); color: var(--brand-contrast); }
.msg--out .msg__bubble { background: var(--nav); color: #f4f6f8; border-color: transparent; }
.msg--out .msg__who, .msg--out .msg__meta, .msg--out .msg__meta time { color: rgba(244, 246, 248, .7); }
.msg--notice { max-width: 92%; margin-left: auto; margin-right: auto; }
.msg--notice .msg__bubble {
  background: transparent; border: 0; text-align: center; color: var(--text-muted);
  font-size: 12.5px; padding: 4px 8px; box-shadow: none;
}
.msg__who { font-size: 11px; font-weight: 750; margin-bottom: 3px; color: var(--text-muted); }
.msg__meta {
  display: flex; gap: 8px; align-items: center; justify-content: flex-end;
  margin-top: 6px; font-size: 11px; color: var(--text-subtle);
}
.ticks__read { display: none; }
.msg.is-read .ticks__sent { display: none; }
.msg.is-read .ticks__read { display: inline; color: #0a6e80; font-weight: 750; }
.msg--out.is-read .ticks__read { color: var(--brand-on-dark); }

.msg-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.msg-file--image img {
  display: block; max-width: 240px; max-height: 180px; border-radius: 12px; object-fit: cover;
}
.msg-file--video video, .msg-file audio { display: block; max-width: 260px; border-radius: 12px; }
.msg-file--video a, .msg-file span { display: block; margin-top: 4px; font-size: 12px; }
.msg-file--doc {
  display: flex; gap: 8px; align-items: center; min-width: 180px;
  padding: 8px 10px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.msg-file--doc:hover { border-color: var(--brand); text-decoration: none; color: var(--text); }
.msg-file--doc strong { display: block; font-size: 12.5px; }
.msg-file--doc small { color: var(--text-subtle); }
.msg-file__kind {
  font-size: 10px; font-weight: 800; letter-spacing: .04em;
  background: var(--nav); color: var(--brand-on-dark); border-radius: 8px; padding: 7px 6px;
}
#chat-typing[hidden] { display: none !important; }
.typing-label { margin-left: 8px; font-size: 12px; color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  .chat__presence i.is-live { animation: none; }
}

.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-subtle); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* Cards the assistant puts in the thread — products, the buyer's own
   inquiries, and a drafted inquiry waiting on their confirmation. */
.cards { display: grid; gap: 8px; margin-top: 11px; }
.cards--product { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); }
.cards--inquiry { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }

.pcard {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: 16px; padding: 8px;
  background: var(--surface); color: var(--text); font-size: 12px; line-height: 1.45;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.pcard:hover {
  border-color: var(--brand); text-decoration: none; color: var(--text);
  box-shadow: var(--shadow-sm); transform: translateY(-1px);
}
.pcard__shot { flex: none; width: 62px; }
.pcard__shot img {
  width: 62px; height: 62px; object-fit: contain;
  background: var(--photo-plate); border-radius: var(--radius-sm);
}
.pcard__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pcard__cat { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); }
.pcard__title { font-size: 12.5px; font-weight: 600; }
.pcard__meta { color: var(--text-muted); }
.chip {
  display: inline-block; align-self: flex-start; margin-top: 3px;
  font-size: 10.5px; padding: 1px 6px; border-radius: 999px;
  background: var(--accent-subtle); color: var(--accent);
}

.qcard {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 11px;
  background: var(--surface); color: var(--text); font-size: 12px;
}
.qcard:hover { border-color: var(--accent); text-decoration: none; color: var(--text); box-shadow: var(--shadow-sm); }
.qcard__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qcard__top strong { font-family: var(--mono); font-size: 12px; }
.qcard__meta { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.qcard__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

/* The drafted inquiry. The model builds it; only this button writes it. */
.draft {
  margin-top: 12px; border: 1px solid var(--brand); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden;
}
.draft__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 13px; background: var(--brand-subtle); border-bottom: 1px solid var(--border);
}
.draft__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warning); }
.draft__product {
  display: flex; gap: 10px; align-items: center; padding: 11px 13px;
  border-bottom: 1px solid var(--border); color: var(--text);
}
.draft__product:hover { background: var(--surface-hover); text-decoration: none; color: var(--text); }
.draft__product img {
  width: 46px; height: 46px; flex: none; object-fit: contain;
  background: var(--photo-plate); border-radius: var(--radius-sm);
}
.draft__product span { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.draft__rows { margin: 0; padding: 10px 13px; display: flex; flex-direction: column; gap: 5px; }
.draft__rows > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.draft__rows dt { color: var(--text-muted); flex: none; }
.draft__rows dd { margin: 0; text-align: right; font-weight: 600; word-break: break-word; }
.draft__warn, .draft__note {
  margin: 0; padding: 8px 13px; font-size: 12px;
  border-top: 1px solid var(--border); color: var(--text-muted);
}
.draft__warn { background: var(--warning-subtle); color: var(--warning); }
/* One line of a multi-item draft. */
.draft__line { border-bottom: 1px solid var(--border); padding: 10px 13px 4px; }
.draft__lineHead { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.draft__lineHead strong { font-size: 13px; }
.draft__qty { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.draft__line .draft__product { border-bottom: none; padding: 8px 0 4px; }
.draft__line .draft__rows { padding: 6px 0 4px; }
.draft__rows .is-open dd { color: var(--text-subtle); font-style: italic; font-weight: 400; }
.draft__rows--shared { border-top: 1px solid var(--border); background: var(--surface-sunken); }

.draft__actions { display: flex; gap: 8px; padding: 11px 13px 0; }
.draft__actions .btn { flex: 1 1 auto; }
.draft__fine { margin: 0; padding: 8px 13px 12px; font-size: 11.5px; color: var(--text-subtle); }
.draft--done { border-color: var(--success); padding-bottom: 12px; }
.draft--done .draft__head { background: var(--success-subtle); }
.draft--done .draft__label { color: var(--success); }
.draft--done p { margin: 11px 13px; font-size: 12.5px; }
.draft--done .btn { margin: 0 13px; width: calc(100% - 26px); }

/* Brief panel — the assistant's actual output */
.brief { position: sticky; top: 96px; }
.brief__meter { height: 7px; background: var(--surface-sunken); border-radius: 999px; overflow: hidden; }
.brief__meter i { display: block; height: 100%; background: var(--brand); transition: width .35s ease; }
.brief__group { border-top: 1px solid var(--border); padding: 11px 0 4px; }
.brief__group:first-child { border-top: none; }
.brief__group h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); margin-bottom: 7px; }
.brief__row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 3px 0; }
.brief__row dt { color: var(--text-muted); flex: none; }
.brief__row dd { margin: 0; text-align: right; font-weight: 600; word-break: break-word; }
.brief__row.is-empty dd { color: var(--text-subtle); font-weight: 400; font-style: italic; }

/* A line item in the brief panel, with the specs settled so far. */
.bitem {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 10px; margin-bottom: 7px; background: var(--surface-sunken);
}
.bitem:last-child { margin-bottom: 0; }
.bitem__head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.bitem__head strong { font-size: 12.5px; }
.bitem__qty { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.bitem__qty.is-missing { color: var(--warning); font-style: italic; }
.bitem__specs { margin: 6px 0 0; display: flex; flex-direction: column; gap: 2px; }
.bitem__specs > div { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.bitem__specs dt { color: var(--text-muted); flex: none; }
.bitem__specs dd { margin: 0; text-align: right; font-weight: 600; word-break: break-word; }
.bitem__specs .is-open dd { color: var(--text-subtle); font-weight: 400; font-style: italic; }
.bitem__todo { margin: 6px 0 0; font-size: 11.5px; color: var(--text-subtle); }

/* --- Inquiry thread -------------------------------------------------------- */

.thread { display: flex; flex-direction: column; gap: 14px; }
.tmsg { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 13px 15px; background: var(--surface); }
.tmsg--staff { border-left: 3px solid var(--accent); }
.tmsg--buyer { border-left: 3px solid var(--brand); background: var(--surface-sunken); }
.tmsg--internal { border-left: 3px solid var(--warning); background: var(--warning-subtle); }
.tmsg__head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.tmsg__body { font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; }

/* --- Tables ---------------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 700; background: var(--surface-sunken); }
.table tbody tr:hover { background: var(--surface-hover); }
.table--fixed { table-layout: fixed; }
.table-wrap { overflow-x: auto; }

/* --- Pagination ------------------------------------------------------------ */

.pager { display: flex; gap: 6px; justify-content: center; padding: 22px 0; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 13px;
}
.pager .is-current { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); font-weight: 700; }

/* --- Empty state ----------------------------------------------------------- */

.empty { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty__icon { font-size: 34px; margin-bottom: 10px; opacity: .5; }

/* --- Footer ---------------------------------------------------------------- */

#main { padding-bottom: 48px; }
#main:has(.home) { padding-bottom: 0; }
.footer { background: var(--nav); color: var(--nav-text-muted); margin-top: 0; padding: 34px 0 22px; font-size: 13px; }
.footer a { color: var(--nav-text-muted); }
.footer a:hover { color: #fff; }
.footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 26px; }
.footer h4 { color: var(--nav-text); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.footer__bar { border-top: 1px solid var(--nav-border); margin-top: 24px; padding-top: 16px; font-size: 12px; }

/* --- Auth ------------------------------------------------------------------ */

.auth-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; position: relative; overflow: hidden;
  background:
    radial-gradient(720px 420px at 82% 8%, rgba(242, 160, 50, .32), transparent 60%),
    radial-gradient(520px 360px at 8% 92%, rgba(10, 110, 128, .28), transparent 58%),
    #0c1420;
}
.auth-shell::before {
  content: ""; position: absolute; inset: -20%;
  background: conic-gradient(from 80deg, transparent, rgba(242, 160, 50, .16), transparent 40%, rgba(26, 143, 163, .12), transparent 72%);
  animation: spin 32s linear infinite; pointer-events: none;
}
.auth-card { position: relative; width: 100%; max-width: 440px; }
.auth-card .brand { color: #f4f6f8; justify-content: center; margin-bottom: 18px; }
.auth-card .brand__text small { color: #a9b6c6; }
.auth-card .subtle, .auth-card .subtle a { color: #c5ced8; }
@keyframes spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  .auth-shell::before { animation: none; }
}

/* --- Responsive ------------------------------------------------------------ */

@media (max-width: 1100px) {
  .pdp { grid-template-columns: minmax(0, 1fr) 300px; }
  .pdp__gallery { grid-column: 1 / -1; max-width: 460px; }
  .hero { grid-template-columns: 1fr; padding: 28px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

/* Not enough room for three columns: the rail becomes a strip of recent
   briefs above the conversation rather than disappearing. */
@media (max-width: 1240px) {
  .assistant { grid-template-columns: minmax(0, 1fr) 320px; }
  .chat-side {
    grid-column: 1 / -1; position: static;
    flex-direction: row; align-items: stretch; flex-wrap: wrap; gap: 10px;
  }
  .chat-side > form { flex: none; }
  .chat-side__panel { flex: 1 1 320px; }
  .chat-side > .panel:not(.chat-side__panel) { display: none; }
  .chat-history { display: flex; gap: 6px; max-height: none; overflow-x: auto; }
  .chat-history a { flex: none; width: 190px; margin-bottom: 0; }
}

@media (max-width: 900px) {
  .catalog { grid-template-columns: 1fr; }
  .facets { position: static; }
  .assistant { grid-template-columns: 1fr; }
  .brief { position: static; }
  .chat { height: auto; min-height: 420px; }
}

@media (max-width: 760px) {
  .masthead__main { flex-wrap: wrap; padding: 8px 14px; gap: 10px; }
  .searchbar { order: 3; flex-basis: 100%; max-width: none; }
  .pdp { grid-template-columns: 1fr; }
  .quotebox { position: static; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 25px; }
  .hdr-link small { display: none; }
  .flashes { left: 14px; right: 14px; max-width: none; top: 70px; }
}

@media print {
  .masthead, .subnav, .footer, .quotebox, .flashes { display: none; }
}

/* --- Wishlist ----------------------------------------------------------------
   The heart on a card, the button on a product page, the count in the header. */

.wish { margin: 0; }
.wish--icon { position: absolute; top: 8px; right: 8px; z-index: 4; }
.wish__btn {
  display: inline-grid; place-items: center; cursor: pointer;
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .94); border: 1px solid var(--border);
  color: #6a7683; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, color .15s ease, border-color .15s ease, background .15s ease;
}
.wish__btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; transition: fill .15s ease; }
.wish__btn:hover { color: var(--danger); border-color: var(--danger); transform: scale(1.08); }
.wish__btn.is-saved { color: #e0245e; border-color: #e0245e; background: #fff; }
.wish__btn.is-saved svg { fill: currentColor; }
.wish__btn.is-pop { animation: wish-pop .45s cubic-bezier(.3, 1.7, .5, 1); }
.wish__btn[disabled] { opacity: .7; }

.wish--button .wish__btn {
  width: 100%; height: auto; border-radius: var(--radius); padding: 10px 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text);
  background: var(--surface); box-shadow: none;
}
.wish--button .wish__btn:hover { transform: none; color: #e0245e; }
.wish--button .wish__btn.is-saved { color: #e0245e; background: var(--danger-subtle); }

/* The card and the dark spotlight card both position the heart. */
.pcard, .scard { position: relative; }
/* The MATCH badge used to own the top-right corner; it sits under the heart now. */
.pcard__match { top: 48px !important; }

.hdr-wish { flex-direction: row; align-items: center; gap: 9px; }
.hdr-wish__icon { position: relative; display: grid; place-items: center; width: 24px; height: 24px; flex: none; }
.hdr-wish__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.hdr-wish:hover .hdr-wish__icon svg, .hdr-wish.is-active .hdr-wish__icon svg { fill: #e0245e; stroke: #e0245e; }
.hdr-wish__count {
  position: absolute; top: -7px; right: -9px;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: #e0245e; color: #fff; font-size: 10.5px; font-weight: 800;
  display: grid; place-items: center; line-height: 1;
}
.hdr-wish__count.is-bump { animation: wish-pop .4s cubic-bezier(.3, 1.7, .5, 1); }

.wishhead {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px 0 16px;
}
.wishhead__eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: #e0245e; }
.wishhead h1 { margin: 4px 0 6px; }
.wishhead p { margin: 0; max-width: 62ch; }
.wishhead__actions { display: flex; gap: 8px; align-items: center; }

.pcard.is-leaving { opacity: 0; transform: scale(.94); transition: opacity .3s ease, transform .3s ease; }

@keyframes wish-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

@media (max-width: 760px) { .hdr-wish .hdr-rfq__text { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .wish__btn.is-pop, .hdr-wish__count.is-bump { animation: none; }
  .wish__btn, .pcard.is-leaving { transition: none; }
}
