/* Chimney Drop order screen v3 (one screen: three bundle rows, the photo with their name, the sticky bar)
   Scoped under .cd-config so it never leaks into the host page. Colors come from the page's own variables
   (--card-solid --card-line --ink --ink-2 --accent --cta-bg ...) with the same values as the fallback,
   so demo.html and the thanks page look the same without page.css.
   Mobile first (390), one column up to 560px, centered after that. */

.cd-config {
  --cd-font: var(--body, "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --cd-display: var(--display, "Big Shoulders Display", "Figtree", system-ui, sans-serif);
  --cd-ink: var(--ink, #24160f);
  --cd-ink-2: var(--ink-2, #5c4535);
  --cd-card: var(--card-solid, #fffaf2);
  --cd-line: var(--card-line, #e3cfaf);
  --cd-pick: var(--accent, #1f5a3a);
  --cd-gold: #f3c55b;
  --cd-gold-ink: #4a3005;
  --cd-tint: #e5f1e8;
  --cd-tint-ink: #17492e;
  --cd-err: #b3141e;
  --cd-cta-bg: var(--cta-bg, linear-gradient(180deg, #de4433 0%, #c22f23 52%, #9c2119 100%));
  --cd-cta-line: var(--cta-line, #8e1c15);
  --cd-cta-ink: var(--cta-ink, #fff8ec);
  --cd-cta-shadow: var(--cta-shadow, 0 12px 22px -8px rgba(110, 18, 12, .55), inset 0 1px 0 rgba(255, 255, 255, .3));
  --cd-out: cubic-bezier(.22, 1, .36, 1);
  --cd-stage-bg: #d9cec1;
  --cd-name-ink: #6E1410;
  --cd-stocking-ink: #b0151d;
  position: relative;
  box-sizing: border-box;
  max-width: 560px; margin-left: auto; margin-right: auto;
  padding: 10px 16px 28px;
  font-family: var(--cd-font);
  color: var(--cd-ink);
  text-align: center;
  overflow-anchor: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
.cd-config *, .cd-config *::before, .cd-config *::after { box-sizing: border-box; }
:where(.cd-config) button, :where(.cd-config) input { font: inherit; color: inherit; }
:where(.cd-config) button { cursor: pointer; -webkit-appearance: none; appearance: none; touch-action: manipulation; }
.cd-config [hidden] { display: none !important; }
.cd-config p { margin: 0; }

/* ---------- the title: dark words at the top of the light panel ---------- */
.cd-head { margin: 0 0 10px; text-align: center; }
.cd-title { margin: 0; font-family: var(--cd-display); font-weight: 900; font-size: 27px; line-height: 1; letter-spacing: .005em; color: var(--cd-ink); text-wrap: balance; }
.cd-spots { margin-top: 4px; font-size: 14px; font-weight: 800; line-height: 1.2; color: #8E1C15; }
.cd-batch { margin-top: 1px; font-size: 12px; font-weight: 700; line-height: 1.25; color: var(--cd-ink-2); text-wrap: balance; }
.cd-rows { display: grid; grid-gap: 8px; margin-top: 0; }

/* ---------- the three bundle rows ---------- */
.cd-brow {
  position: relative; display: block; overflow: visible;
  border-radius: 20px; background: var(--cd-card); border: 1.5px solid var(--cd-line);
  box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .6);
  transition: border-color .2s ease, box-shadow .25s ease, transform .3s var(--cd-out);
}
.cd-brow:not(.is-on) .cd-bhead:active { transform: scale(.985); }
.cd-bhead {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 62px; padding: 7px 40px 7px 40px; border-radius: 18px; cursor: pointer; outline: none;
  transition: transform .25s var(--cd-out);
}
.cd-bhead:focus-visible { outline: 3px solid var(--cd-pick); outline-offset: 2px; }
.cd-bl1 { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 0 10px; max-width: 100%; }
.cd-bname { font-size: 17px; font-weight: 800; line-height: 1.15; letter-spacing: -.005em; }
.cd-bprice { font-size: 26px; font-weight: 900; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cd-bl2 { display: block; margin: 0 -26px; min-height: 17px; font-size: 13.5px; font-weight: 800; line-height: 1.25; color: var(--cd-pick); text-wrap: balance; }
.cd-uplink { color: var(--cd-ink-2); text-decoration: underline; text-decoration-color: var(--cd-pick); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.cd-brow:not(.is-on) .cd-uplink { text-decoration: none; }
.cd-bcheck {
  position: absolute; right: 12px; top: 10px; z-index: 2; width: 24px; height: 24px; border-radius: 50%;
  background: var(--cd-pick); opacity: 0; transform: scale(.5); pointer-events: none;
  transition: opacity .2s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.cd-bcheck svg { width: 100%; height: 100%; display: block; padding: 4px; }
.cd-brow.is-on .cd-bcheck { opacity: 1; transform: none; }
.cd-brow.is-on { border: 3px solid var(--cd-pick); box-shadow: 0 14px 28px -14px rgba(0, 0, 0, .75), 0 0 0 1px rgba(31, 90, 58, .25); }
.cd-brow.is-on .cd-bhead { padding-left: 38.5px; padding-right: 38.5px; min-height: 59px; padding-top: 5.5px; padding-bottom: 5.5px; }
.cd-brow.is-on .cd-bcheck { right: 10.5px; top: 8px; }
.cd-bbadge {
  position: absolute; left: 50%; top: -11px; z-index: 3; transform: translateX(-50%);
  padding: 0 11px; border-radius: 999px; background: var(--cd-gold); color: var(--cd-gold-ink);
  font-size: 12.5px; font-weight: 800; line-height: 22px; white-space: nowrap; pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.cd-brow.has-badge .cd-bhead { padding-top: 12px; }

/* ---------- the selected row opens: the photo, then the name field ---------- */
.cd-bbody { display: none; }
.cd-brow.is-on .cd-bbody { display: block; animation: cd-open .38s var(--cd-out); }
.cd-brow.is-on .cd-bbody { overflow: hidden; border-radius: 0 0 17px 17px; }
@keyframes cd-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.cd-stage { position: relative; display: block; margin: 0; background: var(--cd-stage-bg); overflow: hidden; }
.cd-brow .cd-stage { border-radius: 0; }
.cd-stage.is-photo::after {
  content: ""; position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 78%, rgba(0, 0, 0, .18) 100%);
}
.cd-stage-btn {
  position: relative; display: block; width: 100%; height: 0; padding: 0; overflow: hidden;
  background-color: var(--cd-stage-bg); background-size: cover; background-position: 50% 50%;
}
.cd-field { padding: 8px 12px 11px; border-top: 0; }
.cd-flabel { display: flex; align-items: baseline; justify-content: center; gap: 7px; margin-bottom: 4px; font-size: 14.5px; font-weight: 800; line-height: 1.2; }
.cd-opt { padding: 1px 8px; border-radius: 999px; background: #efe8de; color: #5d5148; font-size: 11.5px; font-weight: 800; }
.cd-in2 {
  display: block; width: 100%; height: 46px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--cd-line); background: #fff;
  font-size: 20px !important; font-weight: 800; color: var(--cd-ink); text-align: center; text-transform: none;
  -webkit-appearance: none; appearance: none;
}
.cd-in2::placeholder { color: #a08e80; font-weight: 700; }
.cd-in2:focus { outline: none; border-color: var(--cd-pick); box-shadow: 0 0 0 3px rgba(31, 90, 58, .14); }
.cd-opt.is-err { background: #fbe3e0; color: var(--cd-err); }

/* ---------- photo layers (every layer is placed in % of the photo) ---------- */
.cd-ph-cam { position: absolute; left: 0; top: 0; right: 0; bottom: 0; display: block; transform-origin: 50% 50%; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.cd-ph-cam.is-fit { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); }
.cd-ph-l { position: absolute; display: block; max-width: none; margin: 0; padding: 0; border: 0; pointer-events: none; -webkit-user-select: none; user-select: none; }
.cd-ph-slot, .cd-ph-sn { position: absolute; left: 0; top: 0; right: 0; bottom: 0; display: block; pointer-events: none; }
.cd-ph-slot .cd-ph-l, .cd-ph-dec { opacity: 0; transition: opacity .38s ease; }
.cd-ph-slot .cd-ph-l.is-in, .cd-ph-dec.is-in { opacity: 1; }
.cd-ph-dec:not([src]) { visibility: hidden; }
/* the name raised on the cream mantel, sized from the photo width (--cdw is set by the script) */
.cd-ph-name { position: absolute; display: flex; align-items: center; justify-content: center; height: calc(var(--cdw, 360px) * .012); white-space: nowrap; overflow: visible; pointer-events: none; }
.cd-ph-name span {
  display: inline-block;
  font-family: "Bricolage Grotesque", var(--cd-font), system-ui, sans-serif;
  font-weight: 900; font-size: calc(var(--cdw, 360px) * .0175); line-height: 1; letter-spacing: .12em; margin-right: -.12em;
  color: var(--cd-name-ink);
  text-shadow: 0 calc(var(--cdw, 360px) * -.0005) 0 rgba(255, 249, 235, .75), 0 calc(var(--cdw, 360px) * .0007) calc(var(--cdw, 360px) * .0005) rgba(74, 22, 12, .55);
  transform-origin: 50% 50%;
}
.cd-ph-sn span {
  position: absolute; display: block; transform: translate(-50%, -50%) rotate(-3deg); text-align: center;
  font-family: "Bricolage Grotesque", var(--cd-font), system-ui, sans-serif; font-weight: 800; font-size: calc(var(--cdw, 360px) * .0125); line-height: 1;
  color: var(--cd-stocking-ink); text-shadow: 0 calc(var(--cdw, 360px) * .0004) 0 rgba(255, 255, 255, .6);
}
.cd-ph-sw { position: absolute; top: 50%; display: block; height: 0; }

/* ---------- the TEST review slot (shown until a real review comes in) ---------- */
.cd-treview { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-top: 12px; padding: 14px 16px; border-radius: 18px; background: var(--cd-card); border: 1.5px solid var(--cd-line); color: var(--cd-ink); }
.cd-tr-stars { font-size: 14px; font-weight: 900; letter-spacing: .06em; color: #b07a12; }
.cd-tr-text { font-size: 15.5px; font-weight: 700; line-height: 1.3; }
.cd-tr-who { font-size: 13px; font-weight: 800; color: var(--cd-ink-2); }

/* ---------- the sticky bar: same look as the page bar (Your total here, Starts at on the page) ---------- */
.cd-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); pointer-events: none; background: none; }
.cd-bar-in {
  pointer-events: auto; max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) 196px; grid-gap: 4px 8px; align-items: center;
  padding: 8px 8px 7px 10px; border-radius: 22px;
  background: var(--cd-card); border: 1.5px solid var(--cd-line);
  box-shadow: 0 18px 38px -14px rgba(0, 0, 0, .75), 0 2px 6px rgba(0, 0, 0, .12);
}
.cd-bar-total { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; text-align: center; color: var(--cd-ink); }
.cd-bar-kick { font-size: 12.5px; font-weight: 800; line-height: 1.1; color: var(--cd-ink-2); }
.cd-bar-amt { font-size: 31px; font-weight: 900; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--cd-ink); }
.cd-bar-ship { font-size: 12.5px; font-weight: 800; line-height: 1.15; color: var(--cd-pick); }
.cd-bar-line { grid-column: 1 / -1; font-size: 12.5px; font-weight: 800; line-height: 1.15; color: var(--cd-pick); font-variant-numeric: tabular-nums; text-wrap: balance; }
.cd-bar-line:empty { display: none; }
.cd-bar-cta { display: block; }
.cd-next {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 0 14px;
  border: 2px solid var(--cd-cta-line); border-radius: 999px; background: var(--cd-cta-bg); color: var(--cd-cta-ink);
  font-size: 15.5px; font-weight: 800; line-height: 1.1; white-space: nowrap; text-shadow: 0 1px 0 rgba(90, 14, 10, .35);
  box-shadow: var(--cd-cta-shadow); transition: transform .3s var(--cd-out), filter .2s ease;
}
.cd-next:active { transform: scale(.97); transition-duration: .1s; }
.cd-next:focus-visible { outline: 3px solid var(--cd-gold); outline-offset: 2px; }
.cd-is-closed .cd-bar { display: none; }
/* keyboard open: the bar steps aside while she types */
.cd-kb .cd-bar { display: none; }
@media (max-width: 360px) {
  .cd-bar-in { grid-template-columns: minmax(0, 1fr) 176px; }
  .cd-next { font-size: 15px; }
}

/* ---------- Santa, brick color and decor tiles (thanks page, mountOptions) ---------- */
.cd-opts { padding: 0; }
.cd-opts .cd-opts-stage { border-radius: 18px; margin-bottom: 14px; }
.cd-opt-group + .cd-opt-group { margin-top: 18px; }
.cd-opt-h { margin: 0 0 8px; font-family: var(--cd-display); font-size: 22px; font-weight: 900; line-height: 1; }
.cd-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); grid-gap: 8px; }
.cd-t2 {
  position: relative; display: flex; flex-direction: column; align-items: stretch; min-height: 112px; padding: 5px 5px 7px;
  border-radius: 14px; background: #fff; border: 1.5px solid var(--cd-line); text-align: center;
}
.cd-t2[aria-checked="true"] { border: 3px solid var(--cd-pick); padding: 3.5px 3.5px 5.5px; }
.cd-t2-sw { position: relative; display: block; height: 58px; border-radius: 10px; overflow: hidden; background: var(--cd-stage-bg); }
.cd-t2-txt { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-top: 5px; }
.cd-t2-label { font-size: 12.5px; font-weight: 800; line-height: 1.15; }
.cd-t2-check { position: absolute; right: -7px; top: -7px; width: 24px; height: 24px; border-radius: 50%; background: var(--cd-pick); border: 2px solid #fff; opacity: 0; transform: scale(.5); transition: opacity .2s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.cd-t2-check svg { width: 100%; height: 100%; display: block; padding: 3px; }
.cd-t2[aria-checked="true"] .cd-t2-check { opacity: 1; transform: none; }
.cd-t2.is-wide { grid-column: span 2; }
.cd-t2:focus-visible { outline: 3px solid var(--cd-pick); outline-offset: 2px; }
.cd-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1.5; white-space: nowrap; }
.cd-badge.is-free { background: #efe8de; color: #5d5148; }
.cd-badge.is-bundle { background: #dcefe2; color: #17492e; }
.cd-badge.is-paid { background: #f1e9df; color: var(--cd-ink); }

@media (prefers-reduced-motion: reduce) {
  .cd-config *, .cd-config *::before, .cd-config *::after { animation: none !important; transition-duration: .15s !important; }
}

/* ---------- the bundle table (Musa 11-05): one clear table, text at the left, the price at the right ---------- */
.cd-rows { grid-gap: 12px; }
.cd-brow, .cd-brow.is-on { border-radius: 18px; overflow: hidden; box-shadow: none; border: 2px solid var(--cd-line); background: var(--cd-card); }
.cd-brow, .cd-brow.is-on { overflow: visible; }
.cd-brow.is-on { border-color: var(--cd-pick); box-shadow: 0 0 0 1px var(--cd-pick); }
.cd-bhead, .cd-brow.is-on .cd-bhead, .cd-brow.has-badge .cd-bhead {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; column-gap: 10px;
  min-height: 0; padding: 12px 12px 10px; text-align: left; border-radius: 16px 16px 0 0;
}
.cd-radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #C9B9A6; background: #fff; position: relative; }
.cd-brow.is-on .cd-radio { border-color: var(--cd-pick); }
.cd-brow.is-on .cd-radio::after { content: ""; position: absolute; left: 3px; top: 3px; right: 3px; bottom: 3px; border-radius: 50%; background: var(--cd-pick); }
.cd-bmain { display: block; min-width: 0; }
.cd-bname { display: block; font-size: 17px; font-weight: 900; line-height: 1.15; }
.cd-bsaves { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.cd-bsave { padding: 2px 8px; border-radius: 999px; background: var(--cd-pick); color: #FFF8EC; font-size: 12px; font-weight: 800; line-height: 1.3; white-space: nowrap; }
.cd-bpct { font-size: 12.5px; font-weight: 700; color: var(--cd-ink-2); white-space: nowrap; }
.cd-bl2, .cd-brow .cd-bl2 { display: block; margin: 4px 0 0; min-height: 0; font-size: 13px; font-weight: 700; line-height: 1.25; color: var(--cd-ink-2); text-wrap: pretty; }
.cd-bside { display: block; text-align: right; align-self: start; }
.cd-bprice { display: block; font-size: 24px; font-weight: 900; line-height: 1.05; }
.cd-bwas { display: block; margin-top: 2px; font-size: 14px; font-weight: 700; color: var(--cd-ink-2); }
.cd-bstrip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 0 0 15px 15px; background: #E9DDCC; color: var(--cd-ink-2); font-size: 13.5px; font-weight: 800; line-height: 1.2; }
.cd-brow.is-on .cd-bstrip { background: var(--cd-pick); color: #FFF8EC; }
.cd-truck { width: 20px; height: 20px; flex: none; }
.cd-bbadge, .cd-brow.has-badge .cd-bbadge { left: auto; right: 10px; top: -12px; transform: none; }
.cd-pickbox { margin-top: 12px; border-radius: 18px; overflow: hidden; background: var(--cd-card); border: 2px solid var(--cd-line); }
.cd-pickbox .cd-stage { border-radius: 0; }
.cd-gifts { margin-top: 12px; padding: 12px; border-radius: 18px; background: var(--cd-card); border: 2px solid var(--cd-line); text-align: center; }
.cd-gifts-h { font-size: 17px; font-weight: 900; line-height: 1.2; }
.cd-gifts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.cd-gift { position: relative; display: block; padding: 14px 6px 8px; border-radius: 14px; border: 2px solid var(--cd-line); background: #fff; font-size: 13px; line-height: 1.2; }
.cd-gift b { display: block; margin-top: 6px; font-weight: 800; }
.cd-gfree { position: absolute; left: 50%; top: -10px; transform: translateX(-50%); padding: 1px 9px; border-radius: 999px; background: var(--cd-pick); color: #FFF8EC; font-size: 12px; font-weight: 800; white-space: nowrap; }
.cd-gpic { display: block; height: 92px; border-radius: 8px; background-image: url(/img/box-cards-540.webp); background-repeat: no-repeat; background-size: 250%; }
.cd-gpic.is-a { background-position: 8% 12%; }
.cd-gpic.is-b { background-position: 86% 62%; }

/* ---------- v4 (Musa 11-05 «ضايعة»): one light panel, white rows, high contrast, no shadows ---------- */
.cd-order { padding: 14px; border-radius: 22px; background: #FFFAF2; }
.cd-rows { grid-gap: 10px; }
.cd-brow, .cd-brow.is-on { background: #FFFFFF; box-shadow: none; }
.cd-brow { border: 2px solid #BDB1A3; }
.cd-brow.is-on { margin: -1px; border: 3px solid var(--cd-pick); box-shadow: none; }
.cd-bhead, .cd-brow.is-on .cd-bhead, .cd-brow.has-badge .cd-bhead { padding: 8px 10px 6px; }
.cd-bbadge, .cd-brow.has-badge .cd-bbadge { top: -14px; box-shadow: none; }
.cd-brow.has-badge .cd-bhead { padding-top: 10px; }
.cd-bsaves { margin-top: 2px; }
.cd-bl2, .cd-brow .cd-bl2 { margin-top: 2px; }
.cd-bprice { font-size: 26px; color: #000000; }
.cd-bwas { margin-top: 1px; font-size: 15px; font-weight: 800; color: #4A3A2E; }
.cd-bstrip { padding: 3px 10px; background: #EFEFEF; color: #3D3D3D; font-size: 13px; }
.cd-truck { width: 18px; height: 18px; }
.cd-pickbox { margin-top: 10px; background: #FFFFFF; border: 2px solid #BDB1A3; }
.cd-field { padding: 8px 12px 10px; }
.cd-pickbox .cd-stage { height: 140px; }
.cd-prio { padding: 9px 12px 10px; border-top: 2px solid #EFE6D8; }
.cd-pickbox > .cd-prio:first-child { border-top: 0; }
.cd-prio-row { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; cursor: pointer; font-size: 16px; font-weight: 800; line-height: 1.2; }
.cd-prio-row input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--cd-pick); }
.cd-nb { white-space: nowrap; }
.cd-prio-note { font-size: 13px; font-weight: 700; line-height: 1.25; color: var(--cd-ink-2); }
.cd-gifts, .cd-treview { background: #FFFFFF; border: 2px solid #BDB1A3; }
