/* =====================================================================
   The Hemp Doctor — Checkout design system
   Tokens + shared components. Loaded on every page (the cart drawer
   needs it). Page-specific rules live in thd-checkout.css.
   ===================================================================== */

:root {
  --thd-teal: #025960;
  --thd-teal-dark: #013F45;
  --thd-forest: #113D3C;
  --thd-goldfish: #FC9E01;
  --thd-goldfish-dark: #E08C00;
  --thd-goldfish-light: #FFC55A;
  --thd-goldfish-pale: #FDCE80;
  --thd-linen: #F6F8EA;
  --thd-mint: #EEF7F2;
  --thd-mint-light: #F7FBFA;
  --thd-sage: #BFD6D0;
  --thd-cream: #FDF4E5;
  --thd-cream-light: #FFFBF2;
  --thd-ink: #1A2E2D;
  --thd-muted: #6B7B7A;
  --thd-teal-muted: #80ACAF;
  --thd-teal-mid: #418288;
  --thd-border: #D4E0DE;
  --thd-border-light: #E9EFEF;
  --thd-input-border: #C0D5D6;
  --thd-white: #FFFFFF;

  --thd-serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --thd-script: "Pinyon Script", "Brush Script MT", cursive;
  --thd-sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;

  --thd-radius-sm: 6px;
  --thd-radius: 10px;
  --thd-radius-lg: 16px;
  --thd-radius-xl: 20px;
  --thd-shadow: 0 6px 24px rgba(17, 61, 60, 0.08);
  --thd-container: 1240px;
}

/* ---------- Typography helpers ---------- */
.thd-serif { font-family: var(--thd-serif); font-weight: 400; }
.thd-script { font-family: var(--thd-script); font-weight: 400; }

/* ---------- Icons ---------- */
.thd-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.thd-icon--fill { fill: currentColor; stroke: none; }

/* ---------- Buttons ---------- */
.thd-btn,
.thd-btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  box-sizing: border-box;
  min-height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  font-family: var(--thd-serif) !important;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.thd-btn--primary,
.thd-btn--primary:visited {
  background: var(--thd-goldfish) !important;
  color: var(--thd-white) !important;
}
.thd-btn--primary:hover,
.thd-btn--primary:focus-visible {
  background: var(--thd-goldfish-dark) !important;
  color: var(--thd-white) !important;
}
.thd-btn--dark,
.thd-btn--dark:visited {
  background: var(--thd-forest) !important;
  color: var(--thd-white) !important;
}
.thd-btn--dark:hover,
.thd-btn--dark:focus-visible {
  background: var(--thd-teal) !important;
  color: var(--thd-white) !important;
}
.thd-btn--outline,
.thd-btn--outline:visited {
  background: transparent !important;
  color: var(--thd-teal-muted) !important;
  box-shadow: inset 0 0 0 1.5px var(--thd-sage);
}
.thd-btn--outline:hover,
.thd-btn--outline:focus-visible {
  color: var(--thd-teal) !important;
  box-shadow: inset 0 0 0 1.5px var(--thd-teal);
}
.thd-btn--outline-teal,
.thd-btn--outline-teal:visited {
  background: var(--thd-white) !important;
  color: var(--thd-teal) !important;
  box-shadow: inset 0 0 0 1.5px var(--thd-teal);
}
.thd-btn--block { display: flex; width: 100%; }
.thd-btn--sm { min-height: 36px; padding: 0 20px; font-size: 14px; }
.thd-btn:focus-visible { outline: 3px solid rgba(2, 89, 96, 0.35); outline-offset: 2px; }
.thd-btn[disabled], .thd-btn.is-loading { opacity: 0.6; cursor: wait; }

/* ---------- Text links ---------- */
.thd-link,
.thd-link:visited {
  color: var(--thd-teal);
  font-family: var(--thd-sans);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.thd-link:hover { color: var(--thd-teal-dark); }

/* ---------- Eyebrow + title block ---------- */
.thd-page-head {
  text-align: center;
  margin: 0 auto 28px;
  max-width: 720px;
}
.thd-page-head .thd-pill {
  margin-bottom: 8px;
}
.thd-eyebrow {
  display: block;
  font-family: var(--thd-script);
  font-size: 30px;
  line-height: 1;
  color: var(--thd-teal);
  margin: 0 0 4px;
}
.thd-title {
  font-family: var(--thd-serif) !important;
  font-weight: 400 !important;
  font-size: 44px !important;
  line-height: 1.1 !important;
  color: var(--thd-teal) !important;
  margin: 0 !important;
  letter-spacing: 0;
}
.thd-rule {
  display: block;
  width: 260px;
  max-width: 70%;
  height: 3px;
  margin: 12px auto 0;
  background: var(--thd-goldfish);
  border-radius: 2px;
}
.thd-lede {
  font-family: var(--thd-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--thd-ink);
  margin: 18px auto 0;
  max-width: 620px;
}

/* ---------- Pills & badges ---------- */
.thd-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--thd-teal-muted);
  color: var(--thd-white);
  font-family: var(--thd-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.thd-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--thd-goldfish-light);
  color: var(--thd-forest);
  font-family: var(--thd-sans);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.thd-badge--upper { text-transform: uppercase; font-size: 9px; letter-spacing: 0.06em; padding: 2px 8px; }
.thd-badge .thd-icon { font-size: 12px; }

/* ---------- Steps bar ---------- */
.thd-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 0;
  margin: 28px auto 34px;
  padding: 0;
  list-style: none;
  font-family: var(--thd-sans);
}
.thd-steps__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--thd-teal);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.thd-steps__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--thd-sage);
  color: var(--thd-white);
  font-size: 12px;
}
.thd-steps__item.is-done .thd-steps__dot,
.thd-steps__item.is-active .thd-steps__dot { background: var(--thd-goldfish); }
.thd-steps__short { display: none; }
@media (max-width: 600px) {
  .thd-steps__label { display: none; }
  .thd-steps__short { display: inline; }
}
.thd-steps__sep {
  width: 32px;
  height: 2px;
  margin: 0 18px;
  background: var(--thd-teal);
  border-radius: 2px;
}

/* ---------- Trust bar (dark strip under the header) ---------- */
.thd-trust-bar {
  background: var(--thd-forest);
  color: var(--thd-white);
  font-family: var(--thd-sans);
  font-size: 13px;
  font-weight: 500;
}
.thd-trust-bar__inner {
  display: flex;
  justify-content: center;
  gap: 48px;
  max-width: var(--thd-container);
  margin: 0 auto;
  padding: 14px 20px;
  flex-wrap: wrap;
}
.thd-trust-bar__item { display: inline-flex; align-items: center; gap: 8px; }
.thd-trust-bar__item .thd-icon { font-size: 14px; }

/* ---------- Trust lists ---------- */
.thd-trust {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--thd-sans);
}
.thd-trust__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--thd-teal);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
}
.thd-trust__item .thd-icon { color: var(--thd-goldfish); font-size: 16px; margin-top: 1px; }
.thd-trust--inline {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 40px;
}
.thd-trust--stack { grid-template-columns: 1fr; }

/* ---------- "Need a hand?" ---------- */
.thd-hand {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 22px 24px;
  border: 1px solid var(--thd-border);
  border-radius: var(--thd-radius);
  background: var(--thd-white);
  font-family: var(--thd-sans);
}
.thd-hand__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--thd-linen);
  color: var(--thd-teal);
  font-size: 20px;
}
.thd-hand__title {
  font-family: var(--thd-serif) !important;
  font-weight: 400 !important;
  font-size: 20px !important;
  color: var(--thd-teal) !important;
  margin: 0 0 6px !important;
  line-height: 1.2;
}
.thd-hand__text {
  margin: 0;
  color: var(--thd-muted);
  font-size: 13px;
  line-height: 1.7;
}
.thd-hand__text a,
.thd-hand__text a:visited {
  color: var(--thd-teal);
  font-weight: 700;
  text-decoration: none;
}

/* ---------- Progress cards (free shipping / milestones) ---------- */
.thd-progress {
  padding: 14px 16px;
  border: 1px solid var(--thd-border);
  border-radius: var(--thd-radius);
  background: var(--thd-white);
  font-family: var(--thd-sans);
}
.thd-progress + .thd-progress { margin-top: 10px; }
.thd-progress__label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--thd-teal);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.thd-progress__label .thd-icon { color: var(--thd-goldfish); font-size: 18px; }
.thd-progress__label strong { color: var(--thd-teal); font-weight: 700; }
.thd-progress__track {
  position: relative;
  height: 6px;
  border-radius: 6px;
  background: var(--thd-border-light);
  overflow: hidden;
}
.thd-progress__fill {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--thd-goldfish);
  transition: width 0.3s ease;
}
.thd-progress--milestone .thd-progress__fill { background: var(--thd-teal); }
.thd-progress__row { display: flex; align-items: center; gap: 12px; }
.thd-progress__row .thd-progress__track { flex: 1; }
.thd-progress__gift { color: var(--thd-teal); font-size: 24px; }
.thd-progress__tick {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  background: var(--thd-teal);
  opacity: 0.6;
}
.thd-progress__note {
  margin: 8px 0 0;
  color: var(--thd-muted);
  font-size: 11px;
}

/* ---------- Quantity stepper ---------- */
.thd-qty {
  display: inline-flex;
  align-items: center;
  height: 36px;
  border: 1px solid var(--thd-sage);
  border-radius: 999px;
  background: var(--thd-white);
  overflow: hidden;
  font-family: var(--thd-sans);
}
.thd-qty__btn {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 100%;
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  color: var(--thd-teal) !important;
  font: 500 16px/1 var(--thd-sans) !important;
  cursor: pointer;
  box-shadow: none !important;
}
.thd-qty__btn:hover { background: var(--thd-linen) !important; }
.thd-qty__btn[disabled] { opacity: 0.35; cursor: default; }
.thd-qty input.thd-qty__input,
.thd-qty input.qty {
  width: 36px !important;
  min-width: 0;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: center;
  font: 600 13px/1 var(--thd-sans) !important;
  color: var(--thd-ink) !important;
  -moz-appearance: textfield;
}
.thd-qty input::-webkit-outer-spin-button,
.thd-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.thd-qty input:focus { outline: none; }

/* ---------- Toggle switch ---------- */
.thd-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex: none;
  vertical-align: middle;
}
.thd-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.thd-switch__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--thd-sage);
  transition: background 0.15s ease;
}
.thd-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--thd-white);
  transition: transform 0.15s ease;
}
.thd-switch input:checked + .thd-switch__track { background: var(--thd-teal); }
.thd-switch input:checked + .thd-switch__track::after { transform: translateX(16px); }
.thd-switch input:focus-visible + .thd-switch__track { box-shadow: 0 0 0 3px rgba(2, 89, 96, 0.3); }

/* ---------- Notices ---------- */
.thd-notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid var(--thd-teal);
  border-radius: var(--thd-radius);
  background: var(--thd-sage);
  font-family: var(--thd-sans);
  font-size: 14px;
  line-height: 1.7;
  color: var(--thd-teal);
}
.thd-notice + .thd-notice { margin-top: 14px; }
.thd-notice__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--thd-white);
  color: var(--thd-teal);
  font-size: 14px;
}
.thd-notice strong { font-weight: 700; }

/* Soft note boxes */
.thd-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--thd-radius-sm);
  background: var(--thd-linen);
  font-family: var(--thd-sans);
  font-size: 13px;
  line-height: 1.65;
  color: var(--thd-ink);
}
.thd-note .thd-icon { color: var(--thd-teal); font-size: 16px; margin-top: 3px; }
.thd-note strong { color: var(--thd-ink); font-weight: 700; }
.thd-note--warn { background: var(--thd-cream); border-left: 3px solid var(--thd-goldfish); border-radius: 0 var(--thd-radius-sm) var(--thd-radius-sm) 0; }
.thd-note--warn .thd-icon { color: var(--thd-goldfish); }
.thd-note--mint { background: var(--thd-mint); }
.thd-note--mint .thd-icon { color: var(--thd-teal); }
.thd-note__title { display: block; color: var(--thd-teal); font-weight: 700; margin-bottom: 2px; }
.thd-note a { color: var(--thd-goldfish); font-weight: 700; }

/* ---------- Final-number box ---------- */
.thd-final {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--thd-mint);
  font-family: var(--thd-sans);
}
.thd-final .thd-icon { color: var(--thd-teal); font-size: 16px; margin-top: 2px; }
.thd-final__title {
  display: block;
  font-family: var(--thd-serif);
  font-size: 14px;
  color: var(--thd-teal);
  line-height: 1.3;
}
.thd-final__text { display: block; color: var(--thd-muted); font-size: 12px; margin-top: 2px; }

.thd-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 0;
  color: var(--thd-teal);
  font-family: var(--thd-sans);
  font-size: 12px;
  font-weight: 600;
}
.thd-secure .thd-icon { color: var(--thd-goldfish); font-size: 13px; }

.thd-installments {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
  color: var(--thd-muted);
  font-family: var(--thd-sans);
  font-size: 12px;
}
.thd-installments strong { color: var(--thd-ink); }
.thd-pay-logo {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px dashed var(--thd-sage);
  border-radius: 4px;
  color: var(--thd-teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--thd-white);
}
img.thd-pay-logo { padding: 0; border: 0; height: 20px; width: auto; }

/* ---------- Product thumbnail placeholder ---------- */
.thd-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 60px;
  height: 60px;
  border: 1px solid var(--thd-border);
  border-radius: 8px;
  background: var(--thd-linen);
  overflow: hidden;
  color: var(--thd-teal-muted);
}
.thd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thd-thumb .thd-icon { font-size: 22px; }

/* ---------- Native checkbox / radio ---------- */
.thd-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-family: var(--thd-sans);
  font-size: 14px;
  color: var(--thd-ink);
  line-height: 1.5;
}
.thd-check input[type="checkbox"],
.thd-check input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0 !important;
  border: 1.5px solid var(--thd-sage);
  border-radius: 5px;
  background: var(--thd-white);
  cursor: pointer;
  position: relative;
}
.thd-check input[type="radio"] { border-radius: 50%; }
.thd-check input:checked {
  background: var(--thd-teal);
  border-color: var(--thd-teal);
}
.thd-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.thd-check input[type="radio"]:checked {
  background: var(--thd-white);
  box-shadow: inset 0 0 0 5px var(--thd-teal);
}
.thd-check input:focus-visible { outline: 3px solid rgba(2, 89, 96, 0.3); outline-offset: 2px; }

/* ---------- Utility ---------- */
.thd-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.thd-visually-none { display: none !important; }
.thd-wrap { max-width: var(--thd-container); margin-left: auto; margin-right: auto; }
.thd-full-bleed {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
@media (prefers-reduced-motion: reduce) {
  .thd-btn, .thd-progress__fill, .thd-switch__track, .thd-switch__track::after { transition: none; }
}
