/* ==========================================================================
   FrameX — product system: ProductPage, ProductGallery and its sections.
   Layout uses CONTAINER queries (not viewport media queries) so the very same
   page renders correctly on product.html and inside the shop dashboard's
   desktop / mobile preview. Motion is subtle and switched off for
   prefers-reduced-motion.
   ========================================================================== */

/* Components below set display on elements that are toggled with [hidden]. */
.pp [hidden],
.pg [hidden] {
  display: none !important;
}

.pp {
  container: pp / inline-size;
  --pp-radius: 20px;
  --pp-panel: var(--ivory);
  --pp-line: var(--line-warm);
}

/* ---------------------------------------------------------------- Top: gallery + info */
.pp-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(20px, 4cqi, 52px);
}

@container pp (min-width: 860px) {
  .pp-top {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    align-items: start;
  }
  .pp-media {
    position: sticky;
    top: calc(var(--header-h) + 16px);
  }
}

/* ---------------------------------------------------------------- Gallery */
.pg {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.pg-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--pp-radius, 20px);
  background: radial-gradient(120% 90% at 50% 20%, #fbf7f0 0%, var(--beige) 100%);
  touch-action: pan-y;
  outline: none;
}

.pg-stage:focus-visible {
  box-shadow: var(--focus-ring);
}

.pg-stage__frame {
  position: absolute;
  inset: 0;
  cursor: zoom-in;
}

.pg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: translateX(calc(var(--dir, 0) * 3%)) scale(1.015);
  transition: opacity 480ms var(--ease-out), transform 620ms var(--ease-out);
  user-select: none;
  -webkit-user-drag: none;
}

.pg-img.is-active {
  opacity: 1;
  transform: none;
}

.pg-img.is-leaving {
  opacity: 0;
  transform: translateX(calc(var(--dir, 0) * -2.5%)) scale(0.99);
}

.pg-stage.is-zoomed {
  touch-action: none;
}

.pg-stage.is-zoomed .pg-stage__frame {
  cursor: zoom-out;
}

.pg-stage.is-zoomed .pg-img.is-active {
  transform: scale(2.2);
  transition: transform 320ms var(--ease-out);
}

.pg-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 120px);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  color: var(--umber);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.pg-tag:has(span:empty + span:empty) {
  display: none;
}

.pg-tag__count {
  color: var(--taupe);
  font-weight: 600;
}

.pg-tag span:first-child:not(:empty) + .pg-tag__count:not(:empty)::before {
  content: "·";
  margin-right: 8px;
}

.pg-btn,
.pg-nav {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(5, 8, 22, 0.12);
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}

.pg-btn:hover,
.pg-nav:hover {
  transform: scale(1.06);
  background: var(--white);
}

.pg-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--white);
}

.pg-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
}

.pg-nav {
  position: absolute;
  top: 50%;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  opacity: 0;
}

.pg-nav--prev {
  left: 12px;
}

.pg-nav--next {
  right: 12px;
}

.pg-stage:hover .pg-nav,
.pg-stage:focus-within .pg-nav {
  opacity: 1;
}

@media (hover: none) {
  .pg-nav {
    opacity: 1;
    width: 40px;
    height: 40px;
    margin-top: -20px;
  }
}

.pg-stage.is-zoomed .pg-nav,
.pg-stage.is-360 .pg-nav {
  opacity: 0;
  pointer-events: none;
}

.pg-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid rgba(112, 69, 41, 0.18);
  border-top-color: var(--brown-deep);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.pg-stage.is-loading .pg-spinner {
  opacity: 1;
  animation: pg-spin 0.8s linear infinite;
}

@keyframes pg-spin {
  to {
    transform: rotate(360deg);
  }
}

.pg-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}

.pg-thumb {
  flex: none;
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 78px;
  color: var(--taupe);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
}

.pg-thumb__img {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--beige);
  opacity: 0.72;
  transition: opacity var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.pg-thumb__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pg-thumb:hover .pg-thumb__img {
  opacity: 1;
  transform: translateY(-2px);
}

.pg-thumb[aria-selected="true"] {
  color: var(--ink);
}

.pg-thumb[aria-selected="true"] .pg-thumb__img {
  border-color: var(--amber-strong);
  opacity: 1;
}

.pg-thumb--360 b {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--brown-deep);
}

.pg-thumb__label {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 360° */
.pg-360 {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: inherit;
  cursor: grab;
  touch-action: pan-y;
}

.pg-360:active {
  cursor: grabbing;
}

.pg-360__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.pg-360__status {
  position: absolute;
  inset: auto 0 50%;
  text-align: center;
  color: var(--umber);
  font-weight: 600;
}

.pg-360__status:empty {
  display: none;
}

.pg-360__bar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
}

.pg-360__hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.9);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}

/* Fullscreen lightbox (the same component, larger) */
.pg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  align-content: center;
  padding: clamp(10px, 3vw, 32px);
  background: rgba(2, 3, 10, 0.94);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}

.pg-lightbox.is-open {
  opacity: 1;
}

.pg--lightbox {
  width: min(1200px, 100%);
  margin: 0 auto;
}

.pg--lightbox .pg-stage {
  aspect-ratio: auto;
  height: min(78vh, calc(100vh - 150px));
  background: transparent;
}

.pg--lightbox .pg-thumbs {
  justify-content: center;
}

.pg--lightbox .pg-thumb {
  color: var(--mist);
}

.pg--lightbox .pg-thumb[aria-selected="true"] {
  color: var(--white);
}

.pg--lightbox .pg-360 {
  background: transparent;
}

html.pg-locked,
html.pg-locked body {
  overflow: hidden;
}

/* ---------------------------------------------------------------- Info column */
.pp-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.pp-info__shop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  min-height: 44px;
  margin: -6px 0;
  color: var(--taupe);
  font-size: var(--text-sm);
  font-weight: 600;
}

.pp-info__shop:hover {
  color: var(--ink);
}

.pp-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.pp-rating .icon {
  color: var(--star);
}

.pp-rating span {
  color: var(--taupe);
  font-weight: 500;
}

.pp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pp-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.pp-price s {
  color: var(--slate);
  font-size: 1.05rem;
}

.pp-breakdown {
  display: grid;
  gap: 4px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--ivory);
  font-size: var(--text-sm);
}

.pp-breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.pp-breakdown dt {
  color: var(--taupe);
}

.pp-breakdown dd {
  font-weight: 700;
}

.pp-stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 700;
}

.pp-stock--in {
  color: var(--success);
}

.pp-stock--low {
  color: #b45309;
}

.pp-stock--out {
  color: var(--danger);
}

.pp-lead {
  color: var(--muted);
  line-height: 1.7;
}

.pp-lead a {
  color: var(--brown-deep);
  font-weight: 700;
  text-decoration: underline;
}

.pp-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pp-facts div {
  flex: 1 1 130px;
  max-width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--pp-line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.pp-facts dt {
  color: var(--taupe);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pp-facts dd {
  margin-top: 2px;
  font-weight: 700;
  line-height: 1.35;
}

.pp-opt {
  display: grid;
  gap: 8px;
}

.pp-opt__label {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 700;
}

.pp-opt__value {
  color: var(--taupe);
  font-weight: 500;
}

.pp-opt__choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
}

.pp-opt__choices--color {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pp-choice {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  text-align: left;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.pp-choice:hover {
  border-color: var(--gold-muted);
}

.pp-choice strong {
  font-size: var(--text-sm);
}

.pp-choice span {
  color: var(--taupe);
  font-size: var(--text-xs);
}

.pp-choice em {
  color: var(--brown-deep);
  font-size: var(--text-xs);
  font-style: normal;
  font-weight: 700;
}

.pp-choice[aria-checked="true"] {
  border-color: var(--brown-deep);
  background: var(--ivory);
  box-shadow: inset 0 0 0 1px var(--brown-deep);
}

.pp-choice--color {
  width: 46px;
  height: 46px;
  padding: 4px;
  border-radius: 50%;
}

.pp-swatch {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.pp-swatch--wood {
  background: repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.12) 0 2px, transparent 2px 6px), var(--swatch);
}

.pp-swatch--metal {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent 45%, rgba(0, 0, 0, 0.18)), var(--swatch);
}

.pp-single {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.pp-single span {
  color: var(--taupe);
  font-weight: 700;
}

.pp-note summary {
  cursor: pointer;
  color: var(--brown-deep);
  font-size: var(--text-sm);
  font-weight: 700;
}

.pp-note summary span {
  color: var(--taupe);
  font-weight: 500;
}

.pp-note .form-field {
  margin-top: 8px;
}

.pp-note textarea {
  width: 100%;
}

.pp-buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pp-buy .btn--primary {
  flex: 1;
  min-height: 50px;
}

.pp-studio {
  min-height: 50px;
}

.pp-hint {
  margin-top: -6px;
  color: var(--taupe);
  font-size: var(--text-xs);
  line-height: 1.5;
}

.pp-feedback {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(31, 157, 85, 0.1);
  color: var(--success);
  font-size: var(--text-sm);
  font-weight: 600;
}

.pp-feedback.is-visible {
  display: flex;
}

/* ---------------------------------------------------------------- Section nav */
.pp-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 5;
  margin: clamp(28px, 5cqi, 56px) calc(-1 * var(--gutter)) 0;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--pp-line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.pp--preview .pp-nav {
  top: 0;
  margin-inline: 0;
  padding: 0;
}

.pp-nav ul {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pp-nav ul::-webkit-scrollbar {
  display: none;
}

.pp-nav a {
  display: block;
  padding: 14px 12px;
  border-bottom: 2px solid transparent;
  color: var(--taupe);
  font-size: var(--text-sm);
  font-weight: 700;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.pp-nav a:hover,
.pp-nav a[aria-current="true"] {
  color: var(--ink);
  border-color: var(--amber-strong);
}

/* ---------------------------------------------------------------- Sections */
.pp-section {
  padding-top: clamp(40px, 6cqi, 72px);
  scroll-margin-top: calc(var(--header-h) + 56px);
}

.pp-section__head {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
}

.pp-section__lead,
.pp-muted {
  color: var(--taupe);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.pp-overview {
  display: grid;
  gap: 12px;
  max-width: 72ch;
  color: var(--umber);
  line-height: 1.8;
}

.pp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pp-tags li {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--beige);
  color: var(--umber);
  font-size: var(--text-xs);
  font-weight: 700;
}

.pp-provenance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--taupe);
  font-size: var(--text-sm);
}

.pp-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--success);
  font-weight: 700;
}

/* ---------------------------------------------------------------- Frame Components (exploded view) */
.pc {
  display: grid;
  gap: 24px;
  align-items: center;
}

@container pp (min-width: 760px) {
  .pc:not(.pc--list) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.pc-visual {
  display: grid;
  place-items: center;
  align-self: start;
  min-height: 400px;
  border-radius: var(--pp-radius, 20px);
  background: radial-gradient(90% 70% at 50% 40%, #fffaf2 0%, var(--beige) 100%);
  perspective: 1400px;
  overflow: hidden;
}

.pc-scene {
  position: relative;
  width: 190px;
  height: 236px;
  /* Layers rise towards the viewer, so the stack is moved down by about half its height. */
  transform: translateY(calc(var(--n, 5) * var(--spread) * 0.42)) rotateX(56deg) rotateZ(-38deg);
  transform-style: preserve-3d;
  transition: transform 900ms var(--ease-out);
  --spread: 8px;
}

@container pp (min-width: 760px) {
  .pc:not(.pc--list) .pc-visual {
    position: sticky;
    top: calc(var(--header-h) + 70px);
  }
}

.pc.is-exploded .pc-scene {
  --spread: min(40px, calc(250px / var(--n, 5)));
}

.pc-layer {
  --gap: 8px;
  position: absolute;
  inset: 0;
  transform: translateZ(calc(var(--z) * var(--gap)));
  transform-style: preserve-3d;
  transition: transform 900ms var(--ease-out) calc(var(--z) * 55ms), filter var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.pc.is-exploded .pc-layer {
  --gap: min(40px, calc(250px / var(--n, 5)));
}

.pc-layer i {
  position: absolute;
  inset: 0;
  display: block;
}

.pc-layer.is-active {
  filter: brightness(1.08) drop-shadow(0 0 10px rgba(234, 120, 14, 0.55));
  transform: translateZ(calc(var(--z) * var(--gap) + 14px));
}

.pc-layer--frame i {
  border: 20px solid var(--c, #6b4a33);
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2), 0 18px 30px rgba(5, 8, 22, 0.22);
  background: transparent;
}

.pc-layer--glass i,
.pc-layer--acrylic i {
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.65) 0%, rgba(205, 228, 242, 0.28) 38%, rgba(255, 255, 255, 0.5) 62%, rgba(205, 228, 242, 0.2) 100%);
}

.pc-layer--mat i {
  inset: 12px;
  border: 26px solid var(--c, #efe3c8);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 10px 18px rgba(5, 8, 22, 0.12);
}

.pc-layer--border i {
  inset: 34px;
  border: 8px solid #fff;
  box-shadow: 0 6px 12px rgba(5, 8, 22, 0.1);
}

.pc-layer--print i {
  inset: 38px;
  background: var(--print, none) center / cover, linear-gradient(135deg, #e3cfb1, #8b5e3c);
  box-shadow: 0 8px 16px rgba(5, 8, 22, 0.18);
}

.pc-layer--backing i {
  inset: 6px;
  background: repeating-linear-gradient(80deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 7px), #8a6a4a;
  box-shadow: 0 16px 26px rgba(5, 8, 22, 0.22);
}

.pc-layer--hardware i {
  inset: 14% 32% auto;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, #8d939a, #d4d8dc, #8d939a);
}

.pc-layer--stand i {
  inset: auto 40% 6% 40%;
  height: 48%;
  border-radius: 4px;
  background: #6f4f33;
}

.pc-layer--other i {
  inset: 22px;
  border: 2px dashed rgba(79, 67, 54, 0.45);
}

.pc-list {
  display: grid;
  gap: 8px;
  counter-reset: none;
}

.pc-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--pp-line);
  border-radius: var(--radius-md);
  background: var(--white);
  outline: none;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.pc-item:not(:has(.pc-item__img)) {
  grid-template-columns: auto 1fr;
}

.pc-item.is-active,
.pc-item:focus-visible {
  border-color: var(--gold-muted);
  background: var(--ivory);
  transform: translateX(4px);
}

.pc-item__num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--champagne);
  color: var(--umber);
  font-size: var(--text-xs);
  font-weight: 800;
}

.pc-item__img img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.pc-item__text {
  display: grid;
  gap: 2px;
}

.pc-item__text span {
  color: var(--brown-deep);
  font-size: var(--text-sm);
  font-weight: 600;
}

.pc-item__text p {
  color: var(--taupe);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* ---------------------------------------------------------------- Materials */
.pm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 14px;
}

.pm-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--pp-line);
  border-radius: var(--radius-lg);
  background: var(--white);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.pm-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.pm-card__img img,
.pm-card__swatch {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.pm-card__swatch {
  background: linear-gradient(135deg, #fbfaf7, #e9e4da);
}

.pm-card__swatch--frame {
  background: repeating-linear-gradient(95deg, rgba(255, 255, 255, 0.08) 0 3px, transparent 3px 9px), linear-gradient(135deg, #8b5e3c, #4f3424);
}

.pm-card__swatch--glossy-paper,
.pm-card__swatch--photo-paper,
.pm-card__swatch--premium-photo-paper {
  background: linear-gradient(120deg, #fff 0%, #e8edf3 35%, #fff 52%, #dfe6ee 100%);
}

.pm-card__swatch--matte-paper {
  background: #f1eee8;
}

.pm-card__swatch--fine-art-paper {
  background: radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.04) 0 1px, transparent 2px) 0 0 / 7px 7px, #f6f1e6;
}

.pm-card__swatch--canvas {
  background: repeating-linear-gradient(0deg, rgba(120, 100, 70, 0.12) 0 1px, transparent 1px 4px), repeating-linear-gradient(90deg, rgba(120, 100, 70, 0.12) 0 1px, transparent 1px 4px), #efe6d4;
}

.pm-card__body {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 14px 16px 16px;
}

.pm-card__kind {
  color: var(--gold-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pm-card__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.pm-card__desc {
  color: var(--taupe);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.pm-card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.pm-card__facts div {
  display: flex;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--ivory);
  font-size: var(--text-xs);
}

.pm-card__facts dt {
  color: var(--taupe);
}

.pm-card__facts dd {
  font-weight: 700;
}

.pm-card__price {
  color: var(--brown-deep);
  font-size: var(--text-sm);
  font-weight: 800;
}

/* ---------------------------------------------------------------- Quality */
.pq-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 10px;
}

.pq-row {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--ivory);
}

.pq-row dt {
  color: var(--taupe);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pq-row dd {
  margin-top: 4px;
  font-weight: 700;
}

/* ---------------------------------------------------------------- Back view */
.pb {
  display: grid;
  gap: 18px;
  align-items: start;
}

@container pp (min-width: 700px) {
  .pb:not(.pb--text) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.pb__media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--pp-radius, 20px);
  background: var(--beige);
}

.pb__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 700ms var(--ease-out);
}

.pb__media:hover img {
  transform: scale(1.04);
}

.pb__zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
}

.pb__list {
  display: grid;
  gap: 10px;
}

.pb__list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--pp-line);
  border-radius: var(--radius-md);
}

.pb__list .icon {
  margin-top: 2px;
  color: var(--brown-deep);
}

.pb__list strong {
  display: block;
  font-size: var(--text-sm);
}

.pb__list span {
  color: var(--umber);
  font-size: var(--text-sm);
}

/* ---------------------------------------------------------------- Views grid */
.pv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(46%, 150px), 1fr));
  gap: 12px;
}

.pv-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--beige);
}

.pv-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease-out);
}

.pv-tile:hover img {
  transform: scale(1.05);
}

.pv-tile__label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.9);
  font-size: var(--text-xs);
  font-weight: 700;
}

.pv-tile--360 {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--champagne), var(--beige));
}

.pv-tile--360 b {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--brown-deep);
}

/* ---------------------------------------------------------------- Specifications */
.ps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 22px 40px;
}

.ps-group__title {
  margin-bottom: 8px;
  color: var(--gold-muted);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ps-table {
  display: grid;
}

.ps-row {
  display: grid;
  grid-template-columns: minmax(110px, 40%) 1fr;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--pp-line);
  font-size: var(--text-sm);
}

.ps-row dt {
  color: var(--taupe);
}

.ps-row dd {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ps-compare {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.ps-compare__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 28px;
  overflow-x: auto;
  padding: 8px 0;
}

.ps-compare__item {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--taupe);
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: center;
}

.ps-compare__shape {
  display: block;
  max-width: 80cqi;
  border-radius: 3px;
  transition: width 420ms var(--ease-out), height 420ms var(--ease-out);
}

.ps-compare__shape--frame {
  border: 5px solid #6b4a33;
  background: var(--beige);
}

.ps-compare__shape--paper {
  border: 1px dashed var(--slate);
  background: var(--white);
}

/* ---------------------------------------------------------------- Customization */
.pz-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 10px;
}

.pz-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--ivory);
}

.pz-list .icon {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: var(--success);
  color: var(--white);
}

.pz-list strong {
  display: block;
  font-size: var(--text-sm);
}

.pz-list span {
  color: var(--taupe);
  font-size: var(--text-xs);
  line-height: 1.5;
}

/* Longer explanations (personalization): two wide columns instead of small tiles */
.pz-list--wide {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

/* What's included + care */
.pi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--grid-gap, 16px);
}

.pi-col {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--ivory);
}

.pi-col__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: var(--text-sm);
  font-weight: 700;
}

.pi-col__title .icon {
  width: 18px;
  height: 18px;
  color: var(--gold-muted);
}

.pi-list {
  display: grid;
  gap: 6px;
  padding-left: 18px;
  color: var(--umber);
  font-size: var(--text-sm);
  line-height: 1.55;
  list-style: disc;
}

.pz-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 20px 22px;
  border-radius: var(--pp-radius, 20px);
  background: var(--ink);
  color: var(--white);
}

.pz-cta div {
  display: grid;
  gap: 4px;
  max-width: 52ch;
}

.pz-cta span {
  color: var(--mist);
  font-size: var(--text-sm);
}

/* ---------------------------------------------------------------- Shop */
.pshop {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px 18px;
  padding: 20px;
  border: 1px solid var(--pp-line);
  border-radius: var(--pp-radius, 20px);
  background: var(--ivory);
}

.pshop__logo {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
}

.pshop__body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pshop__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.pshop__line {
  display: flex;
  gap: 8px;
  color: var(--umber);
  font-size: var(--text-sm);
}

.pshop__line .icon {
  flex: none;
  margin-top: 2px;
}

.pshop__desc {
  color: var(--taupe);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.pshop__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pshop__chips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--white);
  font-size: var(--text-xs);
  font-weight: 700;
}

.pshop__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
}

@container pp (min-width: 700px) {
  .pshop {
    grid-template-columns: auto 1fr auto;
    align-items: start;
  }
  .pshop__actions {
    grid-column: auto;
    flex-direction: column;
  }
}

/* ---------------------------------------------------------------- Video, reviews, accordion */
.pvid__video,
.pvid__frame {
  display: block;
  width: 100%;
  max-width: 860px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--pp-radius, 20px);
  background: var(--ink);
}

.pvid__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.prev-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 12px;
}

.prev {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--ivory);
}

.prev__stars {
  color: var(--star);
}

.prev span {
  color: var(--taupe);
  font-size: var(--text-xs);
}

.pp-accordion {
  display: grid;
  gap: 8px;
  max-width: 820px;
}

.pp-accordion details {
  border: 1px solid var(--pp-line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.pp-accordion summary {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.pp-accordion summary::-webkit-details-marker {
  display: none;
}

.pp-accordion summary::after {
  content: "+";
  color: var(--brown-deep);
  font-size: 1.2rem;
  line-height: 1;
  transition: transform var(--dur-base) var(--ease-out);
}

.pp-accordion details[open] summary::after {
  transform: rotate(45deg);
}

.pp-accordion details p {
  padding: 0 16px 16px;
  color: var(--umber);
  line-height: 1.7;
  animation: pp-fade var(--dur-base) var(--ease-out);
}

.pp-accordion a {
  text-decoration: underline;
}

@keyframes pp-fade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* ---------------------------------------------------------------- Mobile buy bar + preview banner */
.pp-buybar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  transform: translateY(110%);
  transition: transform var(--dur-base) var(--ease-out);
}

.pp-buybar div {
  display: grid;
  min-width: 0;
}

.pp-buybar strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.pp-buybar span {
  overflow: hidden;
  color: var(--taupe);
  font-size: var(--text-xs);
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 859px) {
  .pp-buybar {
    display: flex;
  }
  .pp-buybar.is-visible {
    transform: none;
  }
}

.pp-preview-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(180, 83, 9, 0.3);
  border-radius: var(--radius-md);
  background: #fff7e8;
  color: #7c3f06;
  font-size: var(--text-sm);
}

.pp-preview-banner span {
  flex: 1 1 260px;
}

/* ---------------------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pg-img,
  .pg-img.is-leaving,
  .pc-layer,
  .pm-card,
  .pv-tile img,
  .pb__media img,
  .pg-lightbox,
  .ps-compare__shape {
    transition: none !important;
  }
  .pg-img,
  .pg-img.is-leaving {
    transform: none;
  }
  .pc-layer {
    --gap: min(40px, calc(250px / var(--n, 5)));
  }
  .pc-scene {
    --spread: min(40px, calc(250px / var(--n, 5)));
    transition: none;
  }
  .pp-accordion details p {
    animation: none;
  }
}

/* "Buy Now" beside "Add to cart": the same height, sharing the row. */
.pp-buy [data-buy] {
  flex: 1;
  min-height: 50px;
}

.pp-buybar > div {
  flex: 1;
}

/* The customer's own photos ------------------------------------------------------
   Products that are made from the customer's photo ask for it here, before
   "Add to cart" / "Buy Now". The pictures in the gallery are samples. */
.pp-photos {
  display: grid;
  gap: 10px;
  padding: clamp(14px, 3vw, 18px);
  border: 1.5px solid var(--line-warm);
  border-radius: var(--radius-md);
  background: var(--ivory);
  scroll-margin-top: 96px;
  transition: border-color var(--dur-base) var(--ease-out);
}

.pp-photos.has-error {
  border-color: var(--danger);
}

.pp-photos.is-complete {
  border-color: rgba(31, 157, 85, 0.5);
}

.pp-photos__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}

.pp-photos__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: var(--text-h4, 1.05rem);
  font-weight: 700;
  line-height: 1.3;
}

.pp-photos__title > .icon {
  width: 18px;
  height: 18px;
  color: var(--amber-strong);
}

.pp-photos__count {
  color: var(--taupe);
  font-size: var(--text-xs);
  font-weight: 700;
}

.pp-photos.is-complete .pp-photos__count {
  color: var(--success);
}

.pp-photos__lead,
.pp-photos__formats {
  color: var(--taupe);
  font-size: var(--text-xs);
  line-height: 1.5;
}

.pp-photos__sample,
.pp-photos__status,
.pp-photos__error {
  display: flex;
  gap: 8px;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.pp-photos__sample {
  padding: 12px;
  border: 1px dashed rgba(112, 69, 41, 0.35);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--umber);
}

.pp-photos__status {
  color: var(--brown-deep);
  font-weight: 700;
}

.pp-photos__error {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fdecea;
  color: var(--danger);
  font-weight: 700;
}

.pp-photos__sample .icon,
.pp-photos__status .icon,
.pp-photos__error .icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 3px;
}

.pp-photos__status[hidden],
.pp-photos__error[hidden] {
  display: none;
}

/* One photo: how it sits in the chosen size. Drag to move, slider to zoom. */
.pp-fit {
  display: grid;
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--white);
}

.pp-fit[hidden] {
  display: none;
}

.pp-fit__stage {
  display: grid;
  place-items: center;
  min-width: 0;
}

/* Its width and height are set by the page, in the proportions of the chosen size. */
.pp-fit__frame {
  position: relative;
  box-sizing: content-box;
  border: 6px solid var(--charcoal, #2b2622);
  border-radius: 2px;
  background: var(--beige);
  box-shadow: 0 6px 16px rgba(43, 38, 34, 0.18);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.pp-fit__frame.is-dragging {
  cursor: grabbing;
}

.pp-fit__frame:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.pp-fit__frame img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  pointer-events: none;
}

.pp-fit__side {
  display: grid;
  justify-items: start;
  gap: 6px;
  min-width: 0;
}

.pp-fit__title {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 700;
}

.pp-fit__title strong {
  color: var(--brown-deep);
}

.pp-fit__hint {
  color: var(--taupe);
  font-size: var(--text-xs);
  line-height: 1.5;
}

.pp-fit__zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  color: var(--taupe);
  font-size: var(--text-xs);
  font-weight: 700;
}

.pp-fit__zoom input {
  flex: 1;
  min-width: 0;
  accent-color: var(--amber-deep);
}

@media (max-width: 420px) {
  .pp-fit {
    grid-template-columns: minmax(0, 1fr);
  }

}
