/* outfitters.css — only what the shared library genuinely lacks: a product grid, a
   photo gallery, a swatch row, a bag layout and the admin's variant matrix.

   Every colour here resolves to an --ehs-* token, so the dark-mode flip is inherited
   rather than re-pinned. No hex values, no second theme block. Buttons, inputs, cards,
   tables, badges and alerts all come from brand.css. */

/* ---- Subnav link that carries a count ------------------------------ */
/* .ehs-subnav__link is already `display:inline-flex`, so its label and a nested
   .ehs-badge are two flex items — and a flex container REMOVES the whitespace-only
   anonymous item between them. The markup's space collapses to nothing and the pill
   lands hard against the final letter, which reads as an overlap. A gap on the
   container is the fix; this class rides alongside the library's, so the library rule
   is not overridden for anyone else.
   Proposed for brand.css in /bastion/projects/branding/HARVEST.md. */
.ofit-navlink { gap: var(--ehs-s2); }

/* ---- Catalog grid -------------------------------------------------- */
.ofit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--ehs-s5);
  margin-top: var(--ehs-s5);
}

.ofit-card {
  display: flex;
  flex-direction: column;
  background: var(--ehs-paper);
  border: 1px solid var(--ehs-rule);
  border-radius: var(--ehs-r-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.ofit-card:hover,
.ofit-card:focus-visible {
  border-color: var(--ehs-maroon);
  transform: translateY(-2px);
  box-shadow: var(--ehs-shadow-md);
}

.ofit-card__media {
  position: relative;
  aspect-ratio: 6 / 5;
  background: var(--ehs-sunken);
}
.ofit-card__media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ofit-card__flag { position: absolute; top: var(--ehs-s2); left: var(--ehs-s2); }

.ofit-card__noimg {
  display: flex; align-items: center; justify-content: center;
  height: 100%; min-height: 160px;
  color: var(--ehs-muted); font-size: 13px;
  background: var(--ehs-sunken);
}

.ofit-card__body { padding: var(--ehs-s3) var(--ehs-s4) var(--ehs-s4); display: flex; flex-direction: column; gap: 4px; }
.ofit-card__name { font-family: var(--ehs-font-display); font-size: 18px; font-weight: 700; color: var(--ehs-ink); margin: 0; }
.ofit-card__tagline { font-size: 13px; color: var(--ehs-muted); margin: 0; }
.ofit-card__price { font-size: 15px; font-weight: 600; color: var(--ehs-accent-text); margin: var(--ehs-s1) 0 0; }

.ofit-note { margin-top: var(--ehs-s5); color: var(--ehs-muted); font-size: 14px; }

/* ---- Product page -------------------------------------------------- */
.ofit-product {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: var(--ehs-s6);
  align-items: start;
}
@media (max-width: 900px) { .ofit-product { grid-template-columns: 1fr; } }

.ofit-gallery { display: flex; flex-direction: column; gap: var(--ehs-s3); }
.ofit-gallery__main {
  background: var(--ehs-sunken);
  border: 1px solid var(--ehs-rule);
  border-radius: var(--ehs-r-md);
  overflow: hidden;
  aspect-ratio: 6 / 5;
  display: flex; align-items: center; justify-content: center;
}
.ofit-gallery__main img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* The thumb strip is .ehs-thumbs/.ehs-thumb from the library; only the selected state
   is ours, and it is a border rather than a colour swap so it survives both themes. */
.ehs-thumb[hidden] { display: none; }

.ofit-buy { display: flex; flex-direction: column; gap: var(--ehs-s4); }
.ofit-buy__qty { max-width: 120px; }
.ofit-buy__price {
  display: flex; align-items: baseline; gap: var(--ehs-s3);
  font-family: var(--ehs-font-display); font-size: 28px; font-weight: 700;
  color: var(--ehs-ink); margin: 0;
}
.ofit-buy__stock { font-family: var(--ehs-font-body); font-size: 13px; font-weight: 600; color: var(--ehs-muted); }
.ofit-buy__stock--out { color: var(--ehs-bad-text); }

.ofit-product__desc { color: var(--ehs-ink); font-size: 15px; line-height: 1.6; }
.ofit-product__desc p { margin: 0 0 var(--ehs-s2); }
.ofit-product__facts {
  margin: 0; padding-left: var(--ehs-s4);
  color: var(--ehs-muted); font-size: 14px; line-height: 1.6;
}

/* ---- Swatches ------------------------------------------------------ */
.ofit-swatches { display: flex; flex-wrap: wrap; gap: var(--ehs-s3); }
.ofit-swatch { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.ofit-swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ofit-swatch__chip {
  width: 34px; height: 34px; border-radius: var(--ehs-r-pill);
  background: var(--chip);
  border: 1px solid var(--ehs-rule-strong);
  box-shadow: inset 0 0 0 2px var(--ehs-paper);
  transition: box-shadow .15s ease, outline-color .15s ease;
  outline: 2px solid transparent; outline-offset: 2px;
}
.ofit-swatch input:checked + .ofit-swatch__chip { outline-color: var(--ehs-maroon); }
.ofit-swatch input:focus-visible + .ofit-swatch__chip { outline-color: var(--ehs-accent-text); }
.ofit-swatch__label { font-size: 12px; color: var(--ehs-muted); }
.ofit-swatch input:checked ~ .ofit-swatch__label { color: var(--ehs-ink); font-weight: 600; }

/* ---- Bag ----------------------------------------------------------- */
.ofit-bag {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: var(--ehs-s6);
  align-items: start;
}
@media (max-width: 900px) { .ofit-bag { grid-template-columns: 1fr; } }

/* .ehs-table-wrap is overflow:hidden in the library, which amputates a trailing
   actions column on a phone. This is the private scroller apps nest to compensate. */
.ofit-scroll { overflow-x: auto; }

.ofit-bag__item { display: flex; gap: var(--ehs-s3); align-items: flex-start; }
.ofit-bag__thumb {
  width: 68px; height: 58px; object-fit: contain;
  background: var(--ehs-sunken); border: 1px solid var(--ehs-rule);
  border-radius: var(--ehs-r-sm); display: block;
}
.ofit-bag__thumb--empty { display: block; }
.ofit-bag__name { font-weight: 600; color: var(--ehs-ink); text-decoration: none; }
.ofit-bag__name:hover { text-decoration: underline; }
.ofit-bag__variant, .ofit-bag__answer { font-size: 13px; color: var(--ehs-muted); }
.ofit-bag__problem { font-size: 13px; font-weight: 600; color: var(--ehs-bad-text); }
.ofit-bag__row--problem { background: var(--ehs-bad-pale); }
.ofit-bag__qty { width: 76px; }
.ofit-bag__qtycell { width: 90px; }
.ofit-num { text-align: right; white-space: nowrap; }

.ofit-bag__checkout { width: 100%; margin-top: var(--ehs-s4); justify-content: center; }

.ofit-coupon { margin: var(--ehs-s4) 0; }
.ofit-coupon__row { display: flex; gap: var(--ehs-s2); }
.ofit-coupon__row .ehs-input { flex: 1; min-width: 0; }

.ofit-totals { margin: var(--ehs-s4) 0 0; display: flex; flex-direction: column; gap: var(--ehs-s2); }
.ofit-totals > div { display: flex; justify-content: space-between; gap: var(--ehs-s3); font-size: 14px; }
.ofit-totals dt { color: var(--ehs-muted); margin: 0; }
.ofit-totals dd { margin: 0; color: var(--ehs-ink); }
.ofit-totals__grand {
  border-top: 1px solid var(--ehs-rule);
  padding-top: 8px; margin-top: 4px;
  font-size: 17px !important; font-weight: 700;
}
.ofit-totals__grand dt, .ofit-totals__grand dd { color: var(--ehs-ink); font-weight: 700; }

/* ---- Checkout ------------------------------------------------------ */
.ofit-checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: var(--ehs-s6);
  align-items: start;
}
@media (max-width: 900px) { .ofit-checkout { grid-template-columns: 1fr; } }
.ofit-checkout__form { display: flex; flex-direction: column; gap: var(--ehs-s5); }
.ofit-checkout__form .ehs-field { margin-bottom: var(--ehs-s3); }

/* Square renders its card fields in an iframe it styles itself; this is only the box
   it sits in, so it lines up with the inputs above it. */
#ofitCardWrap {
  border: 1px solid var(--ehs-rule-strong);
  border-radius: var(--ehs-r-sm);
  padding: var(--ehs-s3);
  background: var(--ehs-paper);
  margin-bottom: var(--ehs-s3);
  min-height: 90px;
}

.ofit-summary { list-style: none; margin: 0 0 var(--ehs-s3); padding: 0; display: flex; flex-direction: column; gap: var(--ehs-s2); }
.ofit-summary li { display: flex; justify-content: space-between; gap: var(--ehs-s3); font-size: 14px; color: var(--ehs-ink); }

/* ---- Admin --------------------------------------------------------- */
.ofit-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--ehs-s4);
  margin-bottom: var(--ehs-s5);
}

.ofit-toolbar {
  display: flex; flex-wrap: wrap; gap: var(--ehs-s3); align-items: flex-end;
  margin-bottom: var(--ehs-s4);
}
.ofit-toolbar .ehs-field { min-width: 180px; }

.ofit-panel { margin-bottom: var(--ehs-s5); }
.ofit-panel__head {
  display: flex; justify-content: space-between; align-items: center; gap: var(--ehs-s3);
  margin-bottom: var(--ehs-s3);
}
.ofit-panel__title { font-family: var(--ehs-font-display); font-size: 20px; font-weight: 700; color: var(--ehs-ink); margin: 0; }

/* The option builder: one block per selector, its values listed inside. */
.ofit-option {
  border: 1px solid var(--ehs-rule);
  border-radius: var(--ehs-r-md);
  padding: var(--ehs-s4);
  margin-bottom: var(--ehs-s3);
  background: var(--ehs-paper);
}
.ofit-option__head { display: flex; flex-wrap: wrap; gap: var(--ehs-s3); align-items: center; justify-content: space-between; }
.ofit-option__values { display: flex; flex-wrap: wrap; gap: var(--ehs-s2); margin-top: var(--ehs-s3); }
.ofit-option__value {
  display: inline-flex; align-items: center; gap: var(--ehs-s2);
  border: 1px solid var(--ehs-rule); border-radius: var(--ehs-r-pill);
  padding: var(--ehs-s1) var(--ehs-s2) var(--ehs-s1) var(--ehs-s3); font-size: 13px; color: var(--ehs-ink);
  background: var(--ehs-cream);
}
.ofit-option__value--off { opacity: .55; }
.ofit-option__dot { width: 14px; height: 14px; border-radius: var(--ehs-r-pill); background: var(--chip); border: 1px solid var(--ehs-rule-strong); }

.ofit-imggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--ehs-s3); }
.ofit-imgcard { border: 1px solid var(--ehs-rule); border-radius: var(--ehs-r-md); overflow: hidden; background: var(--ehs-paper); }
.ofit-imgcard__media { aspect-ratio: 6 / 5; background: var(--ehs-sunken); }
.ofit-imgcard__media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ofit-imgcard__body { padding: var(--ehs-s2) var(--ehs-s3) var(--ehs-s3); display: flex; flex-direction: column; gap: var(--ehs-s2); font-size: 12px; }
.ofit-imgcard__bindings { display: flex; flex-wrap: wrap; gap: 4px; }

.ofit-stock-input { width: 84px; }
.ofit-price-input { width: 110px; }
.ofit-low { color: var(--ehs-warn-text); font-weight: 600; }
.ofit-out { color: var(--ehs-bad-text); font-weight: 600; }

.ofit-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--ehs-s2); }
.ofit-timeline li { font-size: 13px; color: var(--ehs-muted); }
.ofit-timeline strong { color: var(--ehs-ink); }

.ofit-actions { display: flex; flex-wrap: wrap; gap: var(--ehs-s2); }
.ofit-form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--ehs-s3);
}
/* A field that should take the whole row of .ofit-form-grid — the description box, the
   tagline. It is a GRID ITEM, so it spans; setting template-columns on it would do
   nothing at all (it has no grid children of its own). */
.ofit-form-grid--wide { grid-column: 1 / -1; }
