/* ==========================================================================
   Scene detail — The Palette Retreat
   ========================================================================== */

/* The fixed bottom bar must never cover the footer's last line. */
body.kbh-tpl-scene .site-footer__tail { height: 128px; }

/* ---------- Hero ---------- */
.sd-hero { position: relative; height: 680px; overflow: hidden; }
.sd-hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sd-hero__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 16, 12, .08) 40%, rgba(20, 16, 12, .55) 100%);
}
.sd-hero__body {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 56px;
  color: var(--cream);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
}
.sd-hero__text { max-width: 700px; }
.sd-hero__kicker { font-size: 12px; letter-spacing: .26em; font-weight: 600; opacity: .9; margin-bottom: 16px; }
.sd-hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4.6vw, 58px);
  line-height: 1.08;
}
.sd-hero__lede { margin-top: 16px; font-size: 16px; line-height: 1.7; opacity: .92; max-width: 560px; }
.sd-hero__chips { margin-top: 22px; }
.chip--onLight {
  border-color: rgba(245, 242, 234, .5);
  color: var(--cream);
  padding: 7px 13px;
  font-size: 11.5px;
  letter-spacing: .14em;
}
.sd-hero__actions { display: flex; flex-direction: column; gap: 14px; min-width: 280px; flex-shrink: 0; }
.sd-hero__actions .btn { width: 100%; padding: 16px 28px; font-size: 12.5px; }

/* ---------- Story ---------- */
.sd-story {
  display: grid;
  grid-template-columns: 6fr 5fr;
  gap: 90px;
  align-items: center;
  padding-top: 120px;
  padding-bottom: 120px;
}
.sd-story__img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }

.head-row__hint { font-size: 13px; color: var(--muted); flex-shrink: 0; }

/* ---------- Hotspot stage ---------- */
.sd-stage { position: relative; }
.sd-stage__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }

.sd-spot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sd-spot__dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(245, 242, 234, .94);
  border: 1.5px solid var(--rule-strong);
  animation: kbh-breathe 2.6s ease-out infinite;
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}
.sd-spot[aria-expanded="true"] .sd-spot__dot {
  color: var(--cream);
  background: var(--terra);
  border-color: var(--cream);
}

.sd-pop {
  position: absolute;
  width: 300px;
  background: var(--cream);
  padding: 26px 26px 24px;
  border: 1px solid rgba(29, 28, 25, .2);
  z-index: 5;
  animation: kbh-fadeUp .22s ease both;
}
.sd-pop[hidden] { display: none; }
.sd-pop__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.sd-pop__name { font-family: var(--serif); font-size: 21px; }
.sd-pop__code { font-size: 12px; letter-spacing: .12em; color: var(--muted); margin-top: 5px; }
.sd-pop__close { font-size: 16px; color: var(--muted); padding: 2px; line-height: 1; }
.sd-pop__close:hover { color: var(--terra); }
.sd-pop__mat { font-size: 13px; color: var(--muted-dark); margin-top: 10px; }
.sd-pop__supply {
  display: inline-flex;
  margin-top: 14px;
  padding: 6px 11px;
  font-size: 10.5px;
  color: var(--brown);
  border-color: var(--rule-strong);
}
.sd-pop__links { display: flex; gap: 20px; margin-top: 16px; font-size: 12.5px; letter-spacing: .08em; font-weight: 600; }
.sd-pop__replace {
  color: var(--muted);
  border-bottom: 1px solid rgba(29, 28, 25, .25);
  padding-bottom: 3px;
}
.sd-pop__replace:hover { color: var(--terra); border-bottom-color: var(--terra); }

/* ---------- Furniture list ---------- */
.sd-included { padding-top: 120px; padding-bottom: 80px; }
.sd-list { border-top: 1px solid rgba(29, 28, 25, .18); }

.sd-item {
  display: grid;
  grid-template-columns: 52px 96px 1fr 150px 170px 170px;
  gap: 24px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid rgba(29, 28, 25, .12);
}
.sd-item[data-selected="false"] .sd-item__thumb img { opacity: .4; }
.sd-item[data-selected="false"] .sd-item__id,
.sd-item[data-selected="false"] .sd-qty,
.sd-item[data-selected="false"] .sd-item__supply { opacity: .45; }

.sd-item__check {
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--rule-strong);
  background: transparent;
  color: var(--cream);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: background .2s ease, border-color .2s ease;
}
.sd-item__check span { opacity: 0; }
.sd-item__check[aria-checked="true"] { background: var(--ink); border-color: var(--ink); }
.sd-item__check[aria-checked="true"] span { opacity: 1; }

.sd-item__thumb {
  width: 96px;
  height: 96px;
  background: #fff;
  border: 1px solid rgba(29, 28, 25, .08);
}
.sd-item__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s ease; }

.sd-item__name { font-family: var(--serif); font-size: 20px; }
.sd-item__code { font-size: 12px; letter-spacing: .1em; color: var(--muted); margin-top: 4px; }
.sd-item__supply { font-size: 11px; letter-spacing: .14em; color: var(--brown); }

.sd-item__replace {
  font-size: 12px;
  letter-spacing: .1em;
  font-weight: 600;
  color: var(--muted);
  justify-self: end;
  border-bottom: 1px solid rgba(29, 28, 25, .25);
  padding-bottom: 3px;
}
.sd-item__replace:hover { color: var(--terra); border-bottom-color: var(--terra); }

.sd-included__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 36px;
}
.sd-total { font-size: 15px; }
.sd-total__n { font-family: var(--serif); font-size: 26px; }
.sd-included__cta { padding: 17px 36px; }

/* ---------- Delivery note ---------- */
.sd-note {
  border: 1px solid rgba(29, 28, 25, .16);
  padding: 34px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  background: var(--cream-warm);
}
.sd-note__left { display: flex; align-items: center; gap: 28px; }
.sd-note__mark { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.sd-note__from { width: 12px; height: 12px; border-radius: 50%; background: var(--terra); }
.sd-note__line { width: 1.5px; height: 16px; background: rgba(29, 28, 25, .3); }
.sd-note__to { width: 12px; height: 12px; border: 1.5px solid var(--brown); }
.sd-note__title { font-family: var(--serif); font-size: 22px; }
.sd-note__sub { font-size: 12.5px; color: var(--muted-dark); margin-top: 6px; letter-spacing: .04em; }
.sd-note__cta { flex-shrink: 0; }

/* ---------- Bundles ---------- */
.sd-bundles-wrap { padding-top: 60px; padding-bottom: 120px; }
.sd-bundles { gap: 32px; }
.sd-bundle {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 40px 34px;
  background: var(--cream);
  border: 1px solid var(--rule);
  transition: background .2s ease, border-color .2s ease;
}
.sd-bundle:hover { border-color: var(--brown); }
.sd-bundle[aria-pressed="true"] { background: var(--cream-warm); border-color: var(--brown); }
.sd-bundle__num { font-size: 11.5px; letter-spacing: .26em; color: var(--terra); font-weight: 600; }
.sd-bundle__name { font-family: var(--serif); font-size: 26px; }
.sd-bundle__desc { font-size: 14px; line-height: 1.7; color: var(--muted-dark); }
.sd-bundle__cta {
  margin-top: 10px;
  align-self: flex-start;
  font-size: 11.5px;
  letter-spacing: .14em;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 2px;
  border: 1px solid rgba(29, 28, 25, .4);
  color: var(--ink);
}
.sd-bundle[aria-pressed="true"] .sd-bundle__cta {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

/* ---------- Materials ---------- */
.sd-mats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px; }
.sd-mat {
  text-align: left;
  background: none;
  outline: 1px solid rgba(29, 28, 25, .12);
  outline-offset: 0;
  transition: outline-color .2s ease;
}
.sd-mat img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.sd-mat[aria-pressed="true"] { outline: 2px solid var(--brown); outline-offset: 3px; }
.sd-mat__name { font-size: 13px; font-weight: 600; margin-top: 12px; display: block; }
.sd-mat__kind { font-size: 11.5px; letter-spacing: .1em; color: var(--muted); display: block; margin-top: 3px; }
.sd-mats__note { margin-top: 36px; font-size: 13.5px; color: var(--muted); max-width: 640px; line-height: 1.75; }

/* ---------- Budget + how it works ---------- */
.sd-budget {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 96px;
  padding-top: var(--section-y-sm);
  padding-bottom: var(--section-y-sm);
}
.sd-tier { border: 1px solid rgba(245, 242, 234, .25); padding: 26px 28px; margin-top: 34px; position: relative; }
.sd-tier--featured {
  border-color: rgba(245, 242, 234, .45);
  background: rgba(245, 242, 234, .07);
  margin-top: 14px;
}
.sd-tier__badge {
  position: absolute;
  top: -1px;
  right: -1px;
  background: var(--cream);
  color: var(--brown);
  font-size: 9.5px;
  letter-spacing: .2em;
  font-weight: 600;
  padding: 6px 12px;
}
.sd-tier__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.sd-tier__name { font-size: 14px; font-weight: 600; }
.sd-tier__price { font-family: var(--serif); font-size: 24px; }
.sd-tier__note { font-size: 12.5px; color: var(--sand); margin-top: 8px; }
.sd-budget__fine { margin-top: 22px; font-size: 12.5px; color: var(--sand); line-height: 1.75; }

.sd-steps { list-style: none; margin: 38px 0 0; padding: 0; display: flex; flex-direction: column; }
.sd-step { display: flex; gap: 26px; align-items: flex-start; }
.sd-step__rail { display: flex; flex-direction: column; align-items: center; align-self: stretch; }
.sd-step__num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--terra-pale);
  color: var(--terra-pale);
  font-family: var(--serif);
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sd-step--last .sd-step__num { background: var(--terra-pale); color: var(--brown); }
.sd-step__line { width: 1px; flex: 1; background: rgba(245, 242, 234, .25); margin: 6px 0; }
.sd-step__body { padding-bottom: 30px; }
.sd-step--last .sd-step__body { padding-bottom: 0; }
.sd-step__title { font-size: 15.5px; font-weight: 600; }
.sd-step__text { font-size: 13px; color: var(--sand); margin-top: 5px; line-height: 1.7; }

.sd-supply-legend { margin-top: 36px; gap: 14px; }
.sd-supply-legend .chip { padding: 9px 15px; font-size: 11px; letter-spacing: .1em; }
.sd-supply-legend strong { color: var(--terra-pale); font-weight: 600; }

/* ---------- Sticky bar ---------- */
.sd-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ink);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px var(--gutter);
  z-index: 50;
}
.sd-bar__text { display: flex; align-items: baseline; gap: 16px; min-width: 0; }
.sd-bar__name { font-family: var(--serif); font-size: 19px; white-space: nowrap; }
.sd-bar__meta { font-size: 13px; color: #9b9488; }
.sd-bar__cta { padding: 14px 32px; flex-shrink: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1279px) {
  .sd-hero { height: 560px; }
  .sd-story { gap: 56px; padding-top: 88px; padding-bottom: 88px; }
  .sd-included { padding-top: 88px; }
  .sd-item { grid-template-columns: 44px 80px 1fr 140px 130px 110px; gap: 18px; }
  .sd-budget { gap: 56px; }
  .sd-mats { gap: 18px; }
}

@media (max-width: 1023px) {
  .sd-hero { height: auto; min-height: 520px; }
  .sd-hero__body { flex-direction: column; align-items: stretch; gap: 28px; }
  .sd-hero__actions { min-width: 0; flex-direction: row; }
  .sd-hero__actions .btn { flex: 1; }

  .sd-story { grid-template-columns: 1fr; gap: 36px; }
  .sd-story__img { order: -1; aspect-ratio: 3 / 2; }

  /* The popover no longer fits beside its marker — dock it under the image */
  .sd-pop {
    position: static;
    width: auto;
    margin-top: 16px;
  }

  .sd-item {
    grid-template-columns: 32px 72px 1fr auto;
    grid-template-areas:
      "check thumb id     id"
      ".     qty   supply replace";
    gap: 14px 16px;
    align-items: center;
  }
  .sd-item__check   { grid-area: check; }
  .sd-item__thumb   { grid-area: thumb; width: 72px; height: 72px; }
  .sd-item__id      { grid-area: id; }
  .sd-qty           { grid-area: qty; }
  .sd-item__supply  { grid-area: supply; }
  .sd-item__replace { grid-area: replace; justify-self: end; }

  .sd-mats { grid-template-columns: repeat(3, 1fr); }
  .sd-budget { grid-template-columns: 1fr; gap: 56px; }
  .sd-note { flex-direction: column; align-items: flex-start; gap: 24px; padding: 28px 26px; }
  .sd-bundles-wrap { padding-bottom: 88px; }
}

@media (max-width: 767px) {
  .sd-hero { min-height: 440px; }
  .sd-hero__body { bottom: 28px; }
  .sd-hero__lede { font-size: 14.5px; }
  .sd-hero__actions { flex-direction: column; }

  .sd-stage__img { aspect-ratio: 4 / 3; }
  .sd-spot { width: 36px; height: 36px; }
  .sd-spot__dot { width: 26px; height: 26px; font-size: 10.5px; }

  .sd-included { padding-top: 56px; padding-bottom: 48px; }
  .sd-item {
    grid-template-columns: 28px 64px 1fr;
    grid-template-areas:
      "check thumb id"
      "qty   qty   supply"
      "replace replace replace";
    gap: 12px;
  }
  .sd-item__thumb { width: 64px; height: 64px; }
  .sd-item__name { font-size: 17px; }
  .sd-item__supply { justify-self: end; }
  .sd-item__replace { justify-self: start; }
  .sd-included__foot { flex-direction: column; align-items: stretch; gap: 18px; }

  .sd-note__left { flex-direction: column; align-items: flex-start; gap: 16px; }
  .sd-note__title { font-size: 19px; }
  .sd-note__cta { width: 100%; }

  .sd-bundle { padding: 28px 22px; }
  .sd-bundle__cta { align-self: stretch; text-align: center; }
  .sd-mats { grid-template-columns: repeat(2, 1fr); gap: 16px; }

  /* Sticky bar collapses to one line + full-width button */
  .sd-bar { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px var(--gutter); }
  .sd-bar__text { flex-direction: column; gap: 2px; align-items: flex-start; }
  .sd-bar__name { font-size: 16px; }
  .sd-bar__meta { font-size: 11.5px; }
  .sd-bar__cta { width: 100%; padding: 13px 16px; white-space: normal; }
  body.kbh-tpl-scene .site-footer__tail { height: 150px; }
}

/* ---------- Imported-scene additions ---------- */
.sd-story--solo { grid-template-columns: 7fr 5fr; align-items: start; }
.sd-story__prose { font-size: 15.5px; line-height: 1.85; max-width: 62ch; }
.sd-story__prose p { margin: 0 0 16px; }
.sd-story__prose p:last-child { margin-bottom: 0; }
.sd-story__spec { margin-top: 6px; }

.sd-video {
  width: 100%;
  display: block;
  background: var(--ink);
  border: 1px solid var(--rule);
  max-height: 78vh;
}

.sd-plates { display: flex; flex-direction: column; gap: 36px; }
.sd-plates .plate__img--wide { aspect-ratio: auto; max-height: 82vh; object-fit: contain; background: var(--cream-deep); }

@media (max-width: 1023px) {
  .sd-story--solo { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 767px) {
  .sd-plates { gap: 24px; }
}
