/* Flat previews retain pointer tilt, soft shadows, and selectable wood finishes. */
.product-visual-stage .product-frame.has-flat-frame {
  transform-style: flat;
  isolation: isolate;
  view-transition-name: dw-artwork;
  --wood-main: #282521;
  --wood-light: #403b34;
  --wood-dark: #171512;
  --wood-grain: rgba(151,130,100,.12);
}
.product-frame.has-flat-frame[data-frame-finish="natural"] {
  --wood-main: #bb9467;
  --wood-light: #d4b58c;
  --wood-dark: #977044;
  --wood-grain: rgba(101,64,28,.12);
}
.product-frame.has-flat-frame.is-poly::before {
  inset: calc(-1 * var(--frame-outset));
  background: #231e18;
  box-shadow: calc(var(--preview-shadow-x, 0px) * .25) calc(var(--preview-shadow-y, 20px) * .25) 12px rgba(47,35,23,.1),
    var(--preview-shadow-x, 0px) var(--preview-shadow-y, 20px) var(--preview-shadow-blur, 34px) rgba(47,35,23,var(--preview-shadow-alpha, .17));
}
.product-visual-stage .product-frame.has-flat-frame.product-frame-ghost { view-transition-name: none; }
.poly-frame-rim { position: absolute; inset: 0; z-index: 2; pointer-events: none; display: none; }
.is-poly > .poly-frame-rim { display: block; }
.poly-rail {
  position: absolute;
  background-color: var(--wood-main);
  background-image: repeating-linear-gradient(var(--grain-angle, 90deg), var(--wood-grain) 0 .45px, transparent .45px 3.5px),
    linear-gradient(115deg, var(--wood-light), var(--wood-main) 42%, var(--wood-dark));
  box-shadow: inset 0 0 0 .6px rgba(255,246,229,.13);
  transition: background-color .35s;
}
.poly-rail-top, .poly-rail-bottom { left: calc(-1 * var(--frame-outset)); width: var(--frame-outer-width); height: var(--poly-rim); --grain-angle: 0deg; }
.poly-rail-top { top: calc(-1 * var(--frame-outset)); }
.poly-rail-bottom { top: calc(100% + var(--float-gap)); }
.poly-rail-left, .poly-rail-right { top: calc(-1 * var(--float-gap)); width: var(--poly-rim); height: var(--frame-inner-height); }
.poly-rail-left { left: calc(-1 * var(--frame-outset)); }
.poly-rail-right { left: calc(100% + var(--float-gap)); }
.product-frame-finish-group { margin-top: 18px; }
.product-frame-finish-group[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .poly-rail { transition: none; }
}
