.gem-product {
  --product-line: #37343e;
  --product-muted: #c4c1cc;
  --product-purple: #41235d;
  --product-focus: #efedf3;
}

.gem-story.gem-product[id] { background: #15161a; }

.gem-product .eyebrow { color: var(--product-muted); }
.gem-product-intro { align-items: end; }
.gem-product-intro p { color: var(--product-muted); }

.gem-product-gallery[data-ready] {
  display: grid;
  grid-template-columns: clamp(196px, 21vw, 274px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(14px, 2.2vw, 28px);
}

.gem-product-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-bottom: 16px;
}

.gem-product-gallery[data-ready] .gem-product-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: 0;
}

.gem-product-control {
  display: flex;
  position: relative;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 11px 16px;
  border: 1px solid var(--product-line);
  border-radius: 4px;
  background: #1b1b20;
  color: var(--product-muted);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  overflow: hidden;
}

.gem-rotation {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  margin: 0 0 8px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--product-muted);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
}
.gem-rotation:hover { color: #fff; }
.gem-rotation[hidden],
.gem-rotation[data-playing] [data-play-icon],
.gem-rotation:not([data-playing]) [data-pause-icon] { display: none; }
.gem-rotation .gem-product-icon { width: 16px; height: 16px; }

@media (prefers-reduced-motion: no-preference) {
  .gem-product-gallery[data-rotating] .gem-product-control[aria-selected="true"]::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 2px;
    background: #e7d9f4;
    transform-origin: left;
    animation: gem-view-progress var(--gem-rotation-duration) linear both;
  }
}

@keyframes gem-view-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.gem-product-control[aria-selected="true"] {
  border-color: #8552ac;
  background: var(--product-purple);
  color: #fff;
}

.gem-product-control:hover { color: #fff; border-color: #8a8290; }
.gem-product-icon { display: block; flex: none; width: 20px; height: 20px; }

.gem-product-panel + .gem-product-panel { margin-top: 16px; }
.gem-product-gallery[data-playing] .gem-product-panels { display: grid; }
.gem-product-gallery[data-ready] .gem-product-panel { margin: 0; }
.gem-product-panel[hidden] { display: none; }
/* Reserve the tallest panel's height during automatic changes. */
.gem-product-gallery[data-playing] .gem-product-panel {
  grid-area: 1 / 1;
  align-self: start;
  min-width: 0;
}
.gem-product-gallery[data-playing] .gem-product-panel[hidden] {
  display: block;
  visibility: hidden;
}

.gem-product-panel figure {
  margin: 0;
  min-width: 0;
  border: 1px solid var(--product-line);
  border-radius: 6px;
  background: #191a1f;
}

.gem-product-art {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 5px 5px 0 0;
  background: #27282d;
  cursor: zoom-in;
  overflow: hidden;
}

.gem-product-art img {
  display: block;
  width: 100%;
  height: auto;
}

.gem-product-zoom {
  position: absolute;
  display: grid;
  place-items: center;
  right: 11px;
  bottom: 11px;
  width: 34px;
  height: 34px;
  border: 1px solid #aaa4b480;
  border-radius: 4px;
  background: #1a181fef;
  color: #fff;
}

.gem-product-zoom .gem-product-icon { width: 16px; height: 16px; }
.gem-product-art:hover .gem-product-zoom { background: var(--product-purple); border-color: #d6cde0; }
.gem-product-control:focus-visible,
.gem-rotation:focus-visible,
.gem-product-art:focus-visible { outline: 2px solid var(--product-focus); outline-offset: 3px; }

.gem-product-panel figcaption {
  padding: 15px clamp(14px, 2vw, 24px) 17px;
}

.gem-product-panel figcaption h3 {
  margin: 0;
  color: #f5f3f7;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.2;
  letter-spacing: -.025em;
}

.gem-product-panel figcaption p {
  color: var(--product-muted);
  font-size: 1rem;
  line-height: 1.45;
  margin: 4px 0 0;
}

.gem-product .gem-related { margin-top: clamp(24px, 3.5vw, 48px); }
.gem-product .gem-related .gem-link { color: #ece8f0; }

@media (max-width: 700px) {
  .gem-product-gallery[data-ready] { grid-template-columns: minmax(0, 1fr); }
  .gem-product-gallery[data-ready] .gem-product-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gem-product-gallery[data-ready] .gem-product-control:first-child:nth-last-child(odd) {
    grid-column: 1 / -1;
  }
  .gem-product-control {
    gap: 8px;
    min-height: 54px;
    padding: 8px 10px;
    font-size: .9375rem;
  }
  .gem-product-control .gem-product-icon { width: 18px; height: 18px; }
}

@media (forced-colors: active) {
  .gem-product-control[aria-selected="true"] { border-color: Highlight; }
}


.gem-product-gallery[data-ready] figcaption { display: none; }
.gem-view-note {
  margin: 18px 0 0;
  padding: 4px 0 4px 14px;
  border-left: 2px solid #956eb2;
  color: var(--product-muted);
  font-size: 1rem;
  line-height: 1.5;
}
