/* StroFIX glass calculator — product-page styles (Phase 3a).
 * Brand tokens from brand/README.md. Scoped to .sfg-root so it can't leak into the theme.
 * The last block hides the native Creative Elements buy widgets on our product pages only. */

.sfg-root {
  --sfg-teal: #00453D; --sfg-teal-h: #0a5348; --sfg-sage: #91A19C; --sfg-light: #C7CCC4;
  --sfg-ink: #21211A; --sfg-tint: #edf2f0; --sfg-border: #e3e7e4; --sfg-warn: #A3441F; --sfg-mut: #5c5c56;
  font-family: "Work Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--sfg-ink); max-width: 560px; margin: 0 0 8px;
}
.sfg-root * { box-sizing: border-box; }
.sfg-head { margin-bottom: 6px; }
.sfg-pname { font-size: 15px; font-weight: 600; }
.sfg-pref { font-size: 12px; color: var(--sfg-mut); letter-spacing: .2px; }
.sfg-root { text-align: left; }
.sfg-root .sfg-f, .sfg-root label, .sfg-root .sfg-seglab { text-align: left; }
.sfg-root .sfg-f { display: block; font-size: 12px; color: var(--sfg-mut); margin: 10px 0 3px; }
/* We supply our own -/+ and up/down controls (see attachStepper), so the browser's native spinners are
   switched off: the theme strips or restyles them inconsistently, and they never matched the rest of
   the shop. Ours are real buttons that fire input/change, so validation and re-pricing behave the same. */
.sfg-root input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.sfg-root input[type=number]::-webkit-inner-spin-button,
.sfg-root input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.sfg-step { display: flex; align-items: stretch; gap: 6px; }
.sfg-step > input { flex: 1 1 auto; min-width: 0; }
.sfg-stepbtn {
  flex: 0 0 auto; width: 38px; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: var(--sfg-ink, #21211A);
  border: 1px solid var(--sfg-border, #e3e7e4); border-radius: 2px;
  line-height: 0; transition: background .12s, border-color .12s;
}
.sfg-stepbtn svg { width: 14px; height: 14px; display: block; }
.sfg-stepbtn:hover { background: var(--sfg-tint, #edf2f0); border-color: var(--sfg-teal, #00453D); }
.sfg-stepbtn:active { background: var(--sfg-tint, #edf2f0); }
/* the quantity row keeps the theme's - value + shape */
.sfg-step-pm { max-width: 190px; }
.sfg-step-pm > input { text-align: center; }
/* dimension fields get a compact up/down pair on the right */
.sfg-step-ud { position: relative; }
.sfg-step-ud > input { padding-right: 30px; }
.sfg-stepcol {
  position: absolute; top: 1px; right: 1px; bottom: 1px; width: 26px;
  display: flex; flex-direction: column;
}
.sfg-stepbtn-sm { width: 26px; height: 50%; border: none; border-left: 1px solid var(--sfg-border, #e3e7e4); border-radius: 0; }
.sfg-stepbtn-sm svg { width: 11px; height: 11px; }
.sfg-stepbtn-sm:first-child { border-bottom: 1px solid var(--sfg-border, #e3e7e4); }
.sfg-root select, .sfg-root input[type=number], .sfg-root input[type=text] {
  font: inherit; font-size: 13.5px; padding: 6px 8px; border: 1px solid var(--sfg-border);
  border-radius: 6px; width: 100%; background: #fff; color: var(--sfg-ink); height: auto;
}
.sfg-root input[readonly] { background: var(--sfg-tint); }
.sfg-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sfg-row2 > div { display: flex; flex-direction: column; }
.sfg-segbox { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sfg-segbox > div { flex: 1 1 60px; }
.sfg-segbox .sfg-seglab { font-size: 11px; color: var(--sfg-mut); text-align: center; margin-bottom: 2px; display: block; }
#sfg_segLab { margin: 14px 0 2px; }
.sfg-err { color: var(--sfg-warn); font-size: 12.5px; margin-top: 8px; font-weight: 500; }
.sfg-root input.bad { border-color: var(--sfg-warn) !important; }
.sfg-hint { font-size: 12px; color: var(--sfg-mut); margin-top: 8px; line-height: 1.45; }
.sfg-muted { color: var(--sfg-mut); font-weight: 400; }
.sfg-chk { display: flex; gap: 7px; align-items: center; font-size: 13.5px; margin-top: 12px; }
.sfg-chk input { width: auto; }
.sfg-info {
  display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px;
  border-radius: 50%; background: var(--sfg-sage); color: #fff; font-size: 10px; font-weight: 600;
  margin-left: 5px; cursor: help; position: relative; vertical-align: -2px;
}
.sfg-info::after {
  content: attr(data-tip); position: absolute; left: 50%; transform: translateX(-50%); bottom: 22px;
  z-index: 20; background: var(--sfg-ink); color: #fff; font-weight: 400; font-size: 12px; line-height: 1.5;
  padding: 8px 11px; border-radius: 6px; width: 240px; text-align: left; opacity: 0; pointer-events: none; transition: opacity .12s;
}
.sfg-info:hover::after, .sfg-info:focus::after { opacity: 1; }
.sfg-left { max-width: 560px; margin: 0 auto; width: 100%; }
.sfg-root svg text { font-family: "Work Sans", Arial, sans-serif; }
/* Balance the two columns: let the image column fill the row height and vertically centre the
   drawing + spec, so the shorter left side doesn't sit top-stuck against the taller form column. */
body.strofix-glass-calc .elementor-widget-product-images,
body.strofix-glass-calc .elementor-widget-product-images > .elementor-widget-container {
  height: 100%; display: flex; flex-direction: column; justify-content: flex-start;
}
/* Keep the native gallery hidden even if CE / Swiper re-renders it and injects fresh slide nodes: hide
   every direct child of the image host EXCEPT our drawing (#sfg-left). CSS survives a re-render, unlike a
   one-time inline display:none from the JS mount. */
body.strofix-glass-calc .elementor-widget-product-images > .elementor-widget-container > *:not(#sfg-left) {
  display: none !important;
}
/* spec text on the left, the tinted pane thumbnail on the right (like the MVP) */
.sfg-spec-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.sfg-spec-row .sfg-spec { flex: 1 1 200px; }
.sfg-pane { flex: 0 0 auto; width: 175px; max-width: 45%; display: block; }
.sfg-spec-card, .sfg-price-card { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--sfg-border); }
.sfg-left .sfg-spec-card { margin-top: 6px; }
.sfg-speclab { font-size: 11px; color: var(--sfg-mut); letter-spacing: .4px; margin-bottom: 10px; }
.sfg-spec { display: grid; grid-template-columns: max-content 1fr; gap: 5px 24px; font-size: 13px; line-height: 1.5; }
.sfg-spec .sfg-sl { color: var(--sfg-mut); }
.sfg-spec .sfg-sv { font-weight: 500; }
.sfg-bd { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0 10px; }
.sfg-bd td, .sfg-bd th { padding: 3.5px 0; }
.sfg-bd .sfg-hd th { color: var(--sfg-mut); font-size: 11.5px; border-bottom: 1px solid var(--sfg-border); font-weight: 400; text-align: left; }
.sfg-bd .sfg-hd th + th { padding-left: 14px; text-align: right; white-space: nowrap; }
.sfg-bd td { border-bottom: 1px dashed #e4e4df; }
.sfg-bd td:nth-child(2), .sfg-bd td:nth-child(3), .sfg-bd td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sfg-bd td + td { padding-left: 14px; }
.sfg-bd .sfg-nb { border-bottom: none; }
.sfg-bd .sfg-r { text-align: right; }
.sfg-bd tr.sfg-tot td { border-bottom: none; font-weight: 600; padding-top: 7px; }
.sfg-sku { font-size: 11px; color: var(--sfg-mut); letter-spacing: .2px; }
.sfg-qtyrow { display: flex; align-items: center; gap: 12px; margin: 10px 0 2px; }
.sfg-qtyrow .sfg-f { margin: 0; white-space: nowrap; }
.sfg-root #sfg_qty { width: auto; }
.sfg-root .sfg-cart {
  font: inherit; font-size: 14.5px; font-weight: 600; width: 100%; margin-top: 6px; padding: 11px;
  background: var(--sfg-teal); color: #fff; border: none; border-radius: 8px; cursor: pointer;
}
.sfg-root .sfg-cart:disabled { background: var(--sfg-sage); cursor: default; }
.sfg-root .sfg-cart:hover:not(:disabled) { background: var(--sfg-teal-h); }

/* Hide the native CE buy widgets on our glass product pages only. */
body.strofix-glass-calc .elementor-widget-product-price,
body.strofix-glass-calc .elementor-widget-product-variants,
body.strofix-glass-calc .elementor-widget-product-quantity,
body.strofix-glass-calc .elementor-widget-product-stock,
body.strofix-glass-calc .elementor-widget-product-add-to-cart,
body.strofix-glass-calc .elementor-widget-product-customization { display: none !important; }
