* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cs-white);
  color: var(--cs-black);
  font-family: var(--cs-font-body);
  line-height: var(--cs-line-height);
}

h1, h2, h3, h4 {
  font-family: var(--cs-font-body);
  font-weight: normal;
  margin: 0 0 0.75rem;
}

h1 { font-size: var(--cs-h1-size); line-height: 1.1; }
h2 { font-size: var(--cs-h2-size); line-height: 1.15; }
h3 { font-size: var(--cs-h3-size); line-height: 1.2; }

.eyebrow {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--cs-grey-300);
  margin-bottom: 0.5rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--cs-grey-text);
  text-decoration: none;
}

.back-link:hover { color: var(--cs-black); }

.detail-hero-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
  margin-bottom: 2rem;
}

.detail-layout {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.detail-specs { flex: 1 1 320px; min-width: 0; }

.detail-media {
  flex: 1 1 240px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.media-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border: 1px solid var(--cs-grey-100);
}

.media-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--cs-grey-200);
  color: var(--cs-grey-300);
  font-size: 0.85rem;
  text-align: center;
}

.media-video-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background-color: var(--cs-cotton-light);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--cs-grey-100);
  color: var(--cs-dark-green);
  text-decoration: none;
  font-size: 0.9rem;
}

.media-video-card:hover { background-color: var(--cs-cotton); }

.play-button-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--cs-black);
  font-size: 1.15rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.media-video-card:hover .play-button-overlay { background: var(--cs-white); }

.media-video-caption {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.4rem 0.6rem;
  background: rgba(0, 0, 0, 0.55);
  color: var(--cs-white);
  font-size: 0.78rem;
  text-align: center;
  border-radius: 2px;
}

/* Below this width, .detail-layout has already wrapped .detail-media onto
   its own full-width row (see .detail-layout's flex-wrap), so there's
   enough horizontal space to lay the handfeel image and video thumb side
   by side instead of stacked — better use of the width than two tall
   stacked squares. */
@media (max-width: 640px) {
  .detail-media {
    flex-direction: row;
  }
  .detail-media > * {
    flex: 1 1 0;
    min-width: 0;
  }
  .detail-media .play-button-overlay {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.95rem;
  }
  .detail-media .media-video-caption {
    font-size: 0.68rem;
    padding: 0.3rem 0.4rem;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
  }
}

a { color: var(--cs-black); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: var(--cs-cotton-light);
  border-bottom: 1px solid var(--cs-grey-100);
}

.site-header .brand {
  display: block;
  height: 18px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--cs-black);
}

.site-nav a:hover { color: var(--cs-dark-green); }

.site-nav details {
  position: relative;
}

.site-nav details summary {
  cursor: pointer;
  list-style: none;
}

.site-nav details summary::-webkit-details-marker { display: none; }

.site-nav details[open] summary { color: var(--cs-dark-green); }

.site-nav details .status-help {
  position: absolute;
  top: 1.75rem;
  right: 0;
  width: 220px;
  background: var(--cs-white);
  border: 1px solid var(--cs-grey-100);
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  color: var(--cs-grey-text);
  line-height: 1.4;
  z-index: 20;
}

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

.site-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.form-narrow {
  max-width: 560px;
}

.request-form-page {
  max-width: 900px;
}

/* More compact than the default .swatch-note — this is always a short
   one-liner here (the popular-shades subcopy), not the longer multi-line
   disclaimer used elsewhere (e.g. the status page), so it doesn't need as
   much padding. Fixes a real bug: the icon sat off-center against the
   text with the default spacing, and the box spanned the full column
   width regardless of how short the text was — width: fit-content and
   the icon's margin-top were tuned empirically against the real
   rendered text (see git history for the round that fixed this). */
.shade-picker .swatch-note {
  width: fit-content;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
}

.shade-picker .swatch-note .swatch-note-icon {
  width: 0.9rem;
  height: 0.9rem;
  font-size: 0.6rem;
  line-height: 1;
  margin-top: -0.96rem;
}

.shade-picker .swatch-note p {
  font-size: 0.76rem;
}

.site-footer {
  margin-top: 4rem;
  padding: 3rem 2rem;
  background: var(--cs-dark-green);
  color: var(--cs-cotton-light);
}

.site-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
}

.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer img { height: 28px; width: auto; }

.site-footer p { margin: 0; font-size: 0.85rem; color: var(--cs-cotton); }

.site-footer .back-link {
  color: var(--cs-white);
  font-size: 0.85rem;
  text-decoration: underline;
  margin-bottom: 0;
}

.site-footer-centre { justify-self: center; }
.site-footer-right { justify-self: end; }

@media (max-width: 640px) {
  .site-footer-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .site-footer-centre, .site-footer-right { justify-self: center; }
}

/* -- Messages ------------------------------------------------------------ */

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.message {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--cs-grey-100);
}

.message-error { border-color: #c0392b; color: #c0392b; }
.message-success { border-color: var(--cs-dark-green); color: var(--cs-dark-green); }

/* -- Hero (catalogue landing) -------------------------------------------- */

.hero {
  padding: 1rem 0 3rem;
  max-width: 640px;
}

.hero p {
  color: var(--cs-grey-text);
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
}

/* -- Value grid ("how it works") ----------------------------------------- */

#how-it-works {
  margin-top: 4.5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--cs-grey-100);
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin: 2rem 0 3rem;
}

.value-item .value-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--cs-radius-pill);
  background: var(--cs-dark-green);
  color: var(--cs-white);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.value-item h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }

.value-item p { color: var(--cs-grey-text); font-size: 0.9rem; margin: 0; }

/* -- Cards / grid --------------------------------------------------------- */

.sort-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  scroll-margin-top: 5rem;
}

.sort-control label {
  font-weight: bold;
  font-size: 0.85rem;
}

.sort-control form { display: contents; }

.sort-control select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--cs-grey-200);
  border-radius: var(--cs-radius);
  font-family: var(--cs-font-body);
  font-size: 0.9rem;
  background: var(--cs-white);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  border: 1px solid var(--cs-grey-100);
  border-radius: var(--cs-radius);
  overflow: hidden;
  background: var(--cs-white);
}

.card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--cs-cotton);
}

.card-body { padding: 1.1rem; }

.card h3 { margin: 0 0 0.3rem; font-size: 1rem; }

.card .meta { color: var(--cs-grey-text); font-size: 0.85rem; }

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

a.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cs-black);
  color: var(--cs-white);
  border: 2px solid var(--cs-black);
  padding: var(--cs-btn-padding);
  border-radius: var(--cs-radius);
  text-decoration: none;
  font-family: var(--cs-font-body);
  font-size: 0.95rem;
  cursor: pointer;
}

a.button.secondary, button.button.secondary {
  background: transparent;
  color: var(--cs-black);
}

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

form.stacked p { margin: 0 0 1.1rem; }
form.stacked label { display: block; font-weight: bold; margin-bottom: 0.3rem; }
form.stacked input[type=text],
form.stacked input[type=email],
form.stacked textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--cs-grey-200);
  border-radius: var(--cs-radius);
  font-family: var(--cs-font-body);
  font-size: 1rem;
}
form.stacked .helptext { color: var(--cs-grey-text); font-size: 0.8rem; }
form.stacked .errorlist { color: #c0392b; padding-left: 1rem; margin: 0.25rem 0; list-style: none; }
.honeypot-field { position: absolute; left: -9999px; }

/* -- TCX swatch / colour disclaimer ------------------------------------------ */

.swatch {
  display: inline-block;
  width: 4rem;
  height: 4rem;
  border-radius: var(--cs-radius);
  border: 1px solid var(--cs-grey-100);
  vertical-align: middle;
}

/* The focal TCX result swatch on the request form — deliberately much
   bigger than the small inline .swatch used elsewhere (e.g. status page
   dip cards), since this is "the hero moment" per the design brief. */
.swatch-preview {
  display: block;
  width: 9rem;
  height: 9rem;
  border-radius: var(--cs-radius);
  border: 1px solid var(--cs-grey-100);
}

.swatch-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--cs-cotton-light);
  border: 1px solid var(--cs-grey-100);
}

/* Space below the TCX swatch preview + disclaimer, so it doesn't sit
   flush against whatever field comes after it (e.g. Colour notes). */
#tcx-swatch-preview:not(:empty) {
  margin-bottom: 1.5rem;
}

.swatch-note .swatch-note-icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: var(--cs-radius-pill);
  border: 1.5px solid var(--cs-grey-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--cs-grey-300);
  margin-top: 0.1rem;
}

.swatch-note p {
  margin: 0;
  color: var(--cs-grey-text);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* Legacy alias so any un-migrated template text still reads sensibly */
.swatch-disclaimer { color: var(--cs-grey-text); font-size: 0.82rem; margin-top: 0.5rem; }

/* -- TCX autocomplete dropdown -------------------------------------------- */

.tcx-autocomplete { position: relative; }

.tcx-autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  margin-top: 2px;
  max-height: 18rem;
  overflow-y: auto;
  background: var(--cs-white);
  border: 1px solid var(--cs-grey-200);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.tcx-autocomplete-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font-size: 0.88rem;
}

.tcx-autocomplete-option:hover,
.tcx-autocomplete-option.highlighted {
  background: var(--cs-cotton-light);
}

.tcx-autocomplete-swatch {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--cs-grey-100);
}

.tcx-autocomplete-code {
  flex: none;
  font-weight: bold;
  color: var(--cs-black);
}

.tcx-autocomplete-name {
  color: var(--cs-grey-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* -- Popular shades picker ---------------------------------------------------- */

.shade-picker {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--cs-grey-100);
}

.shade-picker-label {
  font-weight: bold;
  margin-bottom: 0.75rem;
}

.shade-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.85rem;
}

@media (max-width: 640px) {
  .shade-grid { grid-template-columns: repeat(4, 1fr); }
}

.shade-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--cs-font-body);
}

.shade-swatch-block {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--cs-radius);
  border: 1px solid var(--cs-grey-100);
}

.shade-swatch:hover .shade-swatch-block,
.shade-swatch:focus-visible .shade-swatch-block {
  outline: 2px solid var(--cs-dark-green);
  outline-offset: 2px;
}

.shade-swatch-label {
  font-size: 0.72rem;
  color: var(--cs-grey-text);
  text-align: center;
  line-height: 1.1;
}

/* -- Status page / step tracker ------------------------------------------------ */

.status-pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: var(--cs-radius-pill);
  border: 1px solid var(--cs-grey-100);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cs-grey-text);
}

.dip-card {
  border: 1px solid var(--cs-grey-100);
  border-radius: var(--cs-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--cs-white);
}

.dip-card.highlighted { border-color: var(--cs-dark-green); border-width: 2px; }

.dip-actions { margin-top: 1.25rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* -- Cart review (multi-item checkout) ----------------------------------- */

.cart-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.cart-item-info {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.cart-item-info .tcx-autocomplete-swatch { margin-top: 0.2rem; }

.cart-item-info p.meta { margin: 0.2rem 0 0; }

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: none;
}

.cart-total {
  text-align: right;
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
}

.cart-add-more {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--cs-font-body);
  font-size: inherit;
  color: var(--cs-black);
  text-decoration: underline;
  cursor: pointer;
}

/* Capped at a fixed width so one long free-text value (e.g. Handle,
   Construction) can't stretch the shared value column for every row in
   the table — grid columns size across all rows together, not per-row.
   Short values still size to their own content (minmax's max is a
   ceiling, not a forced width) and stay right-aligned as normal. */
dl.spec-list { display: grid; grid-template-columns: 1fr minmax(0, 22rem); gap: 0 1rem; }
dl.spec-list dt,
dl.spec-list dd {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--cs-grey-100);
  display: flex;
  align-items: center;
}
dl.spec-list dt {
  color: var(--cs-grey-300);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}
dl.spec-list dd {
  margin: 0;
  font-weight: bold;
  text-align: right;
  justify-content: flex-end;
  overflow-wrap: break-word;
  min-width: 0;
}

.step-tracker {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0 0.5rem;
  list-style: none;
  padding: 0;
}

.step-tracker li {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0.25rem;
  border: 1px solid var(--cs-grey-100);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--cs-grey-300);
}

.step-tracker li .step-number {
  display: block;
  font-size: 0.68rem;
  margin-bottom: 0.2rem;
  opacity: 0.75;
}

.step-tracker li.done,
.step-tracker li.current {
  background: var(--cs-dark-green);
  border-color: var(--cs-dark-green);
  color: var(--cs-white);
}

.step-progress-bar {
  height: 3px;
  background: var(--cs-grey-100);
  margin-bottom: 1.5rem;
}

.step-progress-bar-fill {
  height: 100%;
  background: var(--cs-dark-green);
}

.credit-note {
  display: inline-block;
  padding: 0.6rem 0.9rem;
  background: var(--cs-cotton-light);
  border: 1px solid var(--cs-grey-100);
  color: var(--cs-dark-green);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .step-tracker { flex-direction: column; gap: 0.4rem; }
  .step-tracker li { text-align: left; display: flex; align-items: center; gap: 0.6rem; }
  .step-tracker li .step-number { display: inline; margin-bottom: 0; }
}

/* -- Terms & conditions accordion ----------------------------------------- */

.tc-accordion {
  margin-top: 2.5rem;
}

.tc-item {
  border-bottom: 1px solid var(--cs-grey-100);
}

.tc-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  cursor: pointer;
  font-weight: bold;
  list-style: none;
}

.tc-item summary::-webkit-details-marker { display: none; }

.tc-item .tc-arrow {
  display: inline-block;
  transition: transform 0.15s ease;
  color: var(--cs-grey-300);
}

.tc-item[open] .tc-arrow { transform: rotate(90deg); }

.tc-item p {
  margin: 0 0 1rem;
  color: var(--cs-grey-text);
  font-size: 0.88rem;
  line-height: 1.5;
}
