/* "Calculate your project" popup. Opened by any [data-calc] link (the header "calculate your project" button).
   It sits above the artboards, so it is sized in px/rem rather than design units. */

.calc { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; visibility: hidden; pointer-events: none; }
.calc.is-open { visibility: visible; pointer-events: auto; }
.calc-veil { position: absolute; inset: 0; background: rgba(18, 17, 17, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .5s ease; }
.calc.is-open .calc-veil { opacity: 1; }

.calc-panel { position: relative; width: min(620px, 100%); max-height: calc(100dvh - 48px); overflow: auto; overscroll-behavior: contain; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-grey); color: var(--ink); font-family: var(--ff-sans); opacity: 0; translate: 0 32px; transition: opacity .5s ease, translate .7s var(--ease-out, ease); scrollbar-width: thin; scrollbar-color: var(--line-grey) transparent; }
.calc.is-open .calc-panel { opacity: 1; translate: 0 0; }

.calc-head { position: sticky; top: 0; z-index: 1; background: var(--bg); display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 40px 48px 32px; border-bottom: 1px solid var(--line-grey); }
.calc-kicker { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.calc-title { font-size: 44px; line-height: 1.1; font-weight: 400; letter-spacing: .04em; }
.calc-title em { font-family: var(--ff-ivy); font-style: normal; font-weight: 300; color: var(--gold); letter-spacing: .02em; }
.calc-close { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -8px -12px 0 0; background: none; border: 0; padding: 0; font: 600 12px/16px var(--ff-sans); text-transform: uppercase; color: var(--ink-50); cursor: pointer; transition: color .25s ease; }
.calc-close:hover { color: var(--gold); }
.calc-close i { position: relative; width: 20px; height: 20px; }
.calc-close i::before, .calc-close i::after { content: ""; position: absolute; left: 0; top: 9.5px; width: 20px; height: 1px; background: currentColor; transform: rotate(45deg); }
.calc-close i::after { transform: rotate(-45deg); }

/* before calculating only the form shows; the result column opens beside it afterwards */
.calc-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.calc-form { padding: 32px 48px 40px; display: flex; flex-direction: column; gap: 26px; }
.calc-out { display: none; padding: 32px 48px 40px; position: relative; }
.calc-panel.has-res { width: min(1040px, 100%); }
.calc-panel.has-res .calc-body { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
.calc-panel.has-res .calc-form { border-right: 1px solid var(--line-grey); }
.calc-panel.has-res .calc-out { display: block; }
.calc-panel.has-res .calc-hint { display: none; }
.calc-go-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; margin-top: 6px; }
.calc-hint { flex: 1 1 200px; margin: 0; font-size: 13px; line-height: 19px; color: var(--ink-50); }

.calc-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.calc-label { display: flex; justify-content: space-between; align-items: baseline; padding: 0; margin-bottom: 12px; font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; color: var(--ink-50); }
.calc-label b { font-weight: 600; color: var(--ink); font-variant-numeric: lining-nums; }

/* Area: a number with a slider under it */
.calc-area { display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--line-grey); padding-bottom: 6px; transition: border-color .25s ease; }
.calc-area:focus-within { border-color: var(--gold); }
.calc-area input { width: 2.6ch; min-width: 1.6ch; background: none; border: 0; padding: 0; font: 300 40px/1.1 var(--ff-sans); color: var(--ink); font-variant-numeric: lining-nums; -moz-appearance: textfield; appearance: textfield; outline: none; }
.calc-area input::-webkit-outer-spin-button, .calc-area input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-area span { font-size: 16px; color: var(--ink-50); }
.calc-range { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; margin: 10px 0 0; background: transparent; cursor: pointer; --p: 20%; }
.calc-range::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(90deg, var(--gold) var(--p), var(--line-grey) var(--p)); }
.calc-range::-moz-range-track { height: 1px; background: linear-gradient(90deg, var(--gold) var(--p), var(--line-grey) var(--p)); }
.calc-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6.5px; border-radius: 50%; background: var(--gold); border: 0; box-shadow: 0 0 0 6px rgba(255, 214, 118, .12); transition: box-shadow .25s ease; }
.calc-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 0; box-shadow: 0 0 0 6px rgba(255, 214, 118, .12); }
.calc-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 8px rgba(255, 214, 118, .3); }
.calc-range:focus { outline: none; }

/* Choice pills (real radio buttons underneath) */
.calc-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.calc-pill { position: relative; }
.calc-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.calc-pill span { display: block; padding: 9px 16px; border: 1px solid var(--line-grey); border-radius: 40px; font-size: 13px; line-height: 16px; font-weight: 500; color: var(--ink-74); cursor: pointer; white-space: nowrap; transition: color .25s ease, border-color .25s ease, background-color .25s ease; }
.calc-pill span:hover { color: var(--ink); border-color: var(--ink-50); }
.calc-pill input:checked + span { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.calc-pill input:focus-visible + span { outline: 1px solid var(--gold); outline-offset: 3px; }

/* Rooms stepper */
.calc-step { display: inline-flex; align-items: center; border: 1px solid var(--line-grey); border-radius: 40px; }
.calc-step button { width: 42px; height: 36px; background: none; border: 0; color: var(--ink-74); font: 300 20px/1 var(--ff-sans); cursor: pointer; transition: color .25s ease; }
.calc-step button:hover { color: var(--gold); }
.calc-step output { min-width: 34px; text-align: center; font-size: 15px; font-weight: 500; font-variant-numeric: lining-nums; }

.calc-go { flex: none; display: inline-flex; align-items: center; gap: 14px; padding: 16px 34px; border-radius: 50px; border: 1px solid var(--ink); background: none; color: var(--ink); font: 600 14px/16px var(--ff-sans); text-transform: uppercase; cursor: pointer; transition: background-color .35s ease, color .35s ease, border-color .35s ease; }
.calc-go:hover { background: var(--ink); color: var(--bg); }
.calc-go svg { width: 18px; height: 10px; }

/* Result side */
.calc-res[hidden] { display: none; }
.calc-res > * { opacity: 0; translate: 0 18px; transition: opacity .7s var(--ease-out, ease) var(--d, 0s), translate .8s var(--ease-out, ease) var(--d, 0s); }
.calc-res.is-in > * { opacity: 1; translate: 0 0; }

.calc-total-label { font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; color: var(--gold); }
.calc-total { margin-top: 10px; font-size: 38px; line-height: 1.15; font-weight: 300; letter-spacing: .01em; font-variant-numeric: lining-nums tabular-nums; }
.calc-total span { white-space: nowrap; }
.calc-total small { display: block; margin-top: 4px; font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; color: var(--ink-50); letter-spacing: 0; }
.calc-sub { margin-top: 8px; font-size: 13px; line-height: 20px; color: var(--ink-50); font-variant-numeric: lining-nums; }

.calc-lines { margin: 24px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line-grey); }
.calc-lines li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-grey); font-size: 13px; line-height: 18px; color: var(--ink-74); font-variant-numeric: lining-nums; }
.calc-lines li b { font-weight: 500; color: var(--ink); white-space: nowrap; }

.calc-works-h { margin-top: 26px; font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; color: var(--ink-50); }
.calc-works { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.calc-works li { display: grid; grid-template-columns: 30px 1fr; font-size: 14px; line-height: 20px; color: var(--ink-74); }
.calc-works li i { font-family: var(--ff-ivy); font-style: normal; color: var(--gold); font-size: 15px; line-height: 20px; }

.calc-note { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line-grey); font-size: 11.5px; line-height: 17px; color: var(--ink-50); }
.calc-cta { margin-top: 24px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 17px 34px; border-radius: 50px; background: var(--gold); color: var(--bg); font: 600 14px/16px var(--ff-sans); text-transform: uppercase; transition: background-color .35s ease; }
.calc-cta:hover { background: var(--ink); }
.calc-cta svg { width: 18px; height: 10px; }

html.calc-lock, html.calc-lock body { overflow: hidden; }

@media (max-width: 860px) {
  .calc { padding: 0; align-items: flex-end; }
  .calc-panel, .calc-panel.has-res { width: 100%; max-height: 100dvh; height: 100dvh; translate: 0 48px; box-shadow: none; }
  .calc-head { padding: 28px 20px 22px; position: sticky; top: 0; background: var(--bg); z-index: 1; }
  .calc-kicker { margin-bottom: 10px; }
  .calc-title { font-size: 30px; }
  .calc-body, .calc-panel.has-res .calc-body { grid-template-columns: minmax(0, 1fr); }
  .calc-form, .calc-panel.has-res .calc-form { padding: 24px 20px 32px; border-right: 0; gap: 24px; }
  .calc-out { padding: 28px 20px 40px; border-top: 1px solid var(--line-grey); }
  .calc-total { font-size: 30px; }
}
/* phones: tighter title, full-width buttons, chips scroll sideways on one line */
@media (max-width: 699px) {
  .calc-title { line-height: 1; }
  .calc-go, .calc-cta { align-self: stretch; justify-content: center; width: 100%; }
  .calc-pills { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 0 20px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .calc-pills::-webkit-scrollbar { display: none; }
  .calc-pill { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  .calc-veil, .calc-panel, .calc-res > * { transition: none; translate: none; }
}
