/* ==========================================================================
   COMPONENTS — buttons, badges, cards, floating header, footer, cart FAB
   No raw colour values.
   ========================================================================== */

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  padding: 15px 28px;
  min-height: 50px;
  /* The transparent border reserves space so bordered variants don't shift
     layout by a pixel. See .btn--grad for the tiling artifact this causes with
     a gradient fill, and the fix. */
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font: inherit;
  font-size: var(--t-sm);
  font-weight: var(--w-bold);
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease),
              background-color .2s var(--ease), border-color .2s var(--ease);
}

/* Gradient + the 1px transparent border above needs care. By default the fill is
   SIZED to the padding box (background-origin) but PAINTED across the border box
   (background-clip), so the 1px border strip falls outside the gradient tile —
   and background-repeat defaults to `repeat`. The left edge then showed the tail
   of the previous tile (#38d6b0 mint) and the right edge the head of the next
   (#076157 near-black).

   background-origin: border-box sizes the gradient to the full painted area, so
   there is nothing left to tile. Longhands, not the `background` shorthand — the
   shorthand resets origin and clip and silently undoes this. */
.btn--grad {
  background-image: var(--grad);
  background-origin: border-box;
  background-clip: border-box;
  background-repeat: no-repeat;
  color: var(--brand-ink);
  box-shadow: var(--sh-brand);
}
.btn--grad:hover { transform: translateY(-2px); color: var(--brand-ink); }

/* White pill with hairline border — the reference's secondary action. */
.btn--ghost {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line-2);
  box-shadow: var(--sh-sm);
}
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--ink-45); }

/* Solid dark pill — used for "view all" style links. */
.btn--dark { background: var(--ink); color: var(--paper); }
.btn--dark:hover { transform: translateY(-2px); color: var(--paper); }

.btn--light { background: var(--paper); color: var(--ink); }
.btn--light:hover { transform: translateY(-2px); color: var(--ink); }

.btn--sm { padding: 11px 20px; min-height: 42px; font-size: var(--t-xs); }
.btn--lg { padding: 18px 34px; min-height: 58px; font-size: var(--t-base); }

/* --- Badges & pills ------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: var(--t-2xs);
  font-weight: var(--w-heavy);
  letter-spacing: .04em;
  line-height: 1.3;
  text-transform: uppercase;
}
.badge--sale  { background: var(--grad); color: var(--brand-ink); }
.badge--pct   { background: var(--brand-wash); color: var(--brand-d); }
.badge--out   { background: var(--wash-2); color: var(--ink-45); }

/* In-stock is a dot + label, not a filled chip (matches the reference). */
.stock-dot {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--t-xs); font-weight: var(--w-bold); color: var(--ink-70);
}
.stock-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--stock);
}
.stock-dot--out::before { background: var(--ink-45); }

.pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--paper);
  box-shadow: var(--sh-sm);
  font-size: var(--t-xs);
  font-weight: var(--w-bold);
  color: var(--ink-70);
}
.pill::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--stock);
}

.stars { color: var(--rating); letter-spacing: .08em; }

.ph {
  display: inline-block;
  padding: 1px 8px;
  border: 1px dashed var(--ph-ink);
  border-radius: 6px;
  background: repeating-linear-gradient(45deg,
    var(--ph-bg), var(--ph-bg) 8px, var(--ph-bg-2) 8px, var(--ph-bg-2) 16px);
  color: var(--ph-ink);
  font-size: .9em;
  font-weight: var(--w-bold);
}

/* --- Section head --------------------------------------------------------- */

.head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--gap);
  margin-bottom: clamp(30px, 3.6vw, 52px);
}
.head--c {
  grid-template-columns: 1fr;
  text-align: center;
  justify-items: center;
}
.head--c .head__main { margin-inline: auto; }
.head__main { max-width: 56ch; }
.head h2 {
  font-size: var(--t-xl);
  font-weight: var(--w-black);
  margin-block: 14px 16px;
}
.head__lead { color: var(--ink-70); font-size: var(--t-sm); }
.head__link { flex-shrink: 0; }

@media (max-width: 760px) {
  .head { grid-template-columns: 1fr; align-items: start; }
}

/* --- Product card --------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--gap);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease),
              border-color .22s var(--ease);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--sh); border-color: var(--line-2); }
.card--ph:hover { transform: none; box-shadow: none; }

/* Tinted image well — the reference never puts product shots on white. */
.card__media {
  position: relative;
  aspect-ratio: 1;
  margin-bottom: 16px;
  border-radius: var(--r-md);
  background: var(--grad-soft);
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: contain; padding: 12%; }

/* Sale badge sits ON the image, top-left. */
.card__flag { position: absolute; top: 12px; left: 12px; z-index: 2; }

.card__title {
  font-size: var(--t-base);
  font-weight: var(--w-heavy);
  letter-spacing: -.01em;
}
.card__meta { margin-top: 8px; }

.card__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}
.card__price { font-size: var(--t-md); font-weight: var(--w-black); line-height: 1.2; }
.card__price del { color: var(--ink-45); font-weight: 400; font-size: var(--t-xs); }
.card__price ins { text-decoration: none; }
.card__was { display: flex; align-items: center; gap: 7px; margin-top: 5px; }

@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card { padding: 11px; }
  .card__foot { flex-direction: column; align-items: stretch; }
}

/* --- Announcement strip --------------------------------------------------- */

.strip {
  background: var(--ink);
  color: var(--paper);
  font-size: var(--t-xs);
  font-weight: var(--w-bold);
}
.strip__vp { overflow: hidden; }
.strip__track { display: flex; width: max-content; animation: kl-marquee 42s linear infinite; }
.strip__set { display: flex; }
.strip__item {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 21px; white-space: nowrap; opacity: .95;
}
.strip__item svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; opacity: .75; }

@keyframes kl-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.strip:hover .strip__track { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .strip__track { animation: none; width: 100%; justify-content: center; }
  .strip__set:nth-child(2) { display: none; }
}

/* --- Floating pill header -------------------------------------------------
   The reference's most distinctive structural move: the header is an inset
   white capsule floating over the page, not a full-width bar. */

.hdr {
  position: sticky;
  top: 14px;
  z-index: 60;
  margin-block: 14px 0;
}
.hdr__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--hdr-h);
  padding: 10px 12px 10px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: var(--sh);
}

.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
/* The mark is an inline SVG so it can pick up tokens. The bar is a mask
   knockout, not a white fill, so it stays transparent on any surface. */
.brand__mark {
  width: 30px; height: 30px;
  flex-shrink: 0;
  display: block;
}
.brand__mark .kl-s0 { stop-color: var(--brand-d); }
.brand__mark .kl-s1 { stop-color: var(--brand); }
.brand__mark .kl-s2 { stop-color: var(--brand-x); }
.brand__txt {
  font-family: var(--font-display);
  font-weight: var(--w-black);
  font-size: var(--t-md);
  letter-spacing: -.02em;
  text-transform: uppercase;
  /* Brand green, not ink. 4.24:1 on --paper — passes AA for large text (20px/900)
     and logotypes are exempt from the contrast minimum regardless. Header and
     footer both sit on --paper, so one rule covers both. On any dark surface the
     wordmark must be reversed to --paper, not left green (4.16:1 on --ink-panel
     is too dim). */
  color: var(--brand);
}

/* CTA sits immediately left of the nav links, as in the reference. */
.hdr__cta { flex-shrink: 0; }

.nav { display: flex; flex: 1; }
.nav__links { display: flex; gap: clamp(12px, 1.6vw, 26px); }
.nav__links a { font-size: var(--t-sm); font-weight: var(--w-bold); color: var(--ink-70); }
.nav__links a:hover { color: var(--ink); }

.hdr__side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }

/* .ico--srch and .ico--burger are <button>; the account and cart icons are <a>.
   Astra's dynamic CSS styles bare `button` with `padding:15px 30px`, its own
   background/colour and a box-shadow. Class selectors here already outrank it
   for everything .ico DECLARES — but padding, box-shadow and appearance were
   never declared, so the search control rendered as a wide empty pill while the
   <a> icons beside it looked correct. These resets close that gap. */
.ico {
  position: relative;
  display: inline-grid; place-items: center;
  box-sizing: border-box;
  width: 44px; height: 44px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--paper);
  color: var(--ink-70);
  font: inherit;
  line-height: 1;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.ico:hover { background: var(--wash); color: var(--ink); }
.ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ico__count {
  position: absolute; top: -2px; right: -2px;
  min-width: 19px; padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--brand); color: var(--brand-ink);
  font-size: 11px; font-weight: var(--w-heavy); line-height: 19px; text-align: center;
}

.ico--burger { display: none; }
.ico--burger span,
.ico--burger span::before,
.ico--burger span::after {
  content: ""; display: block; width: 17px; height: 2px;
  border-radius: 2px; background: currentColor;
}
.ico--burger span::before { transform: translateY(-6px); }
.ico--burger span::after  { transform: translateY(4px); }

/* --- Search --------------------------------------------------------------- */

.srch { position: relative; }
.srch__box {
  position: absolute; top: calc(100% + 14px); right: 0;
  width: min(440px, 88vw);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  box-shadow: var(--sh-lg);
}
.srch__box input {
  width: 100%; padding: 13px 16px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  font: inherit; font-size: var(--t-sm); color: var(--ink);
}
.srch__res { margin-top: 10px; max-height: 48vh; overflow-y: auto; }
.srch__res:empty { display: none; }
.srch__hit { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-sm); }
.srch__hit:hover { background: var(--wash); }
.srch__hit img { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
.srch__hit b { font-size: var(--t-sm); font-weight: var(--w-bold); }
.srch__hit span { display: block; font-size: var(--t-xs); color: var(--ink-45); }
.srch__none { padding: 12px 10px; font-size: var(--t-sm); color: var(--ink-45); }

/* --- Mobile drawer -------------------------------------------------------- */

.drawer {
  display: none;
  margin-top: 10px; padding: 18px 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--sh);
}
.drawer__links { display: grid; }
.drawer__links a {
  display: block; padding: 14px 0;
  font-size: var(--t-md); font-weight: var(--w-bold);
  border-bottom: 1px solid var(--line);
}
.drawer__cta { width: 100%; margin-top: 20px; }

@media (max-width: 921px) {
  .nav { display: none; }
  .hdr__cta { display: none; }
  .ico--burger { display: inline-grid; }
  .drawer { display: block; }
  .drawer[hidden] { display: none; }
  .hdr__inner { min-height: 64px; padding-left: 20px; }
}

/* --- Floating cart button -------------------------------------------------- */

/* Rendered on wp_footer, OUTSIDE .pl-root — so it never receives the wrapper's
   box-sizing reset. Left on the browser default (content-box), Astra's button
   padding would have inflated this 62px control to roughly 122x92. Both are
   declared explicitly here rather than relying on an ancestor. */
.cart-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 55;
  display: grid; place-items: center;
  box-sizing: border-box;
  width: 62px; height: 62px;
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--sh-lg);
  color: var(--brand-d);
  cursor: pointer;
  transition: transform .2s var(--ease);
}
.cart-fab:hover { transform: translateY(-3px); }
.cart-fab svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.cart-fab .ico__count { top: 6px; right: 6px; }

@media (max-width: 600px) { .cart-fab { width: 54px; height: 54px; right: 14px; bottom: 14px; } }

/* --- Footer --------------------------------------------------------------- */

.foot-wrap { border-top: 1px solid var(--line); background: var(--paper); }

.foot {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: clamp(26px, 3.4vw, 60px);
  padding-block: clamp(52px, 6vw, 84px) clamp(30px, 3.4vw, 46px);
}
.foot__desc { margin-top: 14px; max-width: 44ch; font-size: var(--t-sm); color: var(--ink-70); }
.foot__h {
  font-size: var(--t-2xs); font-weight: var(--w-heavy);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-45); margin-bottom: 16px;
}
.foot__list { display: grid; gap: 11px; }
.foot__list a { font-size: var(--t-sm); font-weight: 500; color: var(--ink-70); }
.foot__list a:hover { color: var(--brand); }

.nl { margin-top: 26px; }
.nl__label { display: block; font-size: var(--t-xs); font-weight: var(--w-bold); margin-bottom: 10px; }
.nl__row { display: flex; gap: 8px; flex-wrap: wrap; }
.nl__row input {
  flex: 1 1 190px; padding: 13px 18px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  font: inherit; font-size: var(--t-sm);
}
.nl__note { margin-top: 9px; font-size: var(--t-xs); }

.foot__bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: space-between;
  padding-block: 22px;
  border-top: 1px solid var(--line);
  font-size: var(--t-xs); color: var(--ink-45);
}
.foot__legal { display: inline-flex; gap: 9px; }

@media (max-width: 782px) { .foot { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  .foot { grid-template-columns: 1fr; }
  .foot__bar { flex-direction: column; }
}
