/* OneHydraulics Custom Hose Builder — storefront UI
   Scoped to #hose-builder so it can sit inside any theme section.
   Override the tokens from the theme if needed, e.g.
     #hose-builder { --hb-accent: #1f8a4c; --hb-font: inherit; }
*/
#hose-builder {
  /* Reads the Warehouse theme's CSS variables when present; the fallbacks are used on the preview page or any other theme. */
  --hb-font: var(--text-font-family, inherit);
  --hb-heading-font: var(--heading-font-family, var(--hb-font));
  --hb-ink: var(--text-color, #1b2128);
  --hb-ink-rgb: var(--text-color-rgb, 27, 33, 40);
  --hb-heading: var(--heading-color, var(--hb-ink));
  --hb-muted: rgba(var(--hb-ink-rgb), .78);
  --hb-faint: rgba(var(--hb-ink-rgb), .55);
  --hb-rule: rgba(var(--hb-ink-rgb), .16);
  --hb-rule-strong: rgba(var(--hb-ink-rgb), .32);
  --hb-surface: var(--secondary-background, #ffffff);
  --hb-ground: #f4f5f7;
  --hb-accent: var(--primary-button-background, #1e7f4f);
  --hb-accent-rgb: var(--primary-button-background-rgb, 30, 127, 79);
  --hb-accent-ink: var(--primary-button-text-color, #ffffff);
  --hb-accent-soft: rgba(var(--hb-accent-rgb), .14);
  --hb-warn: #9a6412;
  --hb-warn-soft: #fbf1dc;
  --hb-bad: var(--error-color, #b23a3a);
  --hb-bad-soft: #f8e3e3;
  --hb-radius: 6px;

  font-family: var(--hb-font);
  color: var(--hb-ink);
  line-height: 1.45;
  font-size: 15px;
  box-sizing: border-box;
}
#hose-builder *, #hose-builder *::before, #hose-builder *::after { box-sizing: inherit; }
#hose-builder button { font: inherit; color: inherit; cursor: pointer; }
#hose-builder img { max-width: 100%; display: block; }

/* ---------- layout ---------- */
#hose-builder .hb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}
#hose-builder .hb-steps { display: grid; gap: 28px; min-width: 0; }
#hose-builder .hb-summary-col { position: sticky; top: 16px; }

@media (max-width: 900px) {
  #hose-builder .hb-layout { grid-template-columns: 1fr; }
  #hose-builder .hb-summary-col { position: static; }
}

/* ---------- steps ---------- */
#hose-builder .hb-step {
  background: var(--hb-surface);
  border: 1px solid var(--hb-rule);
  border-radius: var(--hb-radius);
  padding: 20px 22px 22px;
  display: grid;
  gap: 16px;
}
#hose-builder .hb-step[hidden] { display: none; }
#hose-builder .hb-step[data-locked="true"] { opacity: .55; }
#hose-builder .hb-step[data-locked="true"] .hb-step-body { display: none; }
#hose-builder .hb-step-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
#hose-builder .hb-step-num {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hb-faint);
}
#hose-builder .hb-step-title { font-size: 19px; font-weight: 700; margin: 0; font-family: var(--hb-heading-font); color: var(--hb-heading); }
#hose-builder .hb-step-hint { color: var(--hb-muted); font-size: 14px; margin-left: auto; }
#hose-builder .hb-step-body { display: grid; gap: 16px; }
#hose-builder .hb-field-label {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hb-muted);
}

/* ---------- chips ---------- */
#hose-builder .hb-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
#hose-builder .hb-chip {
  border: 1px solid var(--hb-rule-strong);
  background: var(--hb-surface);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 14px;
  line-height: 1.2;
  display: inline-flex; align-items: center; gap: 6px;
  transition: border-color .12s, background .12s;
}
#hose-builder .hb-chip:hover { border-color: var(--hb-ink); }
#hose-builder .hb-chip[aria-pressed="true"] { background: var(--hb-ink); border-color: var(--hb-ink); color: #fff; }
#hose-builder .hb-chip .hb-count { font-size: 12px; opacity: .65; }
#hose-builder .hb-chip:focus-visible, #hose-builder .hb-card:focus-visible, #hose-builder button:focus-visible, #hose-builder input:focus-visible {
  outline: 2px solid var(--hb-accent); outline-offset: 2px;
}

/* ---------- product cards ---------- */
#hose-builder .hb-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
#hose-builder .hb-card {
  text-align: left;
  border: 1px solid var(--hb-rule);
  border-radius: var(--hb-radius);
  background: var(--hb-surface);
  padding: 10px 10px 12px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 6px;
  position: relative;
  transition: border-color .12s, box-shadow .12s;
}
#hose-builder .hb-card:hover { border-color: var(--hb-rule-strong); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
#hose-builder .hb-card[aria-pressed="true"] {
  border-color: var(--hb-accent);
  box-shadow: 0 0 0 2px var(--hb-accent-soft), 0 0 0 3px var(--hb-accent);
}
#hose-builder .hb-card-img {
  height: 64px; display: flex; align-items: center; justify-content: center;
  background: var(--hb-ground); border-radius: 4px; overflow: hidden;
}
#hose-builder .hb-card-img img { max-height: 56px; width: auto; mix-blend-mode: multiply; }
#hose-builder .hb-card-img .hb-noimg { font-size: 11px; color: var(--hb-faint); }
#hose-builder .hb-card-sku { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--hb-heading); }
#hose-builder .hb-card-name { font-size: 13px; color: var(--hb-muted); line-height: 1.3; }
#hose-builder .hb-card-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 13px; }
#hose-builder .hb-card-price { font-weight: 700; }
#hose-builder .hb-card-price small { font-weight: 400; color: var(--hb-muted); }
#hose-builder .hb-stock { font-size: 11px; font-weight: 600; white-space: nowrap; }
#hose-builder .hb-stock.in { color: var(--hb-accent); }
#hose-builder .hb-stock.out { color: var(--hb-warn); }
#hose-builder .hb-card-check {
  position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--hb-accent); color: var(--hb-accent-ink); display: none; align-items: center; justify-content: center;
}
#hose-builder .hb-card[aria-pressed="true"] .hb-card-check { display: flex; }
#hose-builder .hb-card-check svg { width: 12px; height: 12px; }
#hose-builder .hb-empty { color: var(--hb-muted); font-size: 14px; padding: 8px 0; }

/* ---------- inputs ---------- */
#hose-builder .hb-inline { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-end; }
#hose-builder .hb-input-group { display: grid; gap: 6px; }
#hose-builder .hb-input-wrap { display: inline-flex; align-items: center; border: 1px solid var(--hb-rule-strong); border-radius: var(--hb-radius); overflow: hidden; background: var(--hb-surface); }
#hose-builder .hb-input-wrap:focus-within { border-color: var(--hb-accent); box-shadow: 0 0 0 2px var(--hb-accent-soft); }
#hose-builder .hb-input-wrap input:focus-visible, #hose-builder .hb-input-wrap input:focus { outline: none; }
#hose-builder .hb-input-wrap input {
  border: 0; font: inherit; font-size: 18px; padding: 8px 12px; width: 120px; min-width: 0; color: var(--hb-ink); background: transparent;
  -moz-appearance: textfield;
}
#hose-builder .hb-input-wrap input::-webkit-outer-spin-button, #hose-builder .hb-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#hose-builder .hb-input-wrap .hb-unit { padding: 0 12px 0 0; color: var(--hb-muted); font-size: 14px; }
#hose-builder .hb-input-wrap .hb-stepbtn { border: 0; background: var(--hb-ground); width: 40px; align-self: stretch; font-size: 18px; }
#hose-builder .hb-input-wrap .hb-stepbtn:hover { background: var(--hb-rule); }
#hose-builder .hb-input-wrap input.hb-qty { width: 56px; text-align: center; }
#hose-builder .hb-note { font-size: 13px; color: var(--hb-muted); }
#hose-builder .hb-note.warn { color: var(--hb-warn); }
#hose-builder .hb-link-btn { background: none; border: 0; padding: 0; color: var(--hb-accent); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- orientation ---------- */
#hose-builder .hb-orient-diagram { width: 100%; max-width: 340px; height: auto; display: block; }
#hose-builder .hb-orient { display: flex; gap: 8px; flex-wrap: wrap; }
#hose-builder .hb-orient .hb-chip { min-width: 58px; justify-content: center; }

/* ---------- summary ---------- */
#hose-builder .hb-summary {
  background: var(--hb-surface);
  border: 1px solid var(--hb-rule);
  border-radius: var(--hb-radius);
  padding: 18px 20px 20px;
  display: grid;
  gap: 14px;
}
#hose-builder .hb-summary h3 { margin: 0; font-size: 16px; font-weight: 700; font-family: var(--hb-heading-font); color: var(--hb-heading); }
#hose-builder .hb-diagram { width: 100%; height: auto; display: block; }
#hose-builder .hb-callout-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hb-faint); }
#hose-builder .hb-callout {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 14px; letter-spacing: .01em;
  background: var(--hb-ground); border-radius: 4px; padding: 8px 10px; word-break: break-all;
  min-height: 34px; color: var(--hb-ink);
}
#hose-builder .hb-callout.placeholder { color: var(--hb-faint); }
#hose-builder .hb-lines { display: grid; gap: 6px; font-size: 14px; }
#hose-builder .hb-line { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; }
#hose-builder .hb-line .hb-l { color: var(--hb-muted); }
#hose-builder .hb-line .hb-l b { color: var(--hb-ink); font-weight: 600; }
#hose-builder .hb-line .hb-v { font-variant-numeric: tabular-nums; white-space: nowrap; }
#hose-builder .hb-line.total { border-top: 1px solid var(--hb-rule); padding-top: 10px; margin-top: 4px; font-size: 17px; font-weight: 700; }
#hose-builder .hb-line.total .hb-l { color: var(--hb-ink); }
#hose-builder .hb-line.muted .hb-v, #hose-builder .hb-line.muted .hb-l { color: var(--hb-faint); }
#hose-builder .hb-cta {
  width: 100%; border: 0; border-radius: var(--hb-radius);
  background: var(--hb-accent); color: var(--hb-accent-ink);
  font-size: 16px; font-weight: 700; padding: 14px 16px; transition: filter .12s;
}
#hose-builder .hb-cta:hover:not(:disabled) { filter: brightness(.94); }
#hose-builder .hb-cta:disabled { background: var(--hb-rule); color: var(--hb-faint); cursor: not-allowed; }
#hose-builder .hb-missing { font-size: 13px; color: var(--hb-muted); }
#hose-builder .hb-alert { border-radius: 4px; padding: 10px 12px; font-size: 13px; line-height: 1.4; }
#hose-builder .hb-alert.warn { background: var(--hb-warn-soft); color: var(--hb-warn); }
#hose-builder .hb-alert.bad { background: var(--hb-bad-soft); color: var(--hb-bad); }
#hose-builder .hb-alert.ok { background: var(--hb-accent-soft); color: var(--hb-accent); }
#hose-builder .hb-alert a { color: inherit; font-weight: 700; }

/* preview of what would be sent to the cart */
#hose-builder .hb-preview-items { display: grid; gap: 4px; font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--hb-ground); padding: 10px; border-radius: 4px; }

/* ---------- mobile bottom bar ---------- */
#hose-builder .hb-mobile-bar { display: none; }
@media (max-width: 900px) {
  #hose-builder .hb-mobile-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--hb-surface); border-top: 1px solid var(--hb-rule);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); gap: 12px; align-items: center;
    box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  }
  #hose-builder .hb-mobile-bar .hb-mtotal { font-size: 18px; font-weight: 700; }
  #hose-builder .hb-mobile-bar .hb-msub { font-size: 12px; color: var(--hb-muted); }
  #hose-builder .hb-mobile-bar .hb-cta { width: auto; margin-left: auto; padding: 12px 18px; }
  #hose-builder .hb-layout { padding-bottom: 72px; }
}

/* ---------- page hero and help line (plain HTML around the builder; see theme-section.html) ---------- */
.hb-hero { margin: 0 0 32px; text-align: center; font-family: var(--text-font-family, inherit); }
.hb-hero-banner { display: block; width: 100%; height: auto; margin: 0 0 28px; }
.hb-hero h1 {
  font-family: var(--heading-font-family, inherit); color: #545454; text-transform: uppercase;
  font-size: 34px; font-weight: 700; letter-spacing: .01em; line-height: 1.15; margin: 0 0 22px;
}
.hb-hero h1 .accent { color: var(--primary-button-background, #3daa41); }
.hb-hero p { margin: 0 0 10px; font-size: 17px; line-height: 1.5; color: #545454; }
.hb-hero p .accent { color: var(--primary-button-background, #3daa41); font-weight: 700; }
.hb-help { margin: 48px 0 0; padding: 28px 20px; text-align: center; border-top: 1px solid rgba(82, 87, 91, .16); font-size: 17px; line-height: 1.5; color: #545454; font-family: var(--text-font-family, inherit); }
.hb-help b { font-weight: 700; }
.hb-help a { color: var(--primary-button-background, #3daa41); font-weight: 700; text-decoration: none; }
.hb-help a:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .hb-hero h1 { font-size: 24px; }
  .hb-hero p, .hb-help { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  #hose-builder * { transition: none !important; }
}
