/* The page sits inside the website's layout (header and footer): every rule stays inside .vh-configurator.
   :where() keeps the element rules as weak as before, so classes still override them. */
.vh-configurator {
  font-family: Arial, Helvetica, sans-serif;
  color: #262824;
  background: #f7f5f0;
  font-synthesis: none;
  --accent: #784633;
  --line: #e4e0d7;
  --muted: #85867d;
}

:where(.vh-configurator) * {
  box-sizing: border-box;
}

:where(.vh-configurator) button,
:where(.vh-configurator) input {
  font: inherit;
}

:where(.vh-configurator) button {
  cursor: pointer;
}

:where(.vh-configurator) button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

:where(.vh-configurator) :is(button, a, input, textarea):focus-visible {
  outline: 3px solid #b68263;
  outline-offset: 3px;
}

:where(.vh-configurator) button,
:where(.vh-configurator) a {
  color: inherit;
}

.vh-page {
  max-width: 1540px;
  padding: 42px 4.8% 25px;
  margin: auto;
}

.dev-notice {
  font-size: 12px;
  line-height: 1.6;
  color: #5c4a3f;
  background: #f1e7df;
  border: 1px solid #e2cfc1;
  border-radius: 6px;
  padding: 9px 14px;
  margin: 0 0 26px;
}

.dev-notice strong {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 8px;
}

.intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 30px;
  gap: 20px;
}

.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.1px;
  color: var(--accent);
  margin: 0 0 13px;
}

:where(.vh-configurator) h1 {
  font-size: clamp(30px, 3vw, 45px);
  letter-spacing: -1.7px;
  line-height: 1.15;
  margin: 0;
  font-weight: 500;
}

:where(.vh-configurator) h1 em {
  font-style: normal;
  color: #8c8d80;
}

.intro-copy {
  font-size: 12px;
  line-height: 1.8;
  color: #85867a;
  margin: 0 0 2px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(0, 1.3fr);
  gap: 24px;
  align-items: stretch;
}

.configurator {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-height: 650px;
  overflow: hidden;
}

.steps {
  display: flex;
  border-bottom: 1px solid var(--line);
  padding: 20px 18px;
  gap: 4px;
}

.steps button {
  flex: 1;
  border: 0;
  background: none;
  padding: 0;
  font-size: 9px;
  color: #999b8f;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.steps .step-circle {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid #e0e0d7;
  border-radius: 50%;
  font-size: 10px;
  background: #fffdf8;
}

.steps button.active {
  color: var(--accent);
  font-weight: 700;
}

.steps button.active .step-circle {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.steps button.complete .step-circle {
  background: #eeebe2;
  border-color: #eeebe2;
  color: #64695b;
}

.form-body {
  padding: 27px 29px 20px;
  flex: 1;
}

.step-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.4px;
}

.autosave {
  color: #929589;
  text-transform: none;
  letter-spacing: 0;
  font-size: 9px;
}

:where(.vh-configurator) h2 {
  font-weight: 500;
  font-size: 25px;
  letter-spacing: -0.6px;
  margin: 15px 0 8px;
}

/* Focused by the script on a step change, for screen readers; not a control, so no focus ring. */
#step-title:focus {
  outline: none;
}

.step-description {
  font-size: 12px;
  color: #8b8d82;
  line-height: 1.65;
  margin: 0 0 24px;
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  margin: 21px 0 10px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.option-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option-grid.designs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice {
  border: 1px solid #e2e0d6;
  border-radius: 6px;
  background: #fffdf8;
  min-height: 90px;
  padding: 14px 8px 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 11px;
  transition:
    border 0.2s,
    background 0.2s;
}

.choice:hover {
  border-color: #9c9482;
}

.choice.selected {
  border-color: var(--accent);
  background: #f8f1e9;
  box-shadow: inset 0 0 0 0.4px var(--accent);
}

.choice.selected:after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 10px;
  color: var(--accent);
}

.choice svg {
  height: 49px;
  width: 62px;
  overflow: visible;
  stroke: #565b50;
  fill: none;
  stroke-width: 2;
}

.choice.selected svg {
  stroke: var(--accent);
}

.choice small {
  font-size: 9px;
  color: #979a8d;
}

.three .choice {
  font-size: 10px;
}

.mechanisms .choice {
  min-height: 115px;
}

.helper {
  font-size: 10px;
  color: #919588;
  line-height: 1.7;
  margin: 12px 0 0;
}

.direction-buttons {
  display: flex;
  gap: 8px;
}

.direction-buttons .choice {
  flex: 1;
  min-height: 40px;
  padding: 12px;
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 29px;
  border-top: 1px solid var(--line);
  gap: 10px;
}

.button {
  border: 0;
  border-radius: 5px;
  padding: 13px 18px;
  font-size: 11px;
  font-weight: bold;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
}

.primary {
  background: var(--accent);
  color: white;
  min-width: 130px;
}

.primary:hover {
  background: #663a2b;
}

.text-button {
  background: none;
  padding-left: 0;
  color: #82867a;
  font-weight: normal;
}

.viewer-card {
  background: #eae9e1;
  border: 1px solid #dfded4;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.viewer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  gap: 12px;
  font-size: 10px;
  color: #69705e;
}

.viewer-heading > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 5px;
  height: 5px;
  background: #7a8a62;
  border-radius: 50%;
}

.small-button {
  border: 1px solid #d2d3c7;
  background: #efeee6;
  font-size: 9px;
  border-radius: 4px;
  padding: 7px 10px;
  color: #737a68;
  white-space: nowrap;
}

.small-button svg {
  vertical-align: -2px;
  margin-right: 2px;
}

.small-button[aria-pressed='true'] {
  background: #262824;
  border-color: #262824;
  color: #f7f5f0;
}

#viewer {
  height: 454px;
  min-height: 330px;
  position: relative;
  flex: 1;
  overflow: hidden;
}

#viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#viewer-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #eae9e1; /* hides the 3D view while it loads */
  display: grid;
  place-items: center;
  color: #7d8173;
  font-size: 12px;
}

.viewer-caption {
  position: absolute;
  bottom: 9px;
  width: 100%;
  text-align: center;
  color: #929688;
  font-size: 9px;
  pointer-events: none;
}

.viewer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 21px 0;
  gap: 10px;
}

.view-buttons {
  display: flex;
  background: #dbddd0;
  padding: 3px;
  border-radius: 5px;
  gap: 2px;
}

.view-buttons button {
  border: 0;
  background: none;
  border-radius: 3px;
  padding: 9px 11px;
  font-size: 10px;
  color: #808675;
}

.view-buttons button.active {
  background: #fffdf5;
  color: #505847;
  box-shadow: 0 1px 3px #0000000b;
}

.open-button {
  background: #fffdf5;
  border: 1px solid #d9dacb;
  color: #4b5642;
  gap: 9px;
  padding: 11px 14px;
  min-width: 117px;
}

.opening-control {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 24px 17px;
  font-size: 9px;
  color: #808775;
}

.opening-control input {
  flex: 1;
  min-width: 20px;
  accent-color: #798369;
  height: 3px;
}

.opening-control output {
  width: 29px;
  text-align: right;
}

.viewer-meta {
  border-top: 1px solid #d5d8c9;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  gap: 10px;
}

.viewer-meta > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.viewer-meta span {
  color: #87917b;
}

.viewer-meta strong {
  font-size: 12px;
  font-weight: 500;
}

.material-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.material-meta #metal-dot {
  width: 15px;
  height: 15px;
  border: 1px solid #0002;
  border-radius: 50%;
  background: #252629;
}

.bottom-note {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #8c9081;
  margin-top: 20px;
  gap: 15px;
}

.bottom-note p {
  margin: 0;
  line-height: 1.7;
}

.bottom-note p span {
  margin-right: 8px;
}

.bottom-note button {
  border: 0;
  background: none;
  color: #7c8271;
  font-size: 10px;
  white-space: nowrap;
}

.number-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.number-field label {
  display: block;
  font-size: 10px;
  margin: 0 0 9px;
}

.number-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fffefb;
  padding-right: 12px;
}

.number-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  padding: 13px 12px;
  font-size: 19px;
  color: #41493a;
  outline-offset: 0;
}

.number-wrap span {
  font-size: 10px;
  color: #929889;
}

.number-field input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
  margin-top: 14px;
}

.callout {
  background: #f0f0e8;
  padding: 13px;
  border-radius: 5px;
  font-size: 10px;
  color: #7f8873;
  line-height: 1.65;
  margin-top: 18px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: none;
  border: 0;
  font-size: 9px;
  padding: 2px;
  color: #868c7a;
  width: 64px;
  text-align: center;
  line-height: 1.3;
}

.swatch i {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px #0001;
  position: relative;
}

.swatch.selected i {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

.swatch.selected {
  color: var(--accent);
}

.swatch.selected i:after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  text-shadow: 0 1px 4px #000;
  font-size: 14px;
}

.glass-choices .choice {
  min-height: 80px;
}

.glass-choices .glass-sample {
  width: 30px;
  height: 36px;
  background: var(--glass);
  border: 2px solid #656c5b;
  box-shadow: 2px 2px 0 #0000000c;
}

.glass-choices {
  grid-template-columns: repeat(3, 1fr);
}

.validation {
  background: #f9e9e2;
  color: #924735;
  border-radius: 5px;
  padding: 12px;
  font-size: 11px;
  line-height: 1.6;
  margin-top: 18px;
}

.summary-list {
  margin: 0;
}

.summary-list > div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 11px 0;
  border-bottom: 1px solid #ebe9df;
  font-size: 11px;
}

.summary-list dt {
  color: #858c7a;
}

.summary-list dd {
  margin: 0;
  text-align: right;
  color: #444e3c;
}

.export-buttons {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.export-buttons button {
  flex: 1;
  font-size: 10px;
  padding: 12px 9px;
  border: 1px solid #d5d8c8;
  border-radius: 5px;
  background: #f4f4ec;
  cursor: pointer;
}

.review-note {
  font-size: 10px;
  line-height: 1.8;
  color: #8e9385;
  margin-top: 14px;
}

#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 20px;
  border-radius: 6px;
  color: white;
  background: #454d3d;
  z-index: 10;
  font-size: 12px;
  box-shadow: 0 8px 30px #0002;
}

#viewer-error {
  position: absolute;
  inset: 40px;
  z-index: 2;
  background: #eae9e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  color: #68715b;
}

#viewer-error[hidden] {
  display: none;
}

#fallback svg {
  height: 180px;
  max-width: 100%;
  margin-top: 10px;
}

[hidden] {
  display: none !important;
}

.designs .choice {
  min-height: 104px;
}

.section-note {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: #939887;
  font-size: 10px;
  line-height: 1.6;
}

@media (min-width: 1600px) {
  #viewer {
    height: 530px;
  }

  .configurator {
    min-height: 724px;
  }
}

@media (max-width: 1000px) {
  .workspace {
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1fr);
    gap: 16px;
  }

  .form-body {
    padding: 24px 20px;
  }

  .form-footer {
    padding: 18px 20px;
  }

  .intro-copy {
    display: none;
  }

  .viewer-toolbar {
    margin-left: 12px;
    margin-right: 12px;
  }

  .view-buttons button {
    padding: 9px 7px;
  }

  .viewer-meta {
    padding: 16px;
  }

  .material-meta {
    font-size: 9px;
  }

  .open-button {
    min-width: 95px;
    padding: 11px 9px;
  }

  .steps {
    padding: 20px 12px;
  }
}

@media (max-width: 720px) {
  .vh-page {
    padding: 28px 5% 20px;
  }

  .intro {
    margin-bottom: 23px;
  }

  .eyebrow {
    font-size: 8px;
  }

  :where(.vh-configurator) h1 {
    font-size: 30px;
    letter-spacing: -1px;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .viewer-card {
    order: -1;
  }

  #viewer {
    height: 280px;
    min-height: 280px;
    flex: none;
  }

  .viewer-heading {
    padding: 12px 16px;
  }

  .viewer-toolbar {
    margin: 8px 15px 0;
  }

  .opening-control {
    margin: 14px 18px;
  }

  .viewer-meta {
    padding: 12px 18px;
  }

  .configurator {
    min-height: 530px;
  }

  .form-body {
    padding: 23px;
  }

  .form-footer {
    padding: 18px 23px;
  }

  .steps {
    padding: 16px 14px;
  }

  .bottom-note {
    font-size: 9px;
  }

  .bottom-note p {
    max-width: 230px;
  }

  .viewer-caption {
    font-size: 8px;
  }

  .autosave {
    font-size: 8px;
  }

  .glass-choices .choice {
    min-height: 74px;
  }
}

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

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.contact-grid .wide {
  grid-column: 1/-1;
}

.text-field label {
  display: block;
  font-size: 10px;
  margin: 0 0 7px;
}

.text-field input,
.text-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fffefb;
  padding: 11px 12px;
  font: inherit;
  font-size: 13px;
  color: #41493a;
}

.consent {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 10px;
  line-height: 1.6;
  color: #6f7466;
}

.photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.photo-list figure {
  margin: 0;
  width: 84px;
}

.photo-list img {
  display: block;
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--line);
}

.photo-list .text-button {
  border: 0;
  padding: 4px 0;
  font-size: 10px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}

.price-list {
  margin-top: 18px;
}

.price-list .total {
  font-weight: bold;
  border-bottom: 0;
}

.price-list .total dd {
  color: var(--accent);
}

@media (max-width: 720px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.consent a {
  text-decoration: underline;
}

.panel-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
}

.panel-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 10px;
}

.panel-row-head .text-button {
  padding: 4px 0;
  font-size: 10px;
}

.panel-row .number-wrap input {
  font-size: 15px;
  padding: 9px 10px;
}

.callout + .field-label {
  margin-top: 22px;
}

/* With 36 designs the form is long: on desktop the 3D keeps its own height and stays in view while scrolling. */
@media (min-width: 721px) {
  .viewer-card {
    align-self: start;
    position: sticky;
    top: 16px;
  }

  #viewer {
    flex: none;
  }
}
