/* Quote configurator — layers on top of style.css and reuses its tokens.
   Mobile first: buyers open this on a phone in a yard, so controls are
   thumb-sized and the request basket collapses to a sticky bottom bar. */

.cfg-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

/* ------------------------------------------------------------- breadcrumb */
.cfg-breadcrumb {
  display: flex;
  align-items: center;
  gap: .9rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.cfg-back {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 600 .88rem/1 var(--font-body);
  padding: .6rem .95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.cfg-back:hover { border-color: var(--accent); background: var(--accent-soft); }
.cfg-back svg { width: 16px; height: 16px; }
.cfg-trail { color: var(--ink-faint); font-size: .88rem; }
.cfg-trail .cfg-sep { margin: 0 .45rem; }

/* ------------------------------------------------------------- step heads */
.cfg-step-head { margin-bottom: 1.6rem; }
.cfg-step-head h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 .4rem;
  outline: none;
}
.cfg-step-head h2:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.cfg-step-head p { color: var(--ink-soft); margin: 0; max-width: 60ch; }
.cfg-order-note {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: .45rem .8rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  margin-top: .6rem !important;
}

/* --------------------------------------------------------- category cards */
.cfg-group { margin-bottom: 2.6rem; }
.cfg-group-title {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 1rem;
}
.cfg-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.cfg-cat {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cfg-cat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.cfg-cat:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cfg-cat-media {
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  overflow: hidden;
  position: relative;
}
.cfg-cat-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Placeholder when a category has no photo — the tool stays fully usable. */
.cfg-cat-media.is-placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, var(--bg-alt) 0%, var(--cream) 100%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.cfg-cat-body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; gap: .2rem; }
.cfg-cat-name { font-weight: 650; font-size: .95rem; line-height: 1.25; }
.cfg-cat-count { color: var(--ink-faint); font-size: .8rem; }

/* -------------------------------------------------------------- facet bar */
.cfg-filters {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  margin-bottom: 1.3rem;
}
.cfg-facet { display: flex; flex-direction: column; gap: .55rem; }
.cfg-facet-label {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.cfg-facet-opts { display: flex; flex-wrap: wrap; gap: .5rem; }
.cfg-opt {
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 600 .88rem/1 var(--font-body);
  padding: .62rem .9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all .16s ease;
  min-height: 40px;
}
.cfg-opt:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-deep); }
.cfg-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cfg-opt.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cfg-opt:disabled { opacity: .32; cursor: not-allowed; }

.cfg-resultbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .9rem;
  flex-wrap: wrap;
}
.cfg-count { margin: 0; font-weight: 650; color: var(--ink); }
.cfg-clear {
  border: none;
  background: none;
  color: var(--accent-deep);
  font: 600 .86rem/1 var(--font-body);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: .4rem;
}

.cfg-search { margin-bottom: .9rem; }
.cfg-search-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  font: 400 1rem/1.4 var(--font-body);
  background: var(--surface);
  color: var(--ink);
}
.cfg-search-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* ----------------------------------------------------------- product list */
.cfg-products { display: flex; flex-direction: column; gap: .55rem; }
.cfg-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .95rem 1.1rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
  min-height: 56px;
}
.cfg-product:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateX(2px); }
.cfg-product:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cfg-product-main { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.cfg-product-name { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.cfg-product-meta { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.cfg-product-units { color: var(--ink-faint); font-size: .8rem; }
.cfg-badge {
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .22rem .5rem;
  border-radius: 5px;
}
.cfg-product-go { width: 18px; height: 18px; color: var(--ink-faint); flex: none; }

.cfg-empty {
  text-align: center;
  padding: 2.6rem 1.2rem;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.cfg-empty p { margin: 0; color: var(--ink-soft); }

/* ------------------------------------------------------- quantity + specs */
.cfg-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .8rem;
  margin: 0 0 1.5rem;
  padding: 1.1rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
}
.cfg-spec { display: flex; flex-direction: column; gap: .15rem; }
.cfg-spec dt {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.cfg-spec dd { margin: 0; font-weight: 600; font-size: .95rem; }

.cfg-qty {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.cfg-qty-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cfg-field { display: flex; flex-direction: column; gap: .4rem; }
.cfg-field label {
  font-size: .8rem;
  font-weight: 650;
  color: var(--ink-soft);
}
.cfg-field input,
.cfg-field select {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: .78rem .9rem;
  font: 400 1rem/1.3 var(--font-body);
  background: var(--surface);
  color: var(--ink);
  min-height: 48px;
  width: 100%;
}
.cfg-field input:focus,
.cfg-field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.cfg-hint { font-size: .78rem; color: var(--ink-faint); }
.cfg-error {
  margin: 0;
  color: #9d2f18;
  background: #fdeceb;
  border: 1px solid #f5c6c0;
  border-radius: var(--radius);
  padding: .7rem .9rem;
  font-size: .88rem;
  font-weight: 600;
}
.cfg-add { justify-content: center; min-height: 50px; }

/* -------------------------------------------------------- request basket */
.cfg-request {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
}
.cfg-req-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.cfg-req-head h2 { font-size: 1.1rem; margin: 0; }
.cfg-req-count {
  background: var(--accent);
  color: #fff;
  font: 700 .78rem/1 var(--font-body);
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 .4rem;
}
.cfg-req-empty { color: var(--ink-faint); font-size: .9rem; margin: 0; }
.cfg-req-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.cfg-req-item {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .7rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
}
.cfg-req-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.cfg-req-name { font-weight: 600; font-size: .86rem; line-height: 1.3; }
.cfg-req-qty { font-size: .82rem; color: var(--accent-deep); font-weight: 650; }
.cfg-req-note { font-size: .78rem; color: var(--ink-faint); font-style: italic; }
.cfg-req-del {
  border: none;
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  padding: .3rem;
  border-radius: 6px;
  flex: none;
  min-width: 32px;
  min-height: 32px;
}
.cfg-req-del:hover { color: #9d2f18; background: #fdeceb; }
.cfg-req-del svg { width: 16px; height: 16px; }
.cfg-req-go { width: 100%; justify-content: center; }

/* Sticky mobile summary bar */
.cfg-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: var(--dark);
  color: #fff;
  padding: .85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 -4px 20px rgba(33, 27, 19, .18);
}
.cfg-bar-label { font-weight: 650; font-size: .92rem; }
.cfg-bar .btn { padding: .6rem 1.1rem; font-size: .88rem; }

.cfg-loading { text-align: center; padding: 3rem 1rem; color: var(--ink-faint); }
.cfg-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 560px) {
  .cfg-cat-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: .7rem; }
  .cfg-filters { padding: 1rem; }
  .cfg-qty-row { grid-template-columns: 1fr; }
  .cfg-qty { padding: 1.1rem; }
}

/* From tablet up the basket becomes a sticky sidebar and the bar disappears */
@media (min-width: 900px) {
  .cfg-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 2.4rem; }
  .cfg-request { position: sticky; top: calc(var(--header-h) + 1.4rem); }
  .cfg-bar { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .cfg-cat, .cfg-product, .cfg-opt { transition: none; }
  .cfg-cat:hover, .cfg-product:hover { transform: none; }
}

/* ------------------------------------------------- review and submit page */
.rq-layout { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: start; }
.rq-h2 { font-size: 1.35rem; margin: 0 0 1rem; }

.rq-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: .7rem;
}
.rq-line-main { flex: 1 1 240px; min-width: 0; }
.rq-line-name { margin: 0 0 .3rem; font-weight: 650; font-size: .96rem; line-height: 1.35; }
.rq-line-meta {
  margin: 0; display: flex; gap: .55rem; align-items: center; flex-wrap: wrap;
  font-size: .82rem; color: var(--ink-faint);
}
.rq-line-note { margin: .35rem 0 0; font-size: .82rem; color: var(--ink-faint); font-style: italic; }
.rq-line-controls { display: flex; align-items: center; gap: .5rem; }
.rq-qty {
  width: 92px; min-height: 44px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: .55rem .7rem; font: 600 .95rem/1 var(--font-body);
  background: var(--surface); color: var(--ink); text-align: right;
}
.rq-unit {
  min-height: 44px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: .55rem .6rem; font: 500 .9rem/1 var(--font-body);
  background: var(--surface); color: var(--ink);
}
.rq-qty:focus, .rq-unit:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.rq-del {
  border: none; background: none; color: var(--ink-faint);
  cursor: pointer; padding: .4rem; border-radius: 6px; min-width: 40px; min-height: 40px;
}
.rq-del:hover { color: #9d2f18; background: #fdeceb; }
.rq-del svg { width: 17px; height: 17px; }

.rq-form { display: flex; flex-direction: column; gap: 1.1rem; }
.rq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.rq-form textarea {
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: .8rem .9rem; font: 400 1rem/1.5 var(--font-body);
  background: var(--surface); color: var(--ink); resize: vertical; width: 100%;
}
.rq-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.rq-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rq-consent { display: flex; gap: .65rem; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.rq-consent input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.rq-send { justify-content: center; min-height: 52px; font-size: 1rem; }
.rq-fineprint { margin: 0; font-size: .82rem; color: var(--ink-faint); line-height: 1.6; }

.rq-totals { margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.rq-total { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.rq-total dt { font-size: .86rem; color: var(--ink-soft); }
.rq-total dd { margin: 0; font-weight: 700; font-size: .95rem; }
.rq-addmore { width: 100%; justify-content: center; margin-top: 1rem; }

.rq-success {
  max-width: 560px; margin: 0 auto; text-align: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 3rem 1.8rem;
  display: flex; flex-direction: column; align-items: center; gap: .9rem;
}
.rq-tick { width: 56px; height: 56px; color: #2e7d4f; }
.rq-success h2 { margin: 0; font-size: 1.6rem; }
.rq-ref {
  margin: 0; font: 700 1.5rem/1 var(--font-body);
  color: var(--accent-deep); letter-spacing: .04em;
  background: var(--accent-soft); padding: .6rem 1.1rem; border-radius: var(--radius);
}
.rq-success p { margin: 0; color: var(--ink-soft); line-height: 1.6; }

@media (max-width: 560px) {
  .rq-grid { grid-template-columns: 1fr; }
  .rq-line { padding: .9rem; }
  .rq-line-controls { width: 100%; justify-content: space-between; }
}
@media (min-width: 900px) {
  .rq-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 2.4rem; }
  #rq-summary { position: sticky; top: calc(var(--header-h) + 1.4rem); }
}
