/* Product sheet (studio.js openProduct): stage + order column. Overrides the older dialog rules. */
#product {
  --tint: #f3c4cc;
  --ink: #59192f;
  width: min(1200px, calc(100vw - 64px));
  height: min(780px, calc(100dvh - 64px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: transparent;
  overflow: visible;
  color: #2e1019;
}
#product[open] {
  animation: none;
}
#product::backdrop {
  background: #1d060fb8;
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  backdrop-filter: blur(10px) saturate(1.1);
}
#product-view {
  height: 100%;
}
#product > .x {
  position: absolute;
  z-index: 6;
  top: 18px;
  right: 18px;
  float: none;
  width: 46px;
  height: 46px;
  margin: 0;
  border-radius: 50%;
  border: 1px solid #59192f26;
  background: #fff9ef;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 6px 18px #2e101922;
  transition:
    rotate 0.45s cubic-bezier(0.3, 1.5, 0.5, 1),
    background-color 0.25s,
    color 0.25s;
}
#product > .x:hover,
#product > .x:focus-visible {
  rotate: 90deg;
  background: var(--ink);
  color: #fff9ef;
}
.pd {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
  border-radius: 28px;
  background: #fff9ef;
  box-shadow: 0 40px 120px #12030985;
}

/* ---------- Stage ---------- */
.pd-stage {
  --mx: 0;
  --my: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse 70% 62% at 50% 48%, color-mix(in srgb, var(--tint), white 58%), var(--tint) 78%);
}
.pd-stage:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("/assets/atelier/grain.png");
  opacity: 0.14;
  mix-blend-mode: multiply;
}
.pd-marquee {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  pointer-events: none;
}
.pd-marquee-track {
  display: flex;
  width: max-content;
  animation: pd-run 42s linear infinite;
}
.pd-marquee span {
  padding-right: 0.35em;
  white-space: nowrap;
  font: 400 clamp(120px, 15vw, 250px) / 0.9 var(--display);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 2px color-mix(in srgb, var(--ink) 32%, transparent);
}
@keyframes pd-run {
  to {
    transform: translateX(-50%);
  }
}
.pd-meta {
  position: absolute;
  z-index: 3;
  top: 22px;
  left: 26px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  color: var(--ink);
}
.pd-meta b {
  font: 400 1.7rem/1 var(--display);
}
.pd-meta span {
  font: 700 0.7rem var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.pd-thumbs {
  position: absolute;
  z-index: 3;
  top: 74px;
  left: 22px;
  bottom: 90px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 4px;
}
.pd-thumbs::-webkit-scrollbar {
  display: none;
}
.pd-thumbs button {
  flex: none;
  width: 58px;
  height: 68px;
  padding: 5px;
  border-radius: 14px;
  background: #fff9efcc;
  border: 1px solid #59192f1f;
  transition:
    translate 0.35s cubic-bezier(0.3, 1.6, 0.5, 1),
    box-shadow 0.2s;
}
.pd-thumbs button:hover {
  translate: 4px 0;
}
.pd-thumbs button[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--ink);
  translate: 6px 0;
}
.pd-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pd-figure {
  position: absolute;
  z-index: 1;
  inset: 9% 11% 12%;
  translate: calc(var(--mx) * 26px) calc(var(--my) * 16px);
  transition: translate 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pd-thumbs ~ .pd-figure {
  inset: 9% 8% 12% 15%;
}
.pd-zoom {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  cursor: zoom-in;
}
.pd-zoom[aria-pressed="true"] {
  cursor: none;
}
.pd-img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  transform-origin: 50% 15%;
  filter: drop-shadow(12px 28px 24px #2e101945);
  animation: pd-float 6.5s ease-in-out infinite;
}
@keyframes pd-float {
  0%,
  100% {
    translate: 0 0;
    rotate: -1.2deg;
  }
  50% {
    translate: 0 -12px;
    rotate: 0.8deg;
  }
}
.pd-lens {
  position: absolute;
  left: 0;
  top: 0;
  width: 220px;
  height: 220px;
  margin: -110px 0 0 -110px;
  border-radius: 50%;
  border: 5px solid #fff9ef;
  background-color: color-mix(in srgb, var(--tint), white 40%);
  background-repeat: no-repeat;
  box-shadow:
    0 0 0 2px var(--ink),
    0 24px 50px #2e101955;
  pointer-events: none;
  scale: 0;
  transition: scale 0.45s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.pd-zoom[aria-pressed="true"]:hover .pd-lens {
  scale: 1;
}
.pd-macro {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: center / cover;
  clip-path: circle(0 at var(--cx, 90%) var(--cy, 90%));
  transition: clip-path 0.9s cubic-bezier(0.7, 0, 0.2, 1);
  pointer-events: none;
}
.pd-stage.is-fabric .pd-macro {
  clip-path: circle(150% at var(--cx, 90%) var(--cy, 90%));
}
.pd-fabric {
  position: absolute;
  z-index: 4;
  right: 24px;
  bottom: 24px;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 8px 6px;
  background: #fff9ef;
  box-shadow: 5px 7px 0 #2e101926;
  rotate: 6deg;
  transition:
    rotate 0.45s cubic-bezier(0.3, 1.6, 0.5, 1),
    scale 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.pd-fabric:hover,
.pd-fabric:focus-visible {
  rotate: 0deg;
  scale: 1.06;
}
.pd-fabric img {
  width: 86px;
  height: 86px;
  object-fit: cover;
}
.pd-fabric span {
  font: 600 1.05rem/1 var(--hand);
  color: var(--ink);
}
.pd-hint {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 26px;
  translate: -50% 0;
  font: 600 1.1rem var(--hand);
  color: var(--ink);
  opacity: 0.75;
  transition: opacity 0.3s;
}
.pd-stage.is-zoom .pd-hint,
.pd-stage.is-fabric .pd-hint {
  opacity: 0;
}

/* ---------- Order column ---------- */
.pd-info {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  margin: 0;
  padding: 48px 46px 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.pd-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 0.72rem var(--sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}
.pd-eyebrow i {
  width: 28px;
  height: 2px;
  background: currentColor;
}
.pd-info h2 {
  margin: 0 46px 0 0;
  font: 400 clamp(40px, 4.2vw, 68px) / 0.92 var(--display);
  letter-spacing: -0.012em;
  text-transform: uppercase;
  color: #2e1019;
}
.pd-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
.pd-price b {
  font: 400 clamp(26px, 2.4vw, 36px) / 1 var(--display);
  color: var(--ink);
}
.pd-price span {
  padding: 5px 12px;
  border-radius: 30px;
  background: var(--tint);
  color: var(--ink);
  font: 700 0.68rem var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.pd-price em {
  font: 600 1.2rem var(--hand);
  font-style: normal;
  color: #7a6164;
}
.pd-desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #5d4448;
}
.pd-field {
  min-width: 0;
  margin: 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid #59192f1f;
}
.pd-field legend {
  float: left;
  width: 100%;
  margin-bottom: 12px;
  padding: 0;
  font: 700 0.72rem var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #2e1019;
}
.pd-field legend b {
  margin-left: 6px;
  font: 600 1.2rem var(--hand);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.pd-swatches,
.pd-sizes {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pd-swatch {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: center / cover;
  border: 3px solid #fff9ef;
  box-shadow: 0 0 0 1px #59192f40;
  transition:
    transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1),
    box-shadow 0.2s;
}
.pd-swatch:hover {
  transform: scale(1.12);
}
.pd-swatch[aria-pressed="true"] {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px var(--ink);
}
.pd-size {
  min-width: 54px;
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid #59192f40;
  background: #fff;
  font: 700 0.92rem var(--sans);
  color: #2e1019;
  transition:
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s,
    translate 0.3s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.pd-size:hover {
  translate: 0 -2px;
  border-color: var(--ink);
}
.pd-size[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff9ef;
}
.pd-sizes input {
  flex: 1;
  min-width: 140px;
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid #59192f40;
  background: #fff;
  font: 500 0.92rem var(--sans);
  color: #2e1019;
}
.pd-sizes input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.pd-field small {
  display: block;
  margin-top: 8px;
  font-size: 0.78rem;
  color: #7a6164;
}
.pd-buy {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  gap: 10px;
  margin: auto -46px 0;
  padding: 16px 46px;
  background: linear-gradient(#fff9ef00, #fff9ef 26%);
}
.pd-qty {
  display: flex;
  align-items: center;
  border: 1px solid #59192f40;
  border-radius: 40px;
  background: #fff;
}
.pd-qty button {
  width: 44px;
  height: 56px;
  font-size: 1.3rem;
  color: var(--ink);
}
.pd-qty input {
  width: 34px;
  border: 0;
  background: none;
  text-align: center;
  font: 700 1rem var(--sans);
  color: #2e1019;
  -moz-appearance: textfield;
  appearance: textfield;
}
.pd-qty input::-webkit-inner-spin-button,
.pd-qty input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pd-add {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 58px;
  padding: 0 26px;
  border-radius: 40px;
  background: var(--ink);
  color: #fff9ef;
  font: 700 1rem var(--sans);
  box-shadow: 0 6px 0 #2e101940;
  transition:
    translate 0.2s,
    box-shadow 0.2s,
    background-color 0.3s;
}
.pd-add:hover {
  translate: 0 -2px;
  box-shadow: 0 8px 0 #2e101940;
}
.pd-add b {
  font: 400 1.3rem var(--display);
  letter-spacing: 0.02em;
}
.pd-add.is-done {
  background: #2f6b47;
}
.pd-perks {
  display: grid;
  gap: 8px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.84rem;
  color: #5d4448;
}
.pd-perks li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pd-perks li:before {
  content: "✳";
  color: #cf5976;
}
.pd-ask {
  margin-bottom: 26px;
  font: 600 1.15rem var(--hand);
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Phones ---------- */
@media (max-width: 860px) {
  #product {
    width: 100vw;
    height: 100dvh;
    margin: 0;
    inset: 0;
    border-radius: 0;
  }
  #product > .x {
    top: 12px;
    right: 12px;
  }
  .pd {
    grid-template-columns: 1fr;
    grid-template-rows: 46dvh minmax(0, 1fr);
    border-radius: 0;
  }
  .pd-meta {
    top: 18px;
    left: 18px;
  }
  .pd-thumbs {
    top: auto;
    bottom: 14px;
    left: 14px;
    right: 120px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: visible;
  }
  .pd-thumbs button {
    width: 46px;
    height: 54px;
  }
  .pd-thumbs button[aria-pressed="true"],
  .pd-thumbs button:hover {
    translate: 0 -4px;
  }
  .pd-figure,
  .pd-thumbs ~ .pd-figure {
    inset: 12% 8% 22%;
  }
  .pd-fabric {
    right: 14px;
    bottom: 14px;
  }
  .pd-fabric img {
    width: 58px;
    height: 58px;
  }
  .pd-hint {
    display: none;
  }
  .pd-marquee span {
    font-size: 30vw;
  }
  .pd-info {
    padding: 26px 20px 0;
  }
  .pd-info h2 {
    margin-right: 0;
  }
  .pd-buy {
    margin-inline: -20px;
    padding: 12px 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pd-marquee-track,
  .pd-img {
    animation: none;
  }
  .pd-macro,
  .pd-figure,
  .pd-lens {
    transition: none;
  }
}
