/* ==========================================================================
   Vista Blocks: product page (Gallery & Buy Box, See It Installed, Reviews).
   Ported from the approved prototype (assets/css/product.css). Colours and
   fonts come from the theme's Global Styles through the tokens in blocks.css.
   ========================================================================== */
:root { --radius: 2px; --card: var(--wp--preset--color--card, #EEE7DB); --sage-deep: var(--wp--preset--color--sage-deep, #666B55); --terracotta-deep: var(--wp--preset--color--terracotta-deep, #8C4D35); }

.pdp-wrap, .pdp-installed, .pdp-reviews { font-family: var(--sans); color: var(--charcoal); }
.pdp-wrap *, .pdp-installed *, .pdp-reviews * { box-sizing: border-box; }
:where(.pdp-wrap, .pdp-reviews) button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.pdp-wrap svg, .pdp-installed svg, .pdp-reviews svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.pdp-wrap a, .pdp-installed a, .pdp-reviews a { color: inherit; text-decoration: none; }
.pdp-wrap img, .pdp-installed img, .pdp-reviews img { max-width: 100%; display: block; }
.pdp-wrap h1, .pdp-installed h2, .pdp-reviews h3 { margin: 0; }
.pdp-wrap p, .pdp-installed p, .pdp-reviews p { margin: 0; }
.pdp-container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.vista-product-placeholder { padding: 40px; text-align: center; background: var(--paper); border: 1px dashed var(--line); color: var(--ink-soft); font-size: 14px; }

/* ---------- Layout ---------- */
.pdp__crumbs { padding: 26px 0 22px; }
.pdp { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 4.5vw, 72px); align-items: start; padding-bottom: clamp(56px, 7vw, 96px); }

/* ---------- Gallery ---------- */
.pgallery { position: sticky; top: 140px; }
.admin-bar .pgallery { top: 172px; }
.stagewrap { position: relative; --stage-ar: 5 / 4; }
.stagewrap--wide { --stage-ar: 16 / 9; }
.stage { position: relative; aspect-ratio: var(--stage-ar); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; outline: none; }
.stage:focus-visible { box-shadow: inset 0 0 0 2px var(--brass); }
.stage__view { position: absolute; inset: 0; opacity: 0; transition: opacity .5s var(--ease); }
.stage__view[hidden] { display: none; }
.stage__view.is-active { opacity: 1; }
.stage__view.is-active.is-entering { opacity: 0; }
.stage__cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage__frame { position: absolute; inset: 9% 9% 11%; container-type: size; display: grid; place-items: center; }
.stage__frame--layout { inset: 11% 11% 16% 14%; }
.stage__art { position: relative; width: min(100cqw, 100cqh * var(--ratio)); aspect-ratio: var(--ratio); transition: width .45s var(--ease); box-shadow: 0 24px 40px -18px rgba(33,27,22,.5), 0 2px 6px rgba(33,27,22,.12); overflow: hidden; }
.stage__frame--layout .stage__art { overflow: visible; }
.stage__art img { width: 100%; height: 100%; object-fit: cover; }

/* hover magnifier */
.zoomable img, .zoomable-img { transition: transform .35s var(--ease); transform-origin: var(--zx, 50%) var(--zy, 50%); cursor: zoom-in; }
.zoomable.is-zoom img, .zoomable-img.is-zoom { transform: scale(2.2); }

/* tile layout preview */
.stage__grid { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(to right, rgba(255,253,249,.92) 1.5px, transparent 1.5px), linear-gradient(to bottom, rgba(255,253,249,.92) 1.5px, transparent 1.5px);
  background-size: calc(100% / var(--c)) calc(100% / var(--r));
  box-shadow: inset 0 0 0 1.5px rgba(255,253,249,.92); }
.dim { position: absolute; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .1em; color: var(--brass-deep); white-space: nowrap; }
.dim::before, .dim::after { content: ""; flex: 1; height: 1px; background: var(--brass); }
.dim--w { left: 0; right: 0; top: -26px; }
/* vertical label: text runs bottom-to-top, lines extend above and below it */
.dim--h { top: 0; bottom: 0; left: -30px; writing-mode: vertical-rl; transform: rotate(180deg); }
.dim--h::before, .dim--h::after { width: 1px; height: auto; }
.stage__note { position: absolute; left: 0; right: 0; bottom: 4.5%; text-align: center; font-size: 12px; letter-spacing: .08em; color: var(--ink-soft); }

.stage__nav { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 14px; pointer-events: none; }
.stage__arrow { pointer-events: auto; width: 42px; height: 42px; border-radius: 50%; background: color-mix(in srgb, var(--paper) 88%, transparent) !important; box-shadow: 0 4px 14px rgba(33,27,22,.15); display: grid; place-items: center; opacity: 0; transition: opacity .3s, transform .3s; }
.stage__arrow svg { width: 18px !important; height: 18px !important; }
.pgallery:hover .stage__arrow, .stage__arrow:focus-visible { opacity: 1; }
.stage__arrow:hover { transform: scale(1.06); }

.thumbs { display: flex; gap: 12px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb { flex: none; display: grid; gap: 7px; justify-items: center; width: 84px; }
.thumb__img { position: relative; width: 84px; height: 84px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; display: grid; place-items: center; transition: box-shadow .25s; }
.thumb__img img { width: 100%; height: 100%; object-fit: cover; }
.thumb__img img.contain { width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(33,27,22,.25)); }
.thumb__grid { position: absolute; inset: 11%; background-image: linear-gradient(to right, rgba(255,253,249,.9) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,253,249,.9) 1px, transparent 1px); background-size: 25% 25%; }
.thumb__play { position: absolute; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--charcoal) 70%, transparent); }
.thumb__play::after { content: ""; position: absolute; left: 12px; top: 9px; border: 6px solid transparent; border-left: 9px solid var(--ivory); }
.thumb__label { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.thumb:hover .thumb__img { box-shadow: inset 0 0 0 1px var(--brass); }
.thumb.is-active .thumb__img { box-shadow: inset 0 0 0 2px var(--charcoal); }
.thumb.is-active .thumb__label { color: var(--charcoal); }

/* ---------- Info ---------- */
.pdp__info .eyebrow { margin-bottom: 10px; }
.pdp__title { font-family: var(--display); font-weight: 500; font-size: var(--wp--preset--font-size--subtitle, clamp(22px, 2.2vw, 30px)); letter-spacing: .04em; line-height: 1.2; color: var(--charcoal); }
.pdp__rating { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12.5px; color: var(--ink-soft); }
.pdp__rating:hover span { color: var(--terracotta); }
.pdp__price { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 22px 0 16px; padding-top: 20px; border-top: 1px solid var(--line); }
.pdp__amount { font-family: var(--serif); font-size: 36px; font-weight: 500; line-height: 1; }
.pdp__per { font-size: 12.5px; color: var(--ink-soft); letter-spacing: .04em; }
.pdp__blurb { color: var(--ink-soft); font-weight: 300; line-height: 1.75; }
.pdp__blurb p + p { margin-top: 10px; }

.opt { margin-top: 28px; }
.opt__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.opt__label { font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }
.opt__value { font-size: 13px; color: var(--ink-soft); }
.opt--fixed { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 26px 0 0 !important; }
.placement { width: 100%; height: 50px; padding: 0 40px 0 14px; border: 1px solid var(--line); border-radius: 0; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23242522' stroke-width='1.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px; color: var(--charcoal); font: inherit; font-size: 14px; appearance: none; -webkit-appearance: none; cursor: pointer; }
.placement:focus, .frame-color:focus { outline: 2px solid var(--charcoal); outline-offset: 1px; }
.frame-color { width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 0; background: var(--paper); color: var(--charcoal); font: inherit; font-size: 14px; }
.placement.is-invalid { border-color: var(--terracotta); box-shadow: inset 0 0 0 1px var(--terracotta); }
.opt__note { margin-top: 8px !important; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.opt__help { margin-left: auto !important; font-size: 12px !important; color: var(--brass-deep) !important; text-decoration: underline; text-underline-offset: 3px; }
.opt__help:hover { color: var(--terracotta) !important; }

.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.sizes__group { grid-column: 1 / -1; margin: 6px 0 -2px !important; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.sizes__group:first-child { margin-top: 0 !important; }
.size { display: grid !important; justify-items: center; gap: 3px; padding: 14px 8px 12px !important; background: var(--paper) !important; border: 1px solid var(--line) !important; text-align: center; transition: border-color .2s, box-shadow .2s; }
.size:hover { border-color: color-mix(in srgb, var(--charcoal) 45%, transparent) !important; }
.size.is-active { border-color: var(--charcoal) !important; box-shadow: inset 0 0 0 1px var(--charcoal); }
.size__shape { width: 46px; height: 40px; display: grid; place-items: center; margin-bottom: 6px; }
.size__shape i { display: block; border: 1.5px solid var(--brass); background: color-mix(in srgb, var(--brass) 12%, transparent); }
.size.is-active .size__shape i { background: color-mix(in srgb, var(--brass) 30%, transparent); }
.size__shape--custom svg { width: 22px !important; height: 22px !important; color: var(--brass); }
.size__dims { font-size: 13.5px; font-weight: 600; }
.size__tiles { font-size: 11px; color: var(--ink-soft); }
.size__price { font-size: 12.5px; font-weight: 500; margin-top: 2px; }
.size--custom { border-style: dashed !important; }
.size--custom .size__price { color: var(--terracotta); }

.finishes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.finish { display: grid !important; gap: 2px; padding: 12px 14px !important; text-align: left; background: var(--paper) !important; border: 1px solid var(--line) !important; transition: border-color .2s, box-shadow .2s; }
.finish strong { font-size: 13px; font-weight: 600; letter-spacing: .06em; }
.finish span { font-size: 11.5px; color: var(--ink-soft); }
.finish:hover { border-color: color-mix(in srgb, var(--charcoal) 45%, transparent) !important; }
.finish.is-active { border-color: var(--charcoal) !important; box-shadow: inset 0 0 0 1px var(--charcoal); }

.pdp__buy { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 30px; }
.pdp__add { height: 52px; padding: 0 20px !important; }
.pdp__add-sep { display: inline-block; width: 14px; height: 1px; margin: 0 12px; background: currentColor; opacity: .6; vertical-align: middle; }
.pdp__add.is-busy { opacity: .7; pointer-events: none; }
.pdp__add.is-added, .buybar .btn.is-added { background: var(--sage-deep) !important; }
.pdp__msg { margin-top: 12px !important; font-size: 13px; color: var(--terracotta-deep); }
.pdp__msg.is-ok { color: var(--sage-deep); }
.pdp__msg a { text-decoration: underline; text-underline-offset: 3px; }
.pdp__ship { display: flex; align-items: center; gap: 10px; margin-top: 16px !important; font-size: 12.5px; color: var(--ink-soft); }
.pdp__ship svg { width: 20px !important; height: 20px !important; color: var(--brass); flex: none; }
.pdp__ship strong { font-weight: 600; color: var(--charcoal); }
.pdp__perks { list-style: none; padding: 18px 0; margin: 20px 0 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pdp__perks li { display: grid; justify-items: center; gap: 8px; text-align: center; font-size: 11px; font-weight: 500; letter-spacing: .06em; color: var(--ink-soft); margin: 0; }
.pdp__perks svg { width: 24px !important; height: 24px !important; color: var(--brass); stroke-width: 1.2 !important; }
.pdp__acc { margin-top: 18px; }
.specs { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.specs th, .specs td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs th { width: 38%; font-weight: 600; color: var(--charcoal); }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }

/* ---------- See it installed ---------- */
.pdp-installed { padding-left: 0 !important; padding-right: 0 !important; }
.pdp-installed__grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }
.pdp-installed__main { min-height: 520px; margin: 0; }
.pdp-installed__side { display: grid; grid-template-rows: auto 1fr; gap: 20px; }
.pdp-installed__video, .pdp-installed__detail { position: relative; aspect-ratio: 16 / 10; margin: 0; overflow: hidden; background: var(--charcoal); }
.pdp-installed__video video, .pdp-installed__detail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pdp-installed__text { background: var(--paper); padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; justify-content: center; }
.pdp-installed__text .eyebrow { margin-bottom: 14px; }
.pdp-installed__text .section__title { text-align: left; font-size: clamp(22px, 2.2vw, 30px); }
.pdp-installed__text .section__title::after { display: none; }
.pdp-installed__text > p:not(.eyebrow) { margin: 14px 0 18px; color: var(--ink-soft); font-weight: 300; line-height: 1.75; }

/* ---------- Reviews ---------- */
.pdp-reviews { padding-left: 0 !important; padding-right: 0 !important; }
.pdp-reviews__grid { display: grid; grid-template-columns: 300px 1fr; gap: clamp(32px, 6vw, 90px); }
.rsum { display: grid; justify-items: start; gap: 8px; align-content: start; }
.rsum .eyebrow { margin-bottom: 6px; }
.rsum__score { font-family: var(--serif); font-size: 64px; line-height: 1; }
.rsum .stars svg { width: 18px !important; height: 18px !important; }
.rsum__count { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px !important; }
.rsum__bars { width: 100%; display: grid; gap: 6px; margin-bottom: 18px; }
.rbar { display: grid; grid-template-columns: 26px 1fr 36px; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-soft); }
.rbar i { height: 4px; background: var(--line); }
.rbar b { display: block; height: 100%; background: var(--brass); }
.rbar em { font-style: normal; text-align: right; }
.rlist { display: grid; gap: 0; align-content: start; }
.rev { padding: 26px 0; border-bottom: 1px solid var(--line); }
.rev:first-child { padding-top: 0; }
.rev__head { display: flex; justify-content: space-between; align-items: center; }
.rev__size { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.rev h3 { font-family: var(--serif); font-size: 23px; font-weight: 500; margin: 10px 0 6px; letter-spacing: 0; text-transform: none; color: var(--charcoal); }
.rev p, .rev__body { color: var(--ink-soft); font-weight: 300; line-height: 1.75; }
.rev__body { margin-top: 10px; }
.rev cite { display: block; margin-top: 10px; font-style: normal; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; }
.rlist__note { margin-top: 16px !important; font-size: 11.5px; color: color-mix(in srgb, var(--ink-soft) 75%, transparent); font-style: italic; }
.rlist__empty { color: var(--ink-soft); font-weight: 300; padding: 20px 0; }

.review-form { margin-top: 30px; padding: 30px; background: var(--paper); border: 1px solid var(--line); }
.review-form[hidden] { display: none; }
.review-form__title { font-family: var(--display); font-size: 20px; font-weight: 500; letter-spacing: .06em; margin: 0 0 18px; }
.review-form p { margin: 0 0 16px; }
.review-form label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 8px; }
.review-form input[type="text"], .review-form input[type="email"], .review-form input[type="url"], .review-form select, .review-form textarea { width: 100%; padding: 12px 14px; font: inherit; font-size: 14px; color: var(--charcoal); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.review-form input:focus, .review-form select:focus, .review-form textarea:focus { outline: 0; border-color: var(--charcoal); }
.review-form .comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-soft); }
.review-form .comment-form-cookies-consent label { display: inline; font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 400; }
.review-form .required { color: var(--terracotta); }
.review-form .form-submit { margin: 0; }

/* ---------- Sticky buy bar ---------- */
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: color-mix(in srgb, var(--ivory) 96%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(36,37,34,.08); transform: translateY(110%); transition: transform .45s var(--ease); }
.buybar.is-shown { transform: none; }
.buybar__inner { display: flex; align-items: center; gap: 20px; padding-top: 12px; padding-bottom: 12px; }
.buybar__prod { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.buybar__img { width: 52px; height: 52px; flex: none; background: var(--paper); display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); }
.buybar__img img { width: 80%; height: 80%; object-fit: contain; }
.buybar__prod strong { display: block; font-family: var(--serif); font-size: 20px; font-weight: 500; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buybar__prod span:not(.buybar__img) { font-size: 12px; color: var(--ink-soft); }
.buybar__price { font-family: var(--serif); font-size: 24px; }
.buybar .btn { padding: 14px 28px; }

/* WooCommerce notices (added to cart, errors) sit in the page column */
.pdp-main .wc-block-store-notices, .pdp-main .woocommerce-notices-wrapper { max-width: var(--maxw); margin: 16px auto 0; padding: 0 var(--gutter); }

/* ---------- Tablet and phone ---------- */
@media (max-width: 980px) {
  .pdp { grid-template-columns: minmax(0, 1fr); }
  .pgallery { position: static; }
  .stage__arrow { opacity: 1; }
  .pdp-installed__grid { grid-template-columns: minmax(0, 1fr); }
  .pdp-installed__main { min-height: 360px; }
  .pdp-reviews__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .stagewrap { --stage-ar: 1; }
  .stagewrap--wide { --stage-ar: 4 / 3; }
  .stage__nav { padding: 0 8px; }
  .stage__arrow { width: 36px; height: 36px; }
  .thumb, .thumb__img { width: 68px; }
  .thumb__img { height: 68px; }
  .sizes { grid-template-columns: repeat(2, 1fr); }
  .pdp__add { padding: 0 12px !important; font-size: 11px !important; }
  .pdp__add-sep { margin: 0 8px; width: 10px; }
  .pdp__perks li { font-size: 10px; }
  .buybar__price, .buybar__prod span:not(.buybar__img) { display: none; }
  .buybar__prod strong { font-size: 17px; }
  .buybar .btn { padding: 13px 18px; }
  .review-form { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .stage__view, .stage__art, .zoomable img, .zoomable-img, .buybar, .accordion__panel { transition: none !important; }
}

/* WooCommerce sets "height: auto" on store-page images; keep our frames filled */
body .stage__cover, body .stage__art img, body .pdp-installed__video video, body .pdp-installed__detail img { height: 100%; }
body .thumb__img img { height: 100%; }
body .thumb__img img.contain { height: 78%; }
body .buybar__img img { height: 80%; }
