/* ================================================================================================
   Build-your-demo configurator.

   Spec 19 asks for something that LOOKS like the site and BEHAVES like a product configurator,
   so the tokens, type and buttons come from site.css and only the application furniture is new
   here. Spec 20 sets the three viewport contracts and they are the only breakpoints below:
   three zones at 1200+, two zones on a tablet, one column with sticky controls on a phone.
   ================================================================================================ */

.demo-body { background: var(--cream); }
.dm { min-height: 60vh; }
.dm-in { max-width: 1280px; margin: 0 auto; padding: 0 28px; }
.dm-narrow { max-width: 760px; }
.dm-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.dm-eyebrow {
  font-family: var(--mono); font-weight: 600; font-size: 11.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--forest); margin: 0 0 14px;
}
.dm-lead { color: var(--ink2); font-size: 18px; line-height: 1.6; max-width: 62ch; margin: 0 0 34px; text-wrap: pretty; }
.dm-fine { color: var(--ink2); font-size: 14px; margin: 18px 0 0; opacity: .8; }

/* ---------------------------------------- buttons ---------------------------------------- */
.dm-btn {
  display: inline-flex; align-items: center; gap: 10px; font: inherit; font-weight: 600; font-size: 15px;
  padding: 13px 22px; border-radius: 999px; border: 1.5px solid var(--forest); background: transparent;
  color: var(--forest); cursor: pointer; text-decoration: none; transition: background .2s, color .2s;
}
.dm-btn:hover { background: var(--mint); }
.dm-btn-solid { background: var(--forest); border-color: var(--forest); color: #fff; }
.dm-btn-solid:hover { background: #174a2f; color: #fff; }
.dm-btn:disabled { opacity: .55; cursor: default; }
.dm-link {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--forest); background: none; border: 0;
  padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.dm-link:disabled { color: var(--ink2); opacity: .45; cursor: default; text-decoration: none; }

/* Spec 17: a visible focus state on everything, and never removed. */
.dm :focus-visible, .demo-body :focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------- the one screen ---------------------------------------- */
.dm-page { padding: 130px 0 90px; }
.dm-head { margin-bottom: 34px; }
.dm-head h1 {
  font-family: var(--disp); font-weight: 700; font-size: clamp(34px, 4.6vw, 56px); letter-spacing: -.032em;
  line-height: 1.02; margin: 0 0 16px; max-width: 18ch; text-wrap: balance; color: var(--ink);
}
.dm-head .dm-lead { margin-bottom: 0; }
.dm-fail h1 { font-family: var(--disp); font-weight: 700; font-size: 40px; letter-spacing: -.03em; margin: 0 0 14px; }

.dm-cols { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 56px; align-items: start; }

/* search — as before, now sitting at the top of the list column */
.dm-search-wrap { position: relative; }
.dm-search { position: relative; display: flex; align-items: center; }
.dm-search svg { position: absolute; left: 18px; width: 19px; height: 19px; color: var(--ink2); opacity: .6; pointer-events: none; }
.dm-search input {
  width: 100%; font: inherit; font-size: 16px; padding: 15px 46px 15px 48px; border-radius: 14px;
  border: 1.5px solid rgba(20, 38, 27, .16); background: #fff; color: var(--ink);
}
.dm-search input::placeholder { color: var(--ink2); opacity: .7; }
.dm-search input:focus { border-color: var(--forest); outline: none; box-shadow: 0 0 0 3px rgba(31, 90, 58, .14); }
#q-clear {
  position: absolute; right: 12px; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: rgba(20, 38, 27, .07); color: var(--ink2); font-size: 19px; line-height: 1; cursor: pointer;
}
.dm-results {
  position: absolute; left: 0; right: 0; top: calc(100% - 2px); z-index: 40; background: #fff;
  border-radius: 16px; box-shadow: 0 24px 60px rgba(20, 38, 27, .18); border: 1px solid rgba(20, 38, 27, .1);
  overflow: hidden; max-height: 62vh; overflow-y: auto;
}
.dm-r {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; font: inherit;
  padding: 13px 18px; background: none; border: 0; border-bottom: 1px solid rgba(20, 38, 27, .08); cursor: pointer;
}
.dm-r:last-of-type { border-bottom: 0; }
.dm-r:hover { background: var(--mint); }
.dm-r-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dm-r-t b { font-size: 15px; font-weight: 700; color: var(--ink); }
.dm-r-t span { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); opacity: .8; }
.dm-r-a { font-size: 13.5px; font-weight: 600; color: var(--forest); white-space: nowrap; }
.dm-r.on .dm-r-a:before { content: "\2713\00a0"; }
.dm-noresult, .dm-rmore { margin: 0; padding: 18px; font-size: 15px; color: var(--ink2); line-height: 1.6; }
.dm-rmore { border-top: 1px solid rgba(20, 38, 27, .08); font-size: 13.5px; }

/* ---------------------------------------- three zones (spec 20) ---------------------------------------- */

/* ---------------------------------------- the accordion ---------------------------------------- */
.dm-acc-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 26px 0 0;
  padding-bottom: 12px; border-bottom: 1.5px solid rgba(20, 38, 27, .28);
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink2);
}
.dm-acc { list-style: none; margin: 0; padding: 0; }
.dm-a { border-bottom: 1px solid rgba(20, 38, 27, .13); transition: background .2s; }
.dm-a.open { background: #fff; margin: 0 -18px; padding: 0 18px; border-radius: 14px; border-bottom-color: transparent;
  box-shadow: 0 12px 40px rgba(20, 38, 27, .08); }
.dm-a.open + .dm-a { border-top: 1px solid rgba(20, 38, 27, .13); }
.dm-a-row { display: flex; align-items: center; gap: 14px; }

/* The tick is a real tri-state: none / some / all. "Some" is a dash, the way a folder half-checked
   in a file picker is a dash — the one symbol everybody already reads as "partly". */
.dm-ck {
  flex: none; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid rgba(20, 38, 27, .35);
  background: #fff; cursor: pointer; position: relative; padding: 0; transition: background .15s, border-color .15s;
}
.dm-ck:hover { border-color: var(--forest); }
.dm-ck-all, .dm-ck-some { background: var(--forest); border-color: var(--forest); }
.dm-ck-all:after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: rotate(45deg);
}
.dm-ck-some:after { content: ""; position: absolute; left: 6px; right: 6px; top: 10px; height: 2.2px; background: #fff; border-radius: 2px; }

.dm-a-t {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; font: inherit; text-align: left;
  background: none; border: 0; padding: 18px 0; cursor: pointer; color: var(--ink);
}
.dm-a-n { font-family: var(--disp); font-weight: 700; font-size: 19px; letter-spacing: -.02em; flex: 1; min-width: 0; }
.dm-a.has .dm-a-n { color: var(--forest); }
.dm-a-c { font-size: 13px; color: var(--ink2); white-space: nowrap; }
.dm-a.has .dm-a-c { color: var(--forest); font-weight: 600; }
.dm-chev {
  flex: none; width: 10px; height: 10px; border: solid var(--ink2); border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg); margin: -4px 6px 0 2px; transition: transform .2s;
}
.dm-a-t[aria-expanded="true"] .dm-chev { transform: rotate(-135deg); margin-top: 4px; }

.dm-a-body { padding: 0 0 20px 38px; }
.dm-a-d { margin: -6px 0 14px; color: var(--ink2); font-size: 15px; line-height: 1.55; max-width: 60ch; text-wrap: pretty; }
.dm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dm-chip {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 500;
  padding: 8px 10px 8px 14px; border-radius: 999px; border: 1.5px solid rgba(20, 38, 27, .18); background: #FBFAF5;
  color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s, color .15s; text-align: left;
}
.dm-chip:hover { border-color: var(--forest); background: var(--mint); }
.dm-chip i {
  font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; line-height: 1; background: rgba(20, 38, 27, .08); color: var(--ink2);
}
.dm-chip.on { background: var(--forest); border-color: var(--forest); color: #fff; }
.dm-chip.on i { background: rgba(255, 255, 255, .22); color: #fff; }
.dm-chip.flash { animation: dmflash 1.6s ease; }
@keyframes dmflash { 0%, 60% { box-shadow: 0 0 0 4px var(--lime); } 100% { box-shadow: none; } }
.dm-a-acts { display: flex; gap: 18px; margin-top: 14px; }
.dm-acc.nudge { animation: dmnudge .5s ease; }
@keyframes dmnudge { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }

/* ---------------------------------------- your demo + the form ---------------------------------------- */
.dm-side { position: sticky; top: 100px; }
.dm-side-in { background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 24px 26px 26px; max-height: calc(100vh - 124px); overflow: auto; }
.dm-side-h {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-family: var(--disp);
  font-weight: 700; font-size: 22px; letter-spacing: -.02em; color: var(--ink);
}
.dm-count {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  background: var(--lime); color: var(--ink); font-family: var(--mono); font-size: 12px; font-weight: 600;
}
.dm-side-empty { margin: 0 0 22px; color: var(--ink2); font-size: 14.5px; line-height: 1.55; }
.dm-sg { margin-bottom: 12px; }
.dm-sg h4 {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 4px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--forest);
}
.dm-sg h4 em { font-style: normal; color: var(--ink2); opacity: .8; }
.dm-sg h4 .dm-link { font-size: 12px; font-weight: 500; }
.dm-sg ul { list-style: none; margin: 0; padding: 0; }
.dm-sg li {
  display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; color: var(--ink2);
  border-bottom: 1px solid rgba(20, 38, 27, .07);
}
.dm-sg li span { flex: 1; min-width: 0; }
.dm-x {
  flex: none; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(20, 38, 27, .06);
  color: var(--ink2); font-size: 15px; line-height: 1; cursor: pointer;
}
.dm-x:hover { background: var(--blush); color: #9A2E5A; }
#side-list:not(:empty) { margin-bottom: 20px; padding-bottom: 6px; border-bottom: 1.5px solid rgba(20, 38, 27, .28); }
#dm-form .dm-fields { grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
#dm-form .dm-field input, #dm-form .dm-field textarea { padding: 11px 13px; font-size: 15px; }
#dm-form .dm-submit { width: 100%; justify-content: center; margin-top: 14px; }
#dm-form .dm-fine { margin-top: 12px; font-size: 13px; }
.dm-sticky { display: none; }

.dm-revlist { margin-bottom: 34px; }
.dm-rl { padding: 16px 0; border-bottom: 1px solid rgba(20, 38, 27, .13); }
.dm-rl h4 { margin: 0 0 8px; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .11em;
  text-transform: uppercase; color: var(--forest); }
.dm-rl li { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 15.5px; color: var(--ink); }
.dm-rl li span { flex: 1; min-width: 0; }
.dm-rl li:before { content: "\2713"; color: var(--forest); font-size: 13px; }

.dm-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dm-field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.dm-field input, .dm-field textarea {
  font: inherit; font-size: 16px; font-weight: 400; padding: 13px 15px; border-radius: 12px;
  border: 1.5px solid rgba(20, 38, 27, .16); background: #fff; color: var(--ink); width: 100%; box-sizing: border-box;
}
.dm-field textarea { resize: vertical; min-height: 96px; }
.dm-field input:focus, .dm-field textarea:focus { border-color: var(--forest); outline: none; box-shadow: 0 0 0 3px rgba(31, 90, 58, .14); }
.dm-field input[aria-invalid="true"] { border-color: #9A2E5A; }
.dm-field small { font-weight: 400; font-size: 13px; color: var(--ink2); }
.dm-err { font-style: normal; font-weight: 500; font-size: 13px; color: #9A2E5A; }
.dm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.dm-msg { margin: 14px 0 0; font-size: 15px; }
.dm-msg.err { color: #9A2E5A; }
.dm-submit { margin-top: 20px; }
#dm-form .dm-field:last-of-type { margin-bottom: 4px; }

/* ---------------------------------------- 4. done ---------------------------------------- */
.dm-tick {
  width: 58px; height: 58px; border-radius: 50%; background: var(--mint); color: var(--forest);
  display: grid; place-items: center; margin-bottom: 26px;
}
.dm-tick svg { width: 30px; height: 30px; }

/* ---------------------------------------- done ---------------------------------------- */
.dm-done { padding: 140px 0 100px; }
.dm-done h2 {
  font-family: var(--disp); font-weight: 700; font-size: clamp(30px, 4.4vw, 50px); letter-spacing: -.032em;
  line-height: 1.02; margin: 0 0 26px; max-width: 20ch; text-wrap: balance; color: var(--ink);
}
.dm-tick-big, .dm-done .dm-tick {
  width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--mint); color: var(--forest);
  display: grid; place-items: center; margin-bottom: 26px; cursor: default;
}
.dm-done .dm-tick:after { content: none; }
.dm-done .dm-tick svg { width: 30px; height: 30px; }

/* ================================================================================================
   Tablet: the side card drops under the list and a sticky bar carries the count and the button.
   Phone: same, tighter, sticky search.
   ================================================================================================ */
@media (max-width: 1099px) {
  .dm-cols { grid-template-columns: 1fr; gap: 40px; }
  .dm-side { position: static; }
  .dm-side-in { max-height: none; overflow: visible; }
  .dm-sticky {
    display: flex; position: sticky; bottom: 0; z-index: 35; align-items: center; justify-content: space-between;
    gap: 16px; padding: 12px 28px calc(12px + env(safe-area-inset-bottom));
    background: rgba(251, 250, 245, .96); backdrop-filter: blur(10px);
    border-top: 1px solid rgba(20, 38, 27, .12);
  }
  .dm-sticky span { font-size: 15px; color: var(--ink2); }
  .dm-sticky b { color: var(--ink); }
  body:not(.dm-has) .dm-sticky { display: none; }
}
@media (max-width: 767px) {
  .dm-page { padding-top: 110px; }
  .dm-in { padding-left: 20px; padding-right: 20px; }
  .dm-results { left: 0; right: 0; }
  .dm-a.open { margin: 0 -12px; padding: 0 12px; }
  .dm-a-n { font-size: 17px; }
  .dm-a-c { font-size: 12px; }
  .dm-a-body { padding-left: 0; }
  .dm-chip { font-size: 13.5px; padding: 9px 9px 9px 13px; }
  .dm-side-in { padding: 20px; }
  .dm-sticky { padding-left: 20px; padding-right: 20px; }
  .dm-done { padding: 110px 0 80px; }
  .dm-x { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .dm-chip, .dm-chev, .dm-ck, .dm-a { transition: none; }
  .dm-chip.flash, .dm-acc.nudge { animation: none; }
  .dm-chip.flash { box-shadow: 0 0 0 3px var(--lime); }
}

/* ---------------------------------------- products, tiles, chips, cart (2026-09-18) ---------------------------------------- */
.dm-step-h { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font-family: var(--disp); font-weight: 700; font-size: 26px; letter-spacing: -.025em; color: var(--ink); }
.dm-num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--lime); color: var(--ink); display: grid; place-items: center; font-size: 14px; }
.dm-step { margin-bottom: 44px; }
.dm-prods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dm-prod {
  display: flex; flex-direction: column; text-align: left; font: inherit; background: #fff; border: 1.5px solid transparent; border-radius: 22px;
  padding: 0; overflow: hidden; cursor: pointer; box-shadow: var(--shadow); color: var(--ink); transition: transform .2s, border-color .2s;
}
.dm-prod:hover { transform: translateY(-2px); }
.dm-prod.on { border-color: var(--forest); }
.dm-prod img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 1040; object-fit: cover; background: #FFFDF6; }
.dm-prod-t { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 16px 18px 20px; align-items: start; }
.dm-prod-t .dm-ck { grid-row: 1 / span 2; margin-top: 2px; }
.dm-prod-t b { font-family: var(--disp); font-weight: 700; font-size: 18px; letter-spacing: -.02em; line-height: 1.15; text-wrap: balance; }
.dm-prod-t > span:last-child { font-size: 14px; line-height: 1.5; color: var(--ink2); }
.dm-prod .dm-ck { pointer-events: none; }
.dm-ck { display: inline-block; }
.dm-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.dm-tile { background: #fff; border-radius: 18px; box-shadow: var(--shadow); border: 1.5px solid transparent; display: flex; flex-direction: column; overflow: hidden; }
.dm-tile.has { border-color: var(--forest); }
.dm-tile.open { background: var(--mint); }
.dm-tile-main { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; text-align: left; font: inherit; background: none; border: 0; padding: 18px 18px 8px; cursor: pointer; color: var(--ink); }
.dm-tile-main .dm-ck { grid-row: 1 / span 2; }
.dm-tile-n { font-family: var(--disp); font-weight: 700; font-size: 18px; letter-spacing: -.02em; line-height: 1.15; }
.dm-tile-c { font-size: 13px; color: var(--ink2); }
.dm-tile.has .dm-tile-c { color: var(--forest); font-weight: 600; }
.dm-tile-more { align-self: flex-start; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--forest); background: none; border: 0; padding: 4px 18px 16px 54px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.dm-chipbox { margin-top: 14px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 20px 22px 18px; border: 1.5px solid var(--mint); }
.dm-chip-h { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.dm-chip-h b { font-family: var(--disp); font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.dm-chip-h span { font-size: 14.5px; color: var(--ink2); line-height: 1.5; }
.dm-side-prods { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.dm-side-prods:empty { display: none; }
.dm-sp { font-size: 12.5px; font-weight: 600; color: var(--forest); background: var(--mint); border-radius: 999px; padding: 5px 10px; }
.dm-side-sub { margin: 0 0 12px; font-family: var(--disp); font-weight: 700; font-size: 17px; letter-spacing: -.015em; }
.dm-acc.nudge, .dm-tiles.nudge { animation: dmnudge .5s ease; }
@media (max-width: 1099px) { .dm-prods { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .dm-prods { grid-template-columns: 1fr; }
  .dm-prod { flex-direction: row; align-items: center; }
  .dm-prod img { width: 34%; flex: none; }
  .dm-tiles { grid-template-columns: 1fr; }
  .dm-step-h { font-size: 22px; }
}
