/* R06 — product dialog only. Photographs and commerce behaviour stay original. */
.product-view {
  --view-paper: #d2d3cd;
  --view-ink: #302b25;
  --view-muted: #695e53;
  --view-control-line: rgb(48 43 37 / .18);
  background: var(--view-paper);
  scrollbar-width: thin;
  scrollbar-color: rgb(48 43 37 / .28) var(--view-paper);
}

.product-view .view-layout,
.product-view.full-frame-gallery .view-layout {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}

.product-view .view-gallery {
  display: block;
  isolation: isolate;
  background: #bdbfb9;
}

/* R07: the complete marble frame uses the same surrounding paper as the copy.
   Override the legacy per-photo inline colour without changing the photograph. */
.product-view.full-frame-gallery .view-gallery {
  background-color: var(--view-paper) !important;
}

/* A quiet stone-coloured edge joins the image area to the information panel. */
.product-view .view-gallery::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0 0 0 auto;
  width: clamp(28px, 4.5vw, 72px);
  background: linear-gradient(90deg, transparent, var(--view-paper));
  pointer-events: none;
}

.product-view .view-picture { height: 100%; }

.product-view .gallery-controls {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  transform: none;
  background: none;
  pointer-events: none;
}

.product-view .gallery-controls button,
.product-view .view-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--view-control-line);
  border-radius: 50%;
  background: rgb(246 245 239 / .38);
  color: var(--view-ink);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  pointer-events: auto;
  transition: background-color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.product-view .gallery-controls button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0;
  opacity: .6;
}
.product-view .gallery-controls button[hidden] { display: none; }
.product-view .gallery-prev { left: clamp(16px, 2vw, 28px); }
.product-view .gallery-next { right: clamp(16px, 2vw, 28px); }
.product-view .gallery-controls button::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-top: 1.2px solid currentColor;
  border-right: 1.2px solid currentColor;
}
.product-view .gallery-prev::before { transform: translateX(2px) rotate(-135deg); }
.product-view .gallery-next::before { transform: translateX(-2px) rotate(45deg); }

.product-view .gallery-count {
  position: absolute;
  bottom: 20px;
  right: clamp(16px, 2vw, 28px);
  transform: none;
  padding: 7px 11px;
  border-radius: 20px;
  background: rgb(246 245 239 / .38);
  color: var(--view-ink);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1.4;
}

.product-view .view-close {
  z-index: 4;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
}

.product-view .view-copy,
.product-view.full-frame-gallery .view-copy {
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 560px;
  max-height: 100dvh;
  padding: 72px clamp(32px, 4.2vw, 72px) 96px;
  color: var(--view-ink);
}
.product-view .view-number {
  margin: 0 0 16px;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--view-muted);
}
.product-view .view-copy h2 {
  margin: 0 0 14px;
  color: var(--view-ink);
}
.product-view .view-keywords {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: .045em;
  color: var(--view-muted);
}
.product-view .view-description {
  margin: 28px 0 12px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--view-muted);
}
.product-view .view-materials {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--view-muted);
}
.product-view .view-price {
  margin: 30px 0 20px;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.025em;
  color: var(--view-ink);
}
.product-view .view-add,
.product-view .mobile-add {
  min-height: 56px;
  padding: 16px 22px;
  border: 1px solid rgb(48 43 37 / .42);
  border-radius: 16px;
  background: rgb(246 245 239 / .72);
  color: var(--view-ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .015em;
}

.product-view .gallery-controls button:focus-visible,
.product-view .view-close:focus-visible {
  opacity: 1;
  background: rgb(246 245 239 / .9);
}

@media (hover: hover) and (pointer: fine) {
  .product-view .gallery-controls button { opacity: .36; }
  .product-view .gallery-controls button:hover,
  .product-view .gallery-controls button:focus-visible,
  .product-view .view-close:hover {
    opacity: 1;
    background: rgb(246 245 239 / .85);
    border-color: rgb(48 43 37 / .3);
  }
  .product-view .view-add:not(:disabled):hover,
  .product-view .mobile-add:hover {
    background: rgb(246 245 239 / .94);
    border-color: rgb(48 43 37 / .6);
  }
}

@media (max-width: 900px) {
  .product-view .gallery-controls button { opacity: .6; }
  .product-view .view-gallery { height: min(150vw, 72svh); min-height: 300px; }
  .product-view .view-picture { height: 100%; }
  .product-view .view-image { width: 100%; height: 100%; object-fit: contain; }
  .product-view .view-gallery::after {
    inset: auto 0 0;
    width: auto;
    height: 28px;
    background: linear-gradient(transparent, var(--view-paper));
  }
  .product-view .gallery-count { bottom: 18px; }
  .product-view .view-close {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    width: 44px;
    height: 44px;
  }
  .product-view .view-copy,
  .product-view.full-frame-gallery .view-copy {
    max-width: 560px;
    max-height: none;
    margin: 0 auto;
    padding: 30px var(--gutter) calc(var(--purchase-space, 136px) + env(safe-area-inset-bottom));
  }
  .product-view .view-copy h2 { font-size: 36px; }
  .product-view .view-number { margin-bottom: 12px; }
  .product-view .view-description { margin-top: 22px; }
  .product-view .view-price { margin: 24px 0 18px; font-size: 31px; }
  .product-view .mobile-purchase {
    background: rgb(210 211 205 / .94);
    border-top-color: rgb(48 43 37 / .15);
  }
}

@media (max-width: 599px) {
  .product-view .view-gallery { height: auto; min-height: 0; }
  .product-view .view-picture,
  .product-view .view-image { height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .product-view .gallery-controls button,
  .product-view .view-close { transition: none; }
}
