/* Product page upgrades: materials, panels, sample, FAQ, trust chips, zoom.
   Loaded only by product.html — tokens come from styles.css. */

/* ---------- material selector ---------- */
.mats { margin-bottom: 20px; }
.mats__title { display: block; margin-bottom: 10px; }
.mats__cards { display: grid; gap: 10px; }
.mat {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  background: #fff; border: 2px solid var(--line); border-radius: 16px;
  padding: 12px 14px; transition: border-color .2s, box-shadow .2s;
}
.mat:hover { border-color: #d9c8ff; }
.mat:has(input:checked) { border-color: var(--violet); box-shadow: 0 8px 22px rgba(165, 139, 255, .18); }
.mat input {
  accent-color: var(--violet); width: 18px; height: 18px; margin-top: 3px; flex: 0 0 auto; cursor: pointer;
}
.mat__body { display: grid; gap: 3px; min-width: 0; flex: 1; }
.mat__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14.5px; }
.mat__badge {
  font-style: normal; font-size: 11px; font-weight: 800; color: #fff;
  background: linear-gradient(120deg, var(--pink), var(--violet));
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.mat__desc { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); line-height: 1.45; }
.mat__price { font-size: 13px; font-weight: 800; color: var(--ink); margin-top: 2px; }

/* ---------- panel info in calculator ---------- */
.calc__panels {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
}
.calc__panels::before { content: "📐 "; }

/* ---------- flat view: panel overlay + zoom ---------- */
.viewbtn--panels.is-active { background: var(--tint); }
.flatzoom { position: relative; overflow: hidden; cursor: zoom-in; }
.flatzoom.is-zoomed { cursor: zoom-out; }
.flatzoom__inner { position: relative; line-height: 0; transition: transform .35s ease; will-change: transform; }
.panels { position: absolute; inset: 0; pointer-events: none; }
.panels__p {
  position: absolute; top: 0; bottom: 0;
  border-right: 2px dashed rgba(58, 45, 92, .38);
}
.panels__p:last-child { border-right: none; }
.panels__p::after {
  content: "24\2033"; /* 24″ */
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; font-weight: 800; color: var(--ink);
  background: rgba(255, 255, 255, .82); border-radius: 999px; padding: 2px 8px;
  line-height: 1.2;
}

/* ---------- order a sample ---------- */
.samplebox {
  border: 2px dashed var(--violet); border-radius: var(--radius);
  background: #fff; padding: 16px 18px; display: grid; gap: 10px;
}
.samplebox__head { display: flex; align-items: baseline; gap: 6px; font-size: 16px; }
.samplebox__price { font-weight: 800; color: var(--pink); }
.samplebox__points { list-style: none; display: grid; gap: 4px; }
.samplebox__points li { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.samplebox__points li::before { content: "✓ "; color: #2fae7d; font-weight: 800; }
.samplebox__btn { justify-self: start; padding: 10px 22px; font-size: 14px; }
.samplebox__btn:disabled { color: #2fae7d; cursor: default; }

/* ---------- trust chips ---------- */
.trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.trust li {
  font-size: 12px; font-weight: 800; color: var(--ink-soft);
  background: var(--tint); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; white-space: nowrap;
}

/* ---------- FAQ accordion ---------- */
.pdpfaq .section__title, .pdpreviews .section__title { margin-bottom: 24px; }
.faq { display: grid; gap: 12px; max-width: 860px; }
.faq__item {
  background: var(--card, #fff); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
}
.faq__item summary {
  list-style: none; cursor: pointer; padding: 16px 20px;
  font-weight: 800; font-size: 15.5px; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+"; font-size: 20px; font-weight: 800; color: var(--violet);
  width: 28px; height: 28px; border-radius: 50%; background: var(--tint);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; transition: transform .25s;
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p {
  padding: 0 20px 18px; font-size: 14px; font-weight: 600;
  color: var(--ink-soft); line-height: 1.65;
}

/* ---------- fit-to-my-wall crop editor ---------- */
.fitwrap { margin-top: 4px; }
.fitwrap__box {
  display: flex; justify-content: center;
  border-radius: var(--radius); overflow: hidden;
  background: repeating-conic-gradient(#f3ede4 0% 25%, #fbf7f0 0% 50%) 0 0/24px 24px;
  box-shadow: inset 0 0 0 2px var(--line);
  min-height: 160px;
}
#fitCanvas { display: block; max-width: 100%; touch-action: none; cursor: grab; }
#fitCanvas:active { cursor: grabbing; }
.fitctl {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  margin-top: 12px; font-size: 13.5px; font-weight: 700; color: var(--ink);
}
.fitctl label { display: inline-flex; align-items: center; gap: 8px; }
.fitctl input[type="range"] { width: 140px; accent-color: var(--violet); }
.fitctl input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--violet); }
.fitctl__caption { margin-left: auto; font-size: 12.5px; color: var(--ink-soft); }
.fitctl__hint { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-top: 8px; }

/* ---------- ft/cm unit toggle (same segmented control as the studio) ---------- */
.segs { display: inline-flex; gap: 4px; background: var(--tint); border-radius: 999px; padding: 4px; }
.seg {
  border: none; background: transparent; cursor: pointer; border-radius: 999px;
  padding: 9px 18px; font-family: var(--font); font-weight: 700; font-size: 14px; color: var(--ink-soft);
  transition: background .2s, color .2s;
}
.seg.is-active { background: #fff; color: var(--ink); box-shadow: 0 4px 12px rgba(109,95,146,.18); }
.segs--mini .seg { padding: 6px 12px; font-size: 12.5px; }
.calc__units { margin-left: auto; }
/* the calc panel is already tint-colored — lift the pill slightly so it reads */
.calc .segs { background: rgba(255, 255, 255, .6); }
.unitTag { font-size: 13px; font-weight: 800; color: var(--ink-soft); }

/* ================= full-screen product hero (wallism-style) ================= */
.phero {
  position: relative;
  width: 100%;
  height: clamp(540px, 70vh, 820px); /* shorter hero so the buy card straddles its bottom edge */
  background: #ece2d4;
  overflow: visible; /* let the buy card hang out below the image */
}
.phero__canvas { position: absolute; inset: 0; }

/* room preview fills the hero edge-to-edge */
.phero .pdp__room {
  position: absolute; inset: 0;
  aspect-ratio: auto; border-radius: 0; box-shadow: none;
  width: 100%; height: 100%;
}

/* lifestyle photo view fills too */
.phero .pdp__flat { position: absolute; inset: 0; }
.phero .pdp__flat img, .phero .pdp__flat canvas {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* fit-to-wall view centered on checkerboard */
.phero .fitwrap {
  position: absolute; inset: 0; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 26px clamp(16px, 3vw, 40px) 92px;
  background: repeating-conic-gradient(#f3ede4 0% 25%, #fbf7f0 0% 50%) 0 0/26px 26px;
}
.phero .fitwrap__box {
  background: none; box-shadow: none; min-height: 0;
  width: min(1100px, 100%); /* explicit width — centered flex child would otherwise collapse and starve Cropper.layout() */
  display: flex; justify-content: center;
}
.phero #fitCanvas { box-shadow: 0 18px 50px rgba(58, 45, 92, .28); border-radius: 6px; }
.phero .fitctl {
  margin-top: 2px; background: rgba(255, 255, 255, .92);
  border-radius: 999px; padding: 8px 18px; box-shadow: var(--shadow);
}
.phero .fitctl__hint { margin: 0; }

/* overlays */
.phero__crumbs {
  position: absolute; top: 16px; left: 20px; z-index: 6; margin: 0;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(4px);
  padding: 8px 16px; border-radius: 999px; box-shadow: 0 4px 14px rgba(58, 45, 92, .12);
}
.phero__bottom {
  position: absolute; left: 0; bottom: 16px; z-index: 6;
  right: min(490px, 34vw); /* stay clear of the rail */
  display: grid; gap: 8px; justify-items: center;
}
.phero__bottom .pdp__stagehint {
  margin: 0; background: rgba(255, 255, 255, .82);
  padding: 6px 14px; border-radius: 999px;
}
.phero__bottom .viewbtn { box-shadow: 0 6px 18px rgba(58, 45, 92, .14); }

/* right rail — compact size/price card + sample card, straddling the
   hero's bottom edge (wallism style) */
.phero__rail {
  position: absolute; top: clamp(400px, 80%, 680px); right: 20px; z-index: 7;
  width: min(450px, 92vw);
  display: grid; gap: 14px;
}
.railcard {
  background: #fff; border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(58, 45, 92, .28);
  padding: 20px;
}
/* keep the whole dimensions row on one line inside the rail */
.railcard .calc__fields { gap: 10px; flex-wrap: nowrap; }
.railcard .calc__fields input { width: 66px; }
.railcard .calc__fields label { white-space: nowrap; }

.pdp__curmat {
  font-size: 12px; font-weight: 800; color: var(--violet);
  background: #f6f2ff; border-radius: 999px; padding: 4px 10px; margin-left: 8px;
  vertical-align: middle;
}

/* title below the image */
.ptitle { padding-top: 34px; padding-bottom: 0; }
.ptitle .pdp__name { font-size: clamp(28px, 3.4vw, 44px); }
/* rail now hangs deep below the hero — clear it through title + product info */
@media (min-width: 1061px) {
  .ptitle { margin-right: 470px; }
  .pinfo { min-height: 760px; }
  .pinfo__grid { margin-right: 470px; }
}

/* stacked layout on smaller screens */
@media (max-width: 1060px) {
  .phero { height: auto; min-height: 0; }
  .phero__canvas { position: relative; height: 56vh; min-height: 380px; }
  .phero .fitwrap { padding-bottom: 26px; }
  .phero__bottom { position: relative; right: auto; bottom: auto; padding: 12px; }
  .phero__rail {
    position: relative; inset: auto; width: auto;
    margin: 4px 14px 20px;
  }
  .railcard { box-shadow: var(--shadow); }
}

/* ================= wallism hero chrome: thumbs, arrows, similar ================= */
.phero__thumbs {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  padding: 4px;
}
.phero__thumb {
  position: relative; width: 74px; height: 56px;
  border-radius: 10px; overflow: hidden; padding: 0;
  border: 3px solid rgba(255, 255, 255, .85); cursor: pointer;
  background: var(--tint); box-shadow: 0 6px 18px rgba(58, 45, 92, .22);
  transition: transform .18s, border-color .18s;
}
.phero__thumb:hover { transform: translateY(-3px); }
.phero__thumb.is-active { border-color: var(--violet); }
.phero__thumb img, .phero__thumb canvas {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.phero__thumbtag {
  position: absolute; right: 3px; bottom: 3px;
  background: rgba(255, 255, 255, .92); border-radius: 6px;
  font-size: 11px; padding: 1px 4px; line-height: 1.3;
}

.phero__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .92); color: var(--ink);
  font-size: 26px; font-weight: 700; font-family: var(--font); line-height: 1;
  box-shadow: 0 8px 24px rgba(58, 45, 92, .22);
  transition: transform .18s, background .18s;
  display: grid; place-items: center; padding-bottom: 4px;
}
.phero__arrow:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.phero__arrow--prev { left: 18px; }
.phero__arrow--next { right: 18px; } /* symmetric with the left arrow */

.phero__similar {
  position: absolute; top: 16px; right: 18px; z-index: 6;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(4px);
  padding: 8px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 800; color: var(--ink); text-decoration: none;
  box-shadow: 0 4px 14px rgba(58, 45, 92, .12);
}
.phero__similar:hover { color: var(--pink); }

/* buy box: wallism info order */
.calc__bleed { margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.buybullets { list-style: none; display: grid; gap: 7px; margin-top: 16px; }
.buybullets li { font-size: 13px; font-weight: 700; color: var(--ink-soft); }

/* product info section */
.pinfo__grid {
  display: grid; grid-template-columns: 1fr 1.3fr;
  gap: clamp(20px, 4vw, 48px); align-items: start; max-width: 1100px;
}
.pinfo__art { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.pinfo__art canvas { width: 100%; display: block; }
.pinfo__text .pdp__desc { font-size: 16px; margin-bottom: 18px; }

@media (max-width: 1060px) {
  .phero__arrow--next { right: 18px; }
  .phero__similar { right: 18px; }
  .pinfo__grid { grid-template-columns: 1fr; }
}

/* ============ type scale calibrated to giffywalls PDP (measured) ============
   h1 30/400·lh1.3 | body 16/400·lh1.6 | h2 24 | buttons 15 | option labels 13 */
.ptitle .pdp__name { font-size: 30px; font-weight: 600; line-height: 1.3; }
.pdp__meta { font-size: 14px; gap: 8px; }
.pdp__type { font-size: 13px; font-weight: 600; }
.pdp__price { font-size: 15px; margin: 2px 0 10px; }
.pdp__price b { font-size: 22px; font-weight: 700; }
.pdp__curmat { font-size: 11.5px; }
.pdp__desc, .pinfo__text .pdp__desc { font-size: 16px; font-weight: 400; line-height: 1.65; }
.railcard .calc > b { font-size: 15px; font-weight: 700; }
.railcard .calc__fields label { font-size: 13px; font-weight: 600; }
.railcard .calc__fields input { font-size: 16px; font-weight: 700; }
.calc__out { font-size: 13px; }
.calc__out b { font-size: 17px; font-weight: 700; }
.calc__panels, .calc__bleed { font-size: 12.5px; font-weight: 600; }
.mats__title { font-size: 14px; font-weight: 700; }
.mat__top { font-size: 14px; }
.mat__top b { font-weight: 600; }
.mat__desc { font-weight: 500; }
.mat__price { font-size: 13px; font-weight: 700; }
.railcard .btn { font-size: 15px; font-weight: 700; }
.buybullets li { font-size: 12.5px; font-weight: 600; }
.samplebox__head { font-size: 15px; }
.samplebox__head b { font-weight: 600; }
main.page .section__title { font-size: 24px; font-weight: 700; }
.faq__item summary { font-size: 15px; font-weight: 600; }
.faq__item p { font-size: 14.5px; font-weight: 400; line-height: 1.65; }
.pdpreviews .review p { font-size: 14.5px; font-weight: 400; line-height: 1.6; }
.pdpreviews .review b { font-weight: 600; }
.pdp__specs li { font-weight: 500; }
.pdp__stagehint, .fitctl__hint, .fitctl__caption { font-weight: 500; }

/* ============ giffywalls-style clean dimensions card ============ */
.dims__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dims__head > b { font-size: 14px; font-weight: 700; }
.dims__wish {
  border: none; background: none; cursor: pointer; font-family: var(--font);
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft); padding: 4px 0;
}
.dims__wish:hover, .dims__wish.is-on { color: var(--pink); }

/* full-width rectangular unit tabs (active = ink) */
.unittabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.unittabs .seg {
  background: #fff; border: none; border-radius: 0; padding: 10px 0;
  font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--ink-soft);
  box-shadow: none; cursor: pointer;
}
.unittabs .seg + .seg { border-left: 1px solid var(--line); }
.unittabs .seg.is-active { background: var(--ink); color: #fff; box-shadow: none; }

/* labels above, unit inside the input box */
.dims { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.dims__label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.dim {
  display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; padding: 0 12px; transition: border-color .15s;
}
.dim:focus-within { border-color: var(--ink); }
.dim input {
  border: none; outline: none; width: 100%; min-width: 0; padding: 11px 0;
  font-family: var(--font); font-size: 16px; font-weight: 700; color: var(--ink);
  -moz-appearance: textfield;
}
.dim input::-webkit-outer-spin-button, .dim input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dim .unitTag { font-size: 12px; font-weight: 600; color: var(--ink-soft); padding-left: 8px; }

/* paper-type tiles (compact, active = ink) */
.railcard .mats { margin-bottom: 12px; }
.railcard .mats__title { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.mats__tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mats__tiles .mat { padding: 10px 6px; border-radius: 8px; border: 1px solid var(--line); box-shadow: none; }
.mats__tiles .mat input { position: absolute; opacity: 0; pointer-events: none; }
.mats__tiles .mat__body { display: grid; justify-items: center; gap: 3px; text-align: center; width: 100%; }
.mats__tiles .mat__top { justify-content: center; font-size: 12px; line-height: 1.25; }
.mats__tiles .mat__top b { font-weight: 600; }
.mats__tiles .mat__badge, .mats__tiles .mat__desc { display: none; }
.mats__tiles .mat__price { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); margin: 0; }
.mats__tiles .mat:has(input:checked) { background: var(--ink); border-color: var(--ink); box-shadow: none; }
.mats__tiles .mat:has(input:checked) .mat__top b,
.mats__tiles .mat:has(input:checked) .mat__price { color: #fff; }

/* selected-material summary band */
.matsum {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #f6f3ef; border-radius: 8px; padding: 12px 14px; margin-bottom: 12px;
}
.matsum__info { display: grid; gap: 2px; min-width: 0; }
.matsum__info b { font-size: 14px; font-weight: 700; }
.matsum__info span { font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.matsum__price { font-size: 13px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.matsum__price b { font-size: 20px; font-weight: 700; color: var(--ink); }

.railcard .calc__out { margin-bottom: 2px; }
.railcard .pdp__actions { margin-top: 12px; }
.railcard .pdp__actions .btn { flex: 1; }
.trust--rail { margin-top: 14px; gap: 6px; }
.trust--rail li { font-size: 11px; padding: 5px 10px; }
