/* Lightweight fallback for original calculator glass styling.
   Keep existing style.css if you already have custom calculator styles. */
.wp-3d-calc-wrapper{background:#0f172a;color:#e2e8f0;border-radius:18px;overflow:hidden;font-family:Inter,system-ui,sans-serif}
.wp-3d-calc-wrapper .glass-panel{background:#111b2b;}
.wp-3d-calc-wrapper .glass-card{background:#182437;}
.wp-3d-calc-wrapper button{cursor:pointer}
.wp-3d-calc-wrapper input,.wp-3d-calc-wrapper select,.wp-3d-calc-wrapper textarea{color-scheme:dark}
.wp-3d-calc-wrapper #canvas-container canvas{display:block;touch-action:none}
.wp-3d-calc-wrapper #viewport-tools button[aria-pressed="true"]{color:#38bdf8}
/* Widget-local typography and normalisation (does not reset your WP theme). */
.wp-3d-calc-wrapper,.wp-3d-calc-wrapper *,.wp-3d-calc-wrapper *::before,.wp-3d-calc-wrapper *::after{box-sizing:border-box}
.wp-3d-calc-wrapper{width:100%;line-height:1.5}
.wp-3d-calc-wrapper button,.wp-3d-calc-wrapper input,.wp-3d-calc-wrapper select,.wp-3d-calc-wrapper textarea{font:inherit}
.wp-3d-calc-wrapper button{border-style:solid}
.wp-3d-calc-wrapper button:disabled{cursor:not-allowed}
.wp-3d-calc-wrapper h2,.wp-3d-calc-wrapper h3,.wp-3d-calc-wrapper p{margin-top:0;margin-bottom:0}
.wp-3d-calc-wrapper .shimmer-bar{background:linear-gradient(100deg,#0284c7,#38bdf8,#0284c7);background-size:200% 100%;animation:bqr-shimmer 2.5s linear infinite}
@keyframes bqr-shimmer{to{background-position:-200% 0}}
.wp-3d-calc-wrapper .bqr-price-note{font-size:.7rem;line-height:1.45;color:#94a3b8}
.wp-3d-calc-wrapper{max-width:80rem;margin:.5rem auto;border:1px solid #1e293b}
@media(min-width:640px){.wp-3d-calc-wrapper{margin:1.5rem auto}}

/* Quote UX and feedback; must stay inside the widget scope for WP CSS isolation. */
.wp-3d-calc-wrapper [hidden]{display:none!important}
.wp-3d-calc-wrapper #modal-quote{isolation:isolate}
.wp-3d-calc-wrapper #modal-quote[aria-hidden="true"]{visibility:hidden}
.wp-3d-calc-wrapper #modal-quote[aria-hidden="false"]{visibility:visible}
.wp-3d-calc-wrapper #modal-quote .glass-panel{max-height:min(90vh,850px);overflow-y:auto}
.wp-3d-calc-wrapper .bqr-form-feedback:not(:empty){padding:.65rem .8rem;border-radius:.6rem;background:rgba(30,41,59,.9);border:1px solid #475569;color:#cbd5e1}
.wp-3d-calc-wrapper .bqr-form-feedback[data-type="error"]{background:rgba(127,29,29,.25);border-color:#f87171;color:#fecaca}
.wp-3d-calc-wrapper .bqr-minimum-note{font-size:.74rem;color:#fcd34d;margin-top:.55rem}
.wp-3d-calc-wrapper .bqr-pricing-feedback{font-size:.75rem;color:#fca5a5;margin-top:.55rem}
.wp-3d-calc-wrapper .bqr-order-confirmation{position:fixed;top:20px;right:20px;z-index:2147483000;display:flex;align-items:flex-start;gap:12px;width:min(390px,calc(100vw - 30px));padding:16px;background:#073529;border:1px solid #34d399;color:#ecfdf5;border-radius:14px;box-shadow:0 14px 40px rgba(0,0,0,.45);font-family:Inter,system-ui,sans-serif;line-height:1.45}
.wp-3d-calc-wrapper .bqr-order-confirmation-icon{display:grid;place-items:center;border-radius:100%;background:#047857;color:white;font-size:22px;font-weight:700;min-width:36px;height:36px}
.wp-3d-calc-wrapper .bqr-order-confirmation-body{display:flex;flex-direction:column;gap:3px;min-width:0;font-size:13px}
.wp-3d-calc-wrapper .bqr-order-confirmation-body strong{font-size:15px}
.wp-3d-calc-wrapper #bqr-dismiss-confirmation{margin-left:auto;background:transparent;border:0;color:#d1fae5;font-size:22px;line-height:1;padding:0 4px;cursor:pointer}
@media (max-width:520px){.wp-3d-calc-wrapper .bqr-order-confirmation{top:10px;left:15px;right:15px;width:auto}}

/* v0.5: layout controls remain isolated from the WordPress theme. */
.wp-3d-calc-wrapper .bqr-color-options {
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  min-width:0;
  max-width:100%;
  overflow:visible !important;
  scrollbar-width:none;
}
.wp-3d-calc-wrapper .bqr-color-options .swatch {
  display:inline-block !important;
  flex:0 0 30px !important;
  width:30px !important;
  min-width:30px !important;
  max-width:30px !important;
  height:30px !important;
  min-height:30px !important;
  max-height:30px !important;
  aspect-ratio:1/1;
  padding:0 !important;
  margin:0 !important;
  box-sizing:border-box !important;
  border-radius:50% !important;
  background-color:var(--bqr-swatch) !important;
  line-height:0;
  cursor:pointer;
}
/* Hide only the browser's numeric spinners; quantity +/- buttons stay visible. */
.wp-3d-calc-wrapper input[type="number"] {
  -moz-appearance:textfield;
  appearance:textfield;
}
.wp-3d-calc-wrapper input[type="number"]::-webkit-outer-spin-button,
.wp-3d-calc-wrapper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance:none;
  margin:0;
  display:none;
}
/* Use one consistent select arrow, padded away from the selected value. */
.wp-3d-calc-wrapper select.bqr-select {
  box-sizing:border-box !important;
  appearance:none !important;
  -webkit-appearance:none !important;
  -moz-appearance:none !important;
  text-align:left !important;
  text-align-last:left !important;
  padding-left:12px !important;
  padding-right:35px !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat:no-repeat !important;
  background-position:right 9px center !important;
  background-size:16px 16px !important;
}
.wp-3d-calc-wrapper #input-layer-num.bqr-select { width:116px !important; min-width:116px !important; }
.wp-3d-calc-wrapper #select-speed.bqr-select { width:100% !important; max-width:100%; min-width:0; }
.wp-3d-calc-wrapper .bqr-price-total {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px 16px;
}
.wp-3d-calc-wrapper .bqr-price-label {
  font-size:.78rem;
  text-transform:uppercase;
  font-weight:700;
  letter-spacing:.06em;
  color:#cbd5e1;
}
.wp-3d-calc-wrapper #total-price-display {white-space:nowrap;font-variant-numeric:tabular-nums}
.wp-3d-calc-wrapper .bqr-price-note {line-height:1.5; font-size:.76rem; color:#a5b4c7}
.wp-3d-calc-wrapper .bqr-minimum-note {margin:0; font-size:.78rem; font-weight:600; color:#fcd34d}

/* v0.7: readable, theme-proof single estimated price. */
.wp-3d-calc-wrapper #total-price-display {
  color:#38bdf8 !important;
  -webkit-text-fill-color:#38bdf8 !important;
  background:none !important;
  background-image:none !important;
  background-clip:border-box !important;
  -webkit-background-clip:border-box !important;
  text-shadow:none;
}

/* v0.8: force legible selected value despite WordPress theme select styles. */
.wp-3d-calc-wrapper select#input-layer-num.bqr-select {
  color: #38bdf8 !important;
  -webkit-text-fill-color: #38bdf8 !important;
  background-color: #0f172a !important;
  opacity: 1 !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  text-shadow: none !important;
}
.wp-3d-calc-wrapper select#input-layer-num.bqr-select option {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  background-color: #0f172a !important;
}

/* v1.0: high-contrast layer height and consistent viewport toggle states. */
.wp-3d-calc-wrapper select#input-layer-num.bqr-select,
.wp-3d-calc-wrapper select#input-layer-num.bqr-select option {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
.wp-3d-calc-wrapper .bqr-viewport-toggle {
  color: #cbd5e1 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  transition: background-color .15s, color .15s, border-color .15s;
}
.wp-3d-calc-wrapper .bqr-viewport-toggle:hover,
.wp-3d-calc-wrapper .bqr-viewport-toggle:focus-visible {
  color: #f8fafc !important;
  background-color: #334155 !important;
}
.wp-3d-calc-wrapper .bqr-viewport-toggle[aria-pressed="true"] {
  color: #38bdf8 !important;
  background: rgba(14,165,233,.2) !important;
  border-color: rgba(56,189,248,.32) !important;
}
.wp-3d-calc-wrapper .bqr-viewport-toggle[aria-pressed="true"]:hover {background: rgba(14,165,233,.32) !important;}

/* Support-icon blue theme also works with an older Custom HTML block. */
.wp-3d-calc-wrapper label[for="input-supports"] > div > div:first-child {
  background-color: rgba(14,165,233,.1) !important;
  color: #38bdf8 !important;
  border-color: rgba(14,165,233,.28) !important;
}

/* v1.1: compact grey filament info buttons, independent from material selection. */
.wp-3d-calc-wrapper #material-grid { overflow:visible !important; }
.wp-3d-calc-wrapper .bqr-filament-card { position:relative; min-width:0; }
.wp-3d-calc-wrapper .bqr-filament-card:hover,
.wp-3d-calc-wrapper .bqr-filament-card:focus-within,
.wp-3d-calc-wrapper .bqr-filament-card.bqr-tooltip-open { z-index:60; }
.wp-3d-calc-wrapper .bqr-filament-select {
  display:block; width:100%; min-height:48px;
  padding-right:36px !important; text-align:left;
}
.wp-3d-calc-wrapper .bqr-filament-select span { overflow-wrap:anywhere; }
.wp-3d-calc-wrapper .bqr-filament-info {
  position:absolute; right:8px; top:7px; z-index:3;
  display:flex; align-items:center; justify-content:center;
  height:20px; width:20px; min-height:20px; min-width:20px;
  padding:0 !important; margin:0 !important;
  border:1px solid #64748b !important; border-radius:50% !important;
  background:#475569 !important; color:#f8fafc !important;
  font-family:Inter,system-ui,sans-serif !important;
  font-size:12px !important; font-weight:800 !important; line-height:1 !important;
  cursor:help;
}
.wp-3d-calc-wrapper .bqr-filament-info:hover,
.wp-3d-calc-wrapper .bqr-filament-info:focus-visible,
.wp-3d-calc-wrapper .bqr-filament-info[aria-expanded="true"] {
  color:#fff !important; background:#64748b !important; border-color:#94a3b8 !important;
}
.wp-3d-calc-wrapper .bqr-filament-info:focus-visible { outline:2px solid #38bdf8; outline-offset:2px; }
.wp-3d-calc-wrapper .bqr-filament-tooltip {
  position:absolute; top:calc(100% + 8px); right:0; z-index:100;
  width:max-content; max-width:min(265px,calc(100vw - 48px));
  padding:10px 12px; border:1px solid #475569; border-radius:9px;
  background:#172337; color:#f1f5f9; box-shadow:0 12px 30px rgba(0,0,0,.42);
  font-size:12px; font-weight:400; line-height:1.5; white-space:pre-line;
  overflow-wrap:anywhere; text-align:left;
  visibility:hidden; opacity:0; pointer-events:none;
  transition:opacity .12s ease;
}
.wp-3d-calc-wrapper .bqr-filament-tooltip::before {
  content:""; position:absolute; top:-6px; right:12px;
  width:10px; height:10px; transform:rotate(45deg);
  background:#172337; border-left:1px solid #475569; border-top:1px solid #475569;
}
.wp-3d-calc-wrapper .bqr-filament-info:hover + .bqr-filament-tooltip,
.wp-3d-calc-wrapper .bqr-filament-info:focus-visible + .bqr-filament-tooltip,
.wp-3d-calc-wrapper .bqr-filament-card.bqr-tooltip-open .bqr-filament-tooltip {
  visibility:visible; opacity:1; pointer-events:none;
}
/* Keep tooltips inside the viewport on narrow screens and the first grid column. */
@media(max-width:639px) {
  .wp-3d-calc-wrapper .bqr-filament-card:nth-child(2n+1) .bqr-filament-tooltip { left:0; right:auto; }
  .wp-3d-calc-wrapper .bqr-filament-card:nth-child(2n+1) .bqr-filament-tooltip::before { left:30%; right:auto; }
}
@media(min-width:640px) {
  .wp-3d-calc-wrapper .bqr-filament-card:nth-child(3n+1) .bqr-filament-tooltip { left:0; right:auto; }
  .wp-3d-calc-wrapper .bqr-filament-card:nth-child(3n+1) .bqr-filament-tooltip::before { left:30%; right:auto; }
}


/* v1.1.1: submission dialog close control — aligned, visible, theme-independent.
   Works with the existing WordPress Custom HTML block; no markup changes. */
.wp-3d-calc-wrapper #modal-quote .glass-panel {
  position:relative;
}
.wp-3d-calc-wrapper #modal-quote #modal-close-btn {
  position:absolute !important;
  inset-block-start:14px !important;
  inset-inline-end:14px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex:0 0 auto !important;
  width:38px !important;
  height:38px !important;
  min-width:38px !important;
  min-height:38px !important;
  padding:0 !important;
  margin:0 !important;
  border:1px solid #475569 !important;
  border-radius:10px !important;
  background:#1e293b !important;
  color:#e2e8f0 !important;
  line-height:1 !important;
  box-shadow:none !important;
  text-decoration:none !important;
  outline-offset:3px;
  cursor:pointer !important;
  z-index:2;
  transition:background-color .15s ease,border-color .15s ease,color .15s ease !important;
}
/* Use CSS lines rather than relying on the theme's icon fonts or glyph sizing. */
.wp-3d-calc-wrapper #modal-quote #modal-close-btn > i {
  display:none !important;
}
.wp-3d-calc-wrapper #modal-quote #modal-close-btn::before,
.wp-3d-calc-wrapper #modal-quote #modal-close-btn::after {
  content:"";
  position:absolute;
  inset-block-start:calc(50% - 1px);
  inset-inline-start:calc(50% - 9px);
  width:18px;
  height:2px;
  border-radius:2px;
  background:currentColor;
  transform:rotate(45deg);
  pointer-events:none;
}
.wp-3d-calc-wrapper #modal-quote #modal-close-btn::after {
  transform:rotate(-45deg);
}
.wp-3d-calc-wrapper #modal-quote #modal-close-btn:hover {
  background:#263c52 !important;
  color:#ffffff !important;
  border-color:#38bdf8 !important;
}
.wp-3d-calc-wrapper #modal-quote #modal-close-btn:focus-visible {
  outline:2px solid #38bdf8 !important;
  outline-offset:3px !important;
}
.wp-3d-calc-wrapper #modal-quote #modal-close-btn:active {
  background:#0c4a6e !important;
}
/* Prevent the heading from sitting underneath the close button on mobile. */
.wp-3d-calc-wrapper #modal-quote #bqr-quote-title {
  padding-inline-end:42px;
  min-height:38px;
  align-items:center;
}
@media (max-width:480px) {
  .wp-3d-calc-wrapper #modal-quote #modal-close-btn {
    inset-block-start:12px !important;
    inset-inline-end:12px !important;
  }
}

/* v1.1.2: true optical centering for quantity −/+ controls.
   Draw matching symbols instead of relying on font baseline or theme button padding.
   Keeps the original accessible button text and JavaScript click handlers intact. */
.wp-3d-calc-wrapper #btn-qty-minus,
.wp-3d-calc-wrapper #btn-qty-plus {
  position:relative !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex:0 0 32px !important;
  width:32px !important;
  height:28px !important;
  min-width:32px !important;
  min-height:28px !important;
  padding:0 !important;
  margin:0 !important;
  font-size:0 !important;
  line-height:0 !important;
  text-align:center !important;
  vertical-align:middle !important;
  column-gap: 5px;
}
.wp-3d-calc-wrapper #btn-qty-minus::before,
.wp-3d-calc-wrapper #btn-qty-plus::before,
.wp-3d-calc-wrapper #btn-qty-plus::after {
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:12px;
  height:2px;
  border-radius:1px;
  background-color:#e2e8f0;
  transform:translate(-50%,-50%);
  pointer-events:none;
}
.wp-3d-calc-wrapper #btn-qty-plus::after {
  width:2px;
  height:12px;
}
