/* ===========================================================================
   Thrive & Tide — research product price list
   Palette sampled directly from the owner's redesigned PDF.
   =========================================================================== */

:root {
  /* --- brand palette, sampled from the PDF ------------------------------ */
  --bg:       #f7f4ec;   /* page cream                                      */
  --panel:    #fdf9f4;   /* lighter panel behind the logo                   */
  --ink:      #0c3e4b;   /* deep teal — top bar, headings, emphasis         */
  --text:     #173541;   /* body copy                    11.8:1 on cream    */
  --bronze:   #b79a76;   /* rules and borders ONLY — 2.4:1, never for text  */
  --divider:  #d9d4c9;   /* hairlines, column divider                       */

  /* The PDF's own muted greys sit just under WCAG AA on this cream
     (#65756f = 4.42:1, sage #788b72 = 3.33:1). These are the nearest
     compliant versions — same hue, a touch darker. */
  --muted:    #606f69;   /* vial size, fine print         4.8:1 on cream    */
  --sage:     #606f5b;   /* tagline, accents              4.9:1 on cream    */

  --sans: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, system-ui, sans-serif;
  --measure: 1180px;
}

* { box-sizing: border-box; }

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

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

.wrap { width: 100%; max-width: var(--measure); margin-inline: auto; padding-inline: 24px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 20;
  background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 6px;
  font-weight: 700; text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }

/* --- top rule + masthead -------------------------------------------------- */

.topbar { background: var(--ink); }

.topnav {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 0 clamp(16px, 4vw, 36px);
  margin: 0 auto; padding-block: 0; list-style: none;
}
.topnav a {
  display: flex; align-items: center; gap: 7px;
  min-height: 44px;                       /* comfortable touch target */
  color: var(--panel); text-decoration: none;
  font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
}
.topnav a:hover { border-bottom-color: var(--bronze); }
.topnav a[aria-current="page"] { border-bottom-color: var(--bronze); }   /* bronze: a rule, never text */
.topnav a:focus-visible { outline-color: var(--panel); outline-offset: -4px; }

/* Bronze fails contrast as a fill behind text, so the count is a cream pill. */
.nav-count {
  min-width: 1.5em; padding: 1px 6px;
  font-size: .6875rem; letter-spacing: 0; text-align: center;
  color: var(--ink); background: var(--panel); border-radius: 999px;
}
.nav-count[hidden] { display: none; }

@media (min-width: 560px) { .topnav a { font-size: .8125rem; } }

.site-header { padding: 34px 0 22px; text-align: center; }

.logo {
  display: block;
  width: min(330px, 74vw);
  height: auto;
  margin: 0 auto 22px;
}

.site-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: clamp(1.4rem, 1.05rem + 1.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.tagline {
  margin: 0;
  color: var(--sage);
  font-size: clamp(.8125rem, .74rem + .35vw, 1rem);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* --- sticky toolbar ------------------------------------------------------- */

.toolbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(247, 244, 236, .93);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--divider);
  padding: 14px 0;
}
.toolbar-inner { display: flex; flex-direction: column; gap: 12px; }

.search-field { position: relative; display: flex; align-items: center; }
.search-icon {
  position: absolute; left: 14px; width: 18px; height: 18px;
  color: var(--muted); pointer-events: none;
}
#search {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--divider);
  border-radius: 10px;
  appearance: none;
}
#search::placeholder { color: var(--muted); }
#search:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 1px var(--ink); }
#search::-webkit-search-cancel-button { opacity: .5; cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: .8125rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--divider);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: color .12s, border-color .12s, background-color .12s;
}
.chip:hover { color: var(--ink); border-color: var(--bronze); }
.chip[aria-pressed="true"] {
  background: var(--ink); border-color: var(--ink); color: var(--panel);
}

/* On a phone, nine wrapping chips would make the sticky bar eat half the
   screen. Keep them on one swipeable row instead. */
@media (max-width: 760px) {
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
    margin-inline: -24px;
    padding-inline: 24px;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; scroll-snap-align: start; }
}

/* --- price list ----------------------------------------------------------- */

.pricelist { padding: 34px 0 8px; }

@media (min-width: 900px) {
  .pricelist {
    columns: 2;
    column-gap: 64px;
    column-rule: 1px solid var(--divider);   /* the divider from the PDF */
  }
}

.category {
  break-inside: avoid;          /* keep a whole category in one column */
  page-break-inside: avoid;
  margin: 0 0 38px;
}

.category h2 {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: clamp(1.0625rem, .95rem + .45vw, 1.3rem);
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.category table { width: 100%; border-collapse: collapse; }

.category thead th {
  font-size: .6875rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  text-align: left; padding: 0 0 7px;
  border-bottom: 2px solid var(--bronze);   /* the bronze rule from the PDF */
}
.category thead th.col-size,
.category thead th.col-price { text-align: right; white-space: nowrap; }
.category thead th.col-size { width: 6.5em; }
.category thead th.col-price { width: 5em; }

.category tbody td {
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
  vertical-align: baseline;
}
.category tbody tr:last-child td { border-bottom: none; }

td.col-name { padding-right: 12px; }
.name { display: block; }
.note { display: block; font-size: .8125rem; color: var(--muted); margin-top: 2px; }

td.col-size,
td.col-price {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}
td.col-size { color: var(--muted); }
td.col-price { font-weight: 700; color: var(--ink); }

tr.is-soldout td.col-name,
tr.is-soldout td.col-size { color: var(--muted); }
tr.is-soldout td.col-price { color: var(--muted); font-weight: 600; }
.soldout-flag {
  display: inline-block; margin-left: 8px;
  font-size: .625rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--panel); background: var(--ink);   /* 10.6:1 */
  padding: 2px 7px; border-radius: 3px; vertical-align: 1px;
}

mark { background: #f0e2cc; color: var(--ink); border-radius: 2px; padding: 0 1px; }

.noresults { color: var(--muted); text-align: center; padding: 48px 0 64px; margin: 0; }

/* --- footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--divider);
  margin-top: 24px;
  padding-block: 26px 54px;
  text-align: center;
}
.fine { margin: 0 0 10px; font-size: .8125rem; color: var(--muted); }
.warn {
  margin: 0; color: var(--ink);
  font-size: .9375rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}

/* --- ?check diagnostic panel ---------------------------------------------- */

#check-panel {
  border: 1px solid var(--divider);
  border-left: 4px solid var(--bronze);
  border-radius: 12px;
  background: var(--panel);
  padding: 20px 22px;
  margin: 24px 0 8px;
  font-size: .9375rem;
}
#check-panel h2 { margin: 0 0 4px; color: var(--ink); font-size: 1.125rem; }
#check-panel .check-sub { margin: 0 0 16px; color: var(--muted); font-size: .8125rem; }
#check-panel dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; }
#check-panel dt { color: var(--muted); }
#check-panel dd { margin: 0; font-variant-numeric: tabular-nums; }
#check-panel .ok  { color: var(--ink); }
#check-panel .bad { color: var(--ink); font-weight: 700; }
#check-panel .issues,
#check-panel .allclear {
  margin: 18px 0 0; padding: 14px 16px; border-radius: 8px; background: var(--bg);
}
#check-panel .issues p { margin: 0 0 8px; font-weight: 700; color: var(--ink); }
#check-panel .issues ul { margin: 0; padding-left: 20px; color: var(--muted); }
#check-panel .issues li { margin-bottom: 4px; }
#check-panel .allclear { color: var(--muted); }

/* --- motion --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* --- print ---------------------------------------------------------------- */

@media print {
  body { background: #fff; font-size: 11pt; }
  .no-print, .toolbar, .skip-link, #check-panel, .topbar { display: none !important; }
  .site-header { padding: 0 0 10px; }
  .logo { width: 210px; margin-bottom: 14px; }
  .pricelist { columns: 2; column-gap: 36px; padding-top: 12px; }
  .category { margin-bottom: 20px; }
  .category tbody td { padding: 5px 0; }
  a { text-decoration: none; color: var(--ink); }
  @page { margin: 12mm; }
}

/* ===========================================================================
   Contact page
   =========================================================================== */

/* Same 34px of breathing room the price list gets from .pricelist. */
.page-main { padding-top: 34px; padding-bottom: 12px; }

.logo-link { display: block; text-decoration: none; }

.backlink { margin: 0 0 26px; font-size: .875rem; }
.backlink a,
.footer-nav a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--bronze); }
.backlink a:hover,
.footer-nav a:hover { border-bottom-color: var(--ink); }

.footer-nav { margin: 0 0 16px; font-size: .9375rem; font-weight: 600; }

.contact-grid { display: grid; grid-template-columns: 1fr; gap: 38px; align-items: start; }

@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 1.05fr .95fr; gap: 56px; }
  .contact-media { position: sticky; top: 32px; }
}

.contact-intro {
  margin: 0 0 14px;
  font-size: 1.0625rem;
  max-width: 46ch;
}
.contact-email { margin: 0 0 26px; font-size: .9375rem; color: var(--muted); }
.contact-email a { color: var(--ink); }

/* --- the image space ------------------------------------------------------- */

.contact-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--divider);
}

/* --- form ------------------------------------------------------------------ */

.contact-form { max-width: 34rem; }

.field { margin-bottom: 18px; }

.field-row { display: grid; grid-template-columns: 1fr; gap: 0 18px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }

.contact-form label {
  display: block;
  margin-bottom: 6px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
}

.req { color: var(--ink); font-weight: 700; }

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--divider);
  border-radius: 10px;
  appearance: none;
}
.contact-form textarea { resize: vertical; min-height: 9rem; line-height: 1.5; }

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--ink);
  outline: none;
  box-shadow: 0 0 0 1px var(--ink);
}

/* Invalid state is carried by colour AND an icon-free text message below,
   so it never depends on colour alone. */
.contact-form input.is-invalid,
.contact-form textarea.is-invalid { border-color: var(--ink); border-width: 2px; }

.field-error {
  margin: 6px 0 0;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--ink);
}
.field-error::before { content: "⚠ "; }

.form-note { margin: 0 0 18px; font-size: .8125rem; color: var(--muted); }

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .875rem;
  color: var(--panel);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 10px;
  padding: 14px 30px;
  cursor: pointer;
  transition: background-color .14s, color .14s;
}
.btn:hover { background: #0a323d; }
.btn:disabled { opacity: .6; cursor: progress; }

.form-status {
  margin: 18px 0 0;
  padding: 12px 15px;
  border-radius: 10px;
  font-size: .9375rem;
  border: 1px solid var(--divider);
  background: var(--panel);
}
.form-status.is-ok      { border-left: 4px solid var(--ink); color: var(--ink); font-weight: 600; }
.form-status.is-error   { border-left: 4px solid var(--bronze); color: var(--text); }
.form-status.is-pending { border-left: 4px solid var(--divider); color: var(--muted); }

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

@media print {
  .contact-form, .contact-media, .backlink, .footer-nav { display: none !important; }
}

/* ===========================================================================
   Quote builder
   =========================================================================== */

.quote-grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start; }

@media (min-width: 900px) {
  .quote-grid { grid-template-columns: 1fr 22rem; gap: 48px; }
  .quote-summary { position: sticky; top: 118px; max-height: calc(100vh - 140px); overflow-y: auto; }
}

.quote-picker .category { margin-bottom: 30px; }

.quote-picker thead th.col-qty { text-align: right; width: 8.5rem; }
.quote-picker td.col-qty { text-align: right; padding-left: 8px; vertical-align: middle; }
.quote-picker .col-size { width: 6.5em; }
.quote-picker .col-price { width: 4.5em; }

.size-inline { display: none; }
.unavailable { font-size: .8125rem; color: var(--muted); }

/* Phone: name on its own line, price and stepper beneath it. The header row
   stays in the page for screen readers but is no longer drawn. */
@media (max-width: 560px) {
  .quote-picker .col-size { display: none; }
  .size-inline { display: inline; }
  .quote-picker thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%);
  }
  .quote-picker tbody tr {
    display: grid; grid-template-columns: 1fr auto; align-items: center;
    padding: 12px 0; border-bottom: 1px solid var(--divider);
  }
  .quote-picker tbody tr:last-child { border-bottom: 0; }
  .quote-picker tbody td { padding: 0; border: 0; }
  .quote-picker td.col-name { grid-column: 1 / -1; padding: 0 0 8px; }
  .quote-picker td.col-price { text-align: left; font-size: 1.0625rem; }
  .quote-picker td.col-qty { padding-left: 0; }
}

/* --- stepper --------------------------------------------------------------- */

.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--divider); border-radius: 8px; background: var(--panel); }
.stepper:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

.step {
  width: 36px; min-height: 36px; padding: 0;
  font: inherit; font-size: 1.125rem; font-weight: 700; line-height: 1;
  color: var(--ink); background: transparent; border: 0; cursor: pointer;
}
.step:first-child { border-radius: 7px 0 0 7px; }
.step:last-child { border-radius: 0 7px 7px 0; }
.step:hover { background: var(--bg); }
.step:focus-visible { outline-offset: -3px; }

.qty {
  width: 2.75rem; padding: 0; text-align: center;
  font: inherit; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--ink); background: transparent;
  border: 0; border-inline: 1px solid var(--divider); border-radius: 0;
  appearance: none; -moz-appearance: textfield;
}
.qty:focus { outline: none; }

/* --- summary --------------------------------------------------------------- */

.quote-summary {
  background: var(--panel);
  border: 1px solid var(--divider);
  border-top: 3px solid var(--bronze);
  border-radius: 12px;
  padding: 20px 20px 18px;
}
.quote-summary h2 {
  margin: 0 0 14px; color: var(--ink);
  font-size: 1.0625rem; letter-spacing: .02em; text-transform: uppercase;
}
.quote-summary h2:focus { outline: none; }

.summary-empty { margin: 0; color: var(--muted); font-size: .9375rem; }

.summary-notice {
  margin: 0 0 14px; padding: 10px 12px;
  font-size: .8125rem; color: var(--text);
  background: var(--bg); border-left: 4px solid var(--bronze); border-radius: 6px;
}
.quote-picker > .summary-notice { margin-bottom: 20px; }

.line {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
  padding: 12px 0; border-bottom: 1px solid var(--divider);
}
.line:first-child { padding-top: 0; }
.line-info { display: flex; flex-direction: column; min-width: 0; }
.line-name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.line-meta { font-size: .8125rem; color: var(--muted); }
.line-total { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.line-controls { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.line-qty-print { display: none; }

.summary-totals { margin: 14px 0 0; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.total-row dt { font-weight: 700; color: var(--ink); }
.total-row dt .count { font-weight: 400; font-size: .8125rem; color: var(--muted); }
.total-row dd { margin: 0; font-size: 1.375rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.summary-fine { margin: 10px 0 0; font-size: .8125rem; color: var(--muted); }

.link-btn {
  font: inherit; font-size: .8125rem; color: var(--ink);
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--bronze); text-underline-offset: 3px;
}
.link-btn:hover { text-decoration-color: var(--ink); }
#clear-quote { margin-top: 14px; }

/* --- phone: running total bar ---------------------------------------------- */

.quote-bar {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--panel);
}
.quote-bar[hidden] { display: none; }
.quote-bar-link {
  color: var(--ink); background: var(--panel); text-decoration: none;
  font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 9px 16px; border-radius: 8px;
}
.quote-bar-link:focus-visible { outline-color: var(--panel); }
body.has-bar { padding-bottom: 64px; }

@media (min-width: 900px) {
  .quote-bar { display: none !important; }
  body.has-bar { padding-bottom: 0; }
}

@media print {
  .quote-bar, .quote-picker, .toolbar { display: none !important; }
  .quote-grid { display: block; }
  .quote-summary { position: static; max-height: none; border: 0; border-top: 2px solid var(--bronze); padding: 12px 0; }
  .line { grid-template-columns: 1fr auto auto; }
  .line-qty-print { display: block; color: var(--muted); }
}

/* ===========================================================================
   Quote request form, confirmation, and customer copy
   =========================================================================== */

.btn-block { display: block; width: 100%; margin-top: 16px; text-align: center; text-decoration: none; }
.btn-block[hidden] { display: none; }   /* display:block would otherwise defeat [hidden] */
.opt { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }

.quote-details,
.quote-sent {
  margin-top: 56px; padding-top: 36px;
  border-top: 1px solid var(--divider);
}
.quote-details h2,
.quote-sent h2 { margin: 0 0 10px; color: var(--ink); font-size: 1.3rem; text-transform: uppercase; letter-spacing: .02em; }
.quote-details .contact-form { max-width: 44rem; }
.quote-sent:focus { outline: none; }
.quote-sent p { max-width: 46ch; }
.sent-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 20px 0 10px; }

/* --- the customer copy: never drawn on screen, the only thing printed ------ */

.print-copy { display: none; }

@media print {
  body.has-copy > *:not(.print-copy) { display: none !important; }
  body.has-copy { background: #fff; padding-bottom: 0; }
  body.has-copy .print-copy { display: block; color: #000; font-size: 11pt; }

  .print-copy .logo { width: 150px; margin: 0 0 14px; }
  .print-copy h1 {
    margin: 0 0 12px; color: var(--ink);
    font-size: 20pt; text-transform: uppercase; letter-spacing: .02em;
  }
  .print-copy h2 {
    margin: 0 0 3px; color: var(--muted);
    font-size: 8.5pt; letter-spacing: .12em; text-transform: uppercase;
  }
  .print-copy p { margin: 0 0 14px; white-space: pre-line; }
  .pc-meta { display: flex; gap: 32px; margin: 0 0 18px; }
  .pc-meta dt { font-size: 8.5pt; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .pc-meta dd { margin: 0; font-weight: 700; }
  .pc-customer { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin-bottom: 8px; }
  .pc-customer h2 { grid-row: 1; }
  .pc-table { width: 100%; border-collapse: collapse; margin: 6px 0 18px; }
  .pc-table th, .pc-table td { padding: 7px 0; text-align: left; font-weight: 400; border-bottom: 1px solid var(--divider); }
  .pc-table thead th { border-bottom: 2px solid var(--bronze); font-size: 8.5pt; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .pc-table .num { text-align: right; white-space: nowrap; padding-left: 14px; font-variant-numeric: tabular-nums; }
  .pc-table tfoot th { text-align: right; font-weight: 700; border-bottom: 0; padding-top: 10px; }
  .pc-table tfoot td { font-weight: 700; font-size: 13pt; border-bottom: 0; padding-top: 8px; }
  .print-copy .pc-fine { font-size: 9pt; color: var(--muted); }
}

/* --- loading placeholder ---------------------------------------------------- */

.loading { margin: 0; padding: 40px 0; color: var(--muted); text-align: center; column-span: all; }
