/* Stack Industrial quote widget — storefront styles.
   Scoped to .sq-* so it cannot affect any existing theme rule.
   Stack palette: yellow #ffd438 with Stack Black text, dark #272424,
   off-white #fafafa, restrained neutral greys. */

.sq-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0 1.75rem;
  border-radius: 999px;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  cursor: pointer;
  /* No dark outline on the yellow primary triggers; the border is kept only
     to hold the button's exact dimensions. */
  border: 1.5px solid transparent;
  background: #ffd438;
  color: #272424;
  text-decoration: none;
}
.sq-trigger:hover { background: #f0c62b; }
.sq-trigger-quiet { background: #fafafa; border-color: #272424; }
.sq-trigger-quiet:hover { background: #f0f0ef; }
.sq-trigger-block { width: 100%; margin-top: 0.875rem; }
.sq-trigger[hidden], .sq-dock[hidden], [data-stack-quote-open][hidden] { display: none !important; }

/* Site-wide launcher: a deliberate fixed dock, clear of the theme's own
   floating elements, on every template. */
.sq-dock {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 2147483000;
}
.sq-dock .sq-trigger {
  box-shadow: 0 8px 24px rgba(39, 36, 36, 0.22);
  border: 1px solid rgba(39, 36, 36, 0.12);
}
@media (max-width: 600px) {
  .sq-dock { right: 0.75rem; bottom: 0.75rem; }
}

html.sq-locked { overflow: hidden; }

.sq-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(39, 36, 36, 0.55);
}
.sq-overlay.is-open { display: flex; }

.sq-dialog {
  width: 100%;
  max-width: 760px;
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  background: #fafafa;
  color: #272424;
  border: 1px solid #e4e2e0;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 48px rgba(39, 36, 36, 0.18);
  font-family: Inter, inherit;
  font-size: 18px;
  line-height: 1.35;
}
@media (min-width: 640px) {
  .sq-overlay { align-items: center; padding: 1.5rem; }
  .sq-dialog { border-radius: 18px; }
}

.sq-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.5rem 0;
  border-bottom: 1px solid #e4e2e0;
  background: #fff;
  border-radius: 18px 18px 0 0;
}
.sq-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; width: 100%; }
.sq-step { position: relative; min-width: 0; padding: 0 0 0.875rem; font-size: 0.75rem; font-weight: 600; line-height: 1.2; color: #8a8582; }
.sq-step::after { position: absolute; right: 0; bottom: 0; left: 0; height: 4px; border-radius: 999px; background: #e4e2e0; content: ""; }
.sq-step.is-done { color: #272424; }
.sq-step.is-done::after { background: #272424; }
.sq-step.is-current { color: #272424; font-weight: 700; }
.sq-step.is-current::after { background: #ffd438; }
.sq-dialog.is-complete .sq-step::after { background: #ffd438; }
.sq-close {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid #e4e2e0;
  border-radius: 999px;
  background: #fafafa;
  color: #272424;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 3px;
}
.sq-close:hover { border-color: #272424; }

.sq-body { overflow-y: auto; padding: 1.5rem; }
.sq-pane { display: flex; flex-direction: column; gap: 1.25rem; }
.sq-title { margin: 0; font-size: clamp(1.35rem, 4vw, 1.75rem); font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.sq-note { margin: 0; font-size: 1rem; line-height: 1.5; color: #5d5856; }
.sq-empty {
  margin: 0;
  padding: 1rem;
  border: 1px dashed #d6d3d1;
  border-radius: 10px;
  font-size: 1rem;
  color: #5d5856;
  background: #fff;
}
.sq-notice {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid #ffd438;
  border-left: 4px solid #ffd438;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #272424;
  background: #fffdf2;
}

.sq-lines { display: flex; flex-direction: column; gap: 0.75rem; }
.sq-line {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  grid-template-areas: "thumb main qty" ". remove remove";
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.875rem;
  background: #fafafa;
  border: 1px solid #e4e2e0;
  border-radius: 12px;
}
@media (min-width: 560px) {
  .sq-line { grid-template-columns: 72px minmax(0, 1fr) auto auto; grid-template-areas: "thumb main qty remove"; }
}
.sq-thumb { grid-area: thumb; width: 68px; height: 68px; object-fit: contain; background: #fff; border: 1px solid #e4e2e0; border-radius: 8px; }
@media (min-width: 560px) { .sq-thumb { width: 72px; height: 72px; } }
.sq-line-main { grid-area: main; min-width: 0; }
.sq-line-title { font-size: 1rem; font-weight: 700; line-height: 1.25; }
.sq-line-sku { margin-top: 0.2rem; font-size: 0.8rem; line-height: 1.3; color: #6b6664; }
.sq-qty { grid-area: qty; display: flex; align-items: center; gap: 0.25rem; }
.sq-qty-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #d6d3d1;
  background: #fafafa;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.sq-qty-input {
  width: 52px;
  height: 32px;
  text-align: center;
  border: 1px solid #d6d3d1;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9375rem;
  background: #fff;
  color: inherit;
}
.sq-remove {
  grid-area: remove;
  justify-self: start;
  border: 0;
  background: transparent;
  color: #8a1c1c;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.sq-search { display: flex; flex-direction: column; gap: 0.5rem; }
.sq-results { display: flex; flex-direction: column; gap: 0.25rem; max-height: 200px; overflow-y: auto; }
.sq-result {
  text-align: left;
  padding: 0.75rem 0.875rem;
  border: 1px solid #e4e2e0;
  border-radius: 10px;
  background: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}
.sq-result:hover { border-color: #272424; }

.sq-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 560px) { .sq-grid { grid-template-columns: 1fr 1fr; } }
.sq-field { display: flex; flex-direction: column; gap: 0.25rem; }
.sq-field-wide { grid-column: 1 / -1; }
.sq-label { font-size: 0.875rem; font-weight: 600; line-height: 1.3; }
.sq-input {
  width: 100%;
  min-height: 52px;
  padding: 0.7rem 0.875rem;
  border: 1px solid #d6d3d1;
  border-radius: 10px;
  background: #fff;
  color: #272424;
  font: inherit;
  font-size: 1rem;
  box-sizing: border-box;
}
.sq-input:focus { outline: 3px solid #ffd438; outline-offset: 2px; border-color: #272424; }
.sq-input.has-error { border-color: #8a1c1c; }
.sq-textarea { min-height: 84px; resize: vertical; }
.sq-error { font-size: 0.8125rem; font-weight: 600; color: #8a1c1c; }

.sq-section-title { margin: 0.25rem 0 -0.5rem; font-size: 0.95rem; font-weight: 700; line-height: 1.2; }
.sq-review-lines { display: flex; flex-direction: column; gap: 0.625rem; }
.sq-review-line { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.75rem; border: 1px solid #e4e2e0; border-radius: 10px; background: #fafafa; }
.sq-review-thumb { width: 58px; height: 58px; object-fit: contain; border: 1px solid #e4e2e0; border-radius: 7px; background: #fff; }
.sq-review-main { min-width: 0; }
.sq-review-title { font-size: 0.95rem; font-weight: 700; line-height: 1.25; }
.sq-review-qty { white-space: nowrap; font-size: 0.85rem; font-weight: 700; }
.sq-recap {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: #fafafa;
  border: 1px solid #e4e2e0;
  border-radius: 10px;
  font-size: 0.95rem;
  overflow: hidden;
}
.sq-recap-row { display: grid; grid-template-columns: minmax(90px, 0.35fr) minmax(0, 1fr); gap: 0.75rem; padding: 0.75rem 0.875rem; border-bottom: 1px solid #e4e2e0; overflow-wrap: anywhere; }
.sq-recap-row:last-child { border-bottom: 0; }
.sq-recap-label { color: #6b6664; font-weight: 600; }

.sq-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; justify-content: flex-end; padding-top: 0.5rem; }
.sq-btn {
  min-height: 52px;
  padding: 0 1.75rem;
  border-radius: 999px;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  border: 2px solid transparent;
}
.sq-btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.sq-btn-primary { background: #ffd438; border-color: #ffd438; color: #272424; box-shadow: none; }
.sq-btn-primary:hover:not([disabled]) { background: #f0c62b; }
.sq-btn-quiet { background: transparent; border-color: #d6d3d1; color: #272424; }
.sq-btn-quiet:hover { border-color: #272424; }
.sq-trigger:focus-visible, .sq-btn:focus-visible, .sq-close:focus-visible, .sq-qty-btn:focus-visible {
  outline: 3px solid #ffd438;
  outline-offset: 2px;
}
.sq-pane-done { align-items: center; padding: 1rem 0; text-align: center; }
.sq-complete-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 999px; background: #ffd438; color: #272424; font-size: 2rem; font-weight: 700; }
.sq-reference { margin: 0; padding: 0.55rem 0.9rem; border-radius: 999px; background: #fafafa; font-size: 0.9rem; font-weight: 700; }

.sq-note-warn { color: #8a2b2b; font-weight: 600; }
.sq-retry { margin-top: 0.5rem; align-self: flex-start; }

@media (max-width: 559px) {
  .sq-head { padding: 1.125rem 1rem 0; }
  .sq-body { padding: 1.125rem 1rem 1.25rem; }
  .sq-step { font-size: 0.68rem; }
  .sq-line { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "thumb main" "qty qty" "remove remove"; }
  .sq-thumb { width: 64px; height: 64px; }
  .sq-qty { justify-self: start; }
  .sq-actions { flex-direction: column-reverse; }
  .sq-btn { width: 100%; }
  .sq-retry { width: auto; }
  .sq-review-line { grid-template-columns: 52px minmax(0, 1fr); }
  .sq-review-thumb { width: 52px; height: 52px; }
  .sq-review-qty { grid-column: 2; }
  .sq-recap-row { grid-template-columns: 1fr; gap: 0.2rem; }
}
