/* =====================================================================
   Atelier de la Rose — КАРТОЧКА ТОВАРА в механике KAIJU / HILLS (по образцу
   racerworldwide.net). Компьютер: сетка 2 : 1 с полями 40 px. Слева фото
   столбиком во всю высоту экрана и липкая лента миниатюр 72×96, справа
   липкая колонка: название капсом с разрядкой, цена, наличие с точкой,
   размеры кнопками, «Оформить предзаказ», вкладки. Телефон: фото свайпом
   со счётчиком «1 / N», липкая панель «цена + Оформить предзаказ».
   Шрифт — Cormorant Garamond, цвета Atelier, кнопка тёмно-оливковая.
   ===================================================================== */
.pdx,
.pdx-lb {
  --rc-font: "Cormorant Garamond", "Times New Roman", serif;
  --rc-ink: var(--ink);
  --rc-muted: var(--muted);
  --rc-line: var(--line);
  --rc-bg: var(--bg);
  --rc-soft: var(--field);
  --rc-pad: 40px;
}
.pdx {
  background: var(--rc-bg);
  color: var(--rc-ink);
  font-family: var(--rc-font);
  font-size: 16px;
  line-height: 1.45;
  font-variant-numeric: lining-nums;
  --header-h: var(--header);
}
html.pdx-lock { overflow: hidden; }
.pdx :where(a) { color: inherit; }
.pdx :where(button) { color: inherit; font: inherit; text-transform: none; letter-spacing: normal; }

/* ---------- сетка ---------- */
.pdx-main {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
  padding: 0 var(--rc-pad);
}

/* фото: столбик + лента миниатюр справа */
.pdx-media {
  display: grid;
  /* фото 3:4 во всю высоту: колонка не шире фото, миниатюры сразу за ним */
  grid-template-columns: minmax(0, calc((100vh - var(--header-h) - 16px) * .75)) 72px;
  justify-content: end;
  gap: 12px;
  align-items: start;
  padding: 8px 24px 0 0;
}
.pdx-gallery { display: flex; flex-direction: column; gap: 8px; }
/* компьютер: каждое фото во всю высоту экрана, без обрезки */
.pdx-slide { position: relative; margin: 0; height: calc(100vh - var(--header-h) - 16px); min-height: 480px; overflow: hidden; background: var(--rc-bg); cursor: zoom-in; }
.pdx-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pdx-slide--empty { display: grid; place-items: center; cursor: default; background: var(--rc-soft); color: var(--rc-muted); letter-spacing: 0.12em; }

.pdx-thumbs {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - var(--header-h) - 16px);
  overflow-y: auto;
  scrollbar-width: none;
}
.pdx-thumbs::-webkit-scrollbar { display: none; }
.pdx-thumb {
  flex: none;
  width: 72px;
  height: 96px;
  padding: 0;
  border: 1px solid transparent;
  background: var(--rc-bg);
  cursor: pointer;
  transition: border-color 0.2s;
}
.pdx-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pdx-thumb:hover { border-color: var(--rc-line); }
.pdx-thumb.is-active { border-color: var(--rc-muted); }
.pdx-count { display: none; }

/* ---------- информация ---------- */
/* колонка стоит на месте, пока листаются фото; длинное описание
   прокручивается внутри неё */
.pdx-info { align-self: stretch; min-width: 0; padding-left: 24px; }
.pdx-sticky {
  position: sticky;
  top: var(--header-h);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  scrollbar-width: none;
  padding: 24px 0 48px;
}
.pdx-sticky::-webkit-scrollbar { display: none; }
.pdx-title { margin: 12px 0 0; font-size: 20px; font-weight: 500; line-height: 1.2; letter-spacing: 0.14em; text-transform: uppercase; overflow-wrap: anywhere; }
.pdx-crumbs { font-size: 15px; color: var(--rc-muted); }
.pdx-crumbs a:hover { color: var(--rc-ink); }
.pdx-pnote { margin: 8px 0 0; font-size: 15px; color: var(--rc-muted); max-width: 40ch; }
.pdx-muted { color: var(--rc-muted); }
.pdx-price { margin: 14px 0 0; font-size: 24px; font-weight: 500; font-variant-numeric: lining-nums tabular-nums; }
.pdx-price b { font-weight: 900; }

.pdx-stock { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; }
.pdx-stock i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--olive);
  margin: 0 2px;
}
.pdx-stock { font-size: 16px; }
.pdx-stock.is-out i { background: var(--rc-line); }

.pdx-sizes { min-width: 0; margin: 18px 0 0; padding: 0; border: 0; }
.pdx-sizes legend { padding: 0; margin-bottom: 8px; font-size: 16px; }
.pdx-sizegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 11px; }
.pdx-size {
  position: relative;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--rc-line);
  border-radius: 0;
  background: var(--rc-bg);
  font-size: 16px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
}
.pdx-size:hover { border-color: var(--rc-muted); }
.pdx-size[aria-pressed="true"] { border-color: var(--olive); box-shadow: inset 0 0 0 1px var(--olive); color: var(--olive); }
.pdx-size.is-soldout { color: var(--rc-muted); cursor: not-allowed; }
.pdx-size.is-soldout::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, transparent calc(50% - 0.5px), var(--rc-line) 50%, transparent calc(50% + 0.5px));
  pointer-events: none;
}
.pdx-sizes.is-need .pdx-sizegrid { animation: pdx-shake 0.4s; }
@keyframes pdx-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.pdx-guide { display: inline-block; margin-top: 14px; padding: 0; border: 0; background: none; color: var(--rc-muted); font-size: 16px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.pdx-guide:hover { color: var(--rc-ink); }

.pdx-add {
  width: 100%;
  height: 52px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 32px;
  border: 1px solid var(--olive);
  border-radius: 0;
  background: var(--olive);
  color: var(--on-olive);
  font-family: var(--rc-font); font-weight: 500; font-size: 17px; letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.pdx :where(.pdx-add) { text-transform: uppercase; }
.pdx-add svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.pdx-add:hover { background: var(--olive-deep); border-color: var(--olive-deep); }
.pdx-add:active { transform: scale(0.99); }
.pdx-add[disabled] { opacity: 0.45; cursor: not-allowed; }
.pdx-try { display: inline-block; margin-top: 12px; font-size: 12px; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; }
.pdx-try:hover { text-decoration-thickness: 2px; }
.pdx-msg { min-height: 17px; margin: 8px 0 0; color: var(--rc-muted); }
.pdx-msg:empty { min-height: 0; margin: 0; }
.pdx-note { margin: 12px 0 0; color: var(--rc-muted); font-size: 15px; }

/* вкладки */
.pdx-tabs { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; margin-top: 32px; border-bottom: 1px solid var(--rc-line); }
.pdx-tab {
  margin-bottom: -1px;
  padding: 16px 12px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s;
}
.pdx-tab:hover { border-bottom-color: var(--rc-line); }
.pdx-tab[aria-selected="true"] { border-bottom-color: var(--rc-ink); }
.pdx-panel { padding-top: 24px; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.pdx-scheme { margin: 0 0 16px; background: #fff; border: 1px solid var(--rc-line); padding: 12px; }
.pdx-scheme img { width: 100%; max-height: 380px; object-fit: contain; }
.pdx-table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 15px; }
.pdx-table th, .pdx-table td { text-align: left; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--rc-line); vertical-align: top; }
.pdx-table th { font-weight: 500; width: 2.4em; }
.pdx-panel[hidden] { display: none; }
.pdx-panel p { margin: 0 0 16px; }
.pdx-panel b { font-weight: 700; }
.pdx-panel a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- увеличение ---------- */
.pdx-lb { position: fixed; inset: 0; z-index: 1200; background: var(--rc-bg); color: var(--rc-ink); font-family: var(--rc-font); font-size: 16px; }
.pdx-lb-slide video { width: 100%; height: 100%; object-fit: contain; background: #111; }
.pdx-lb[hidden] { display: none; }
.pdx-lb-slide { position: absolute; inset: 0; display: none; }
.pdx-lb-slide.is-active { display: block; }
.pdx-lb-slide img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-out; }
.pdx-lb button { color: inherit; font: inherit; }
.pdx-lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.pdx-lb-close .ic { width: 22px; height: 22px; }
.pdx-lb-arrow { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); padding: 16px; border: 0; background: none; cursor: pointer; line-height: 0; }
.pdx-lb-arrow--prev { left: 8px; }
.pdx-lb-arrow--next { right: 8px; }
.pdx-lb-count { position: absolute; left: 50%; bottom: 24px; z-index: 2; transform: translateX(-50%); font-variant-numeric: tabular-nums; }

/* ---------- вам также может понравиться ---------- */
.pdx-related { padding: 96px var(--rc-pad) 0; }
.pdx-related-t { margin: 0 0 30px; font-size: 18px; font-weight: 500; line-height: 1.1; letter-spacing: 0.14em; text-transform: uppercase; }
.pdx-rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px 10px; }
.pdx-card { min-width: 0; }
.pdx-card-media { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--rc-soft); }
.pdx-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pdx-card-info { display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; text-decoration: none; }
.pdx-card-name { font-size: 12px; line-height: 1.1; letter-spacing: -0.03em; text-transform: uppercase; overflow-wrap: anywhere; }
.pdx-card-price { font-size: 13px; font-weight: 500; line-height: 1.2; letter-spacing: -0.03em; text-transform: uppercase; }
.pdx-card-price b { font-weight: 900; }
.pdx-card-info:hover .pdx-card-name { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- планшет ---------- */
@media (max-width: 1199px) and (min-width: 990px) {
  .pdx { --rc-pad: 24px; }
  .pdx-main { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}

/* ---------- телефон ---------- */
@media (max-width: 989px) {
  .pdx { --rc-pad: 16px; }
  .pdx-main { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .pdx-media { position: relative; display: block; padding: 0; }
  .pdx-gallery {
    flex-direction: row;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
  }
  .pdx-gallery::-webkit-scrollbar { display: none; }
  .pdx-slide { flex: 0 0 100%; height: auto; min-height: 0; aspect-ratio: 3 / 4; scroll-snap-align: start; cursor: default; contain: paint; }
  .pdx-slide img { object-fit: cover; }
  .pdx-thumbs { display: none; }
  .pdx-count {
    position: absolute;
    left: 50%;
    bottom: 12px;
    display: block;
    transform: translateX(-50%);
    padding: 4px 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
  }
  .pdx-info { padding: 0 var(--rc-pad); }
  .pdx-sticky { position: static; max-height: none; overflow: visible; padding: 20px 0 32px; }
  .pdx-size { height: 41px; }
  .pdx-tab { padding: 12px 8px; font-size: 11px; }
  .pdx-related { padding-top: 48px; }
  .pdx-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; margin: 0 calc(-1 * var(--rc-pad)); }
  .pdx-lb-arrow { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .pdx-sizes.is-need .pdx-sizegrid { animation: none; }
}

/* Atelier: видео в ленте, превью видео в миниатюрах */
.pdx-slide--video { cursor: default; background: #111; }
.pdx-slide--video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pdx-thumb--video { position: relative; }
.pdx-thumb--video::after { content: ""; position: absolute; left: 50%; top: 50%; border: 7px solid transparent; border-left: 11px solid #fff; transform: translate(-30%, -50%); filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.4)); }
.pdx-thumb.is-active { border-color: var(--ink); }
.pdx-related .grid { --x: 0; }
.pdx .buybar { font-family: var(--rc-font); }
@media (max-width: 989px) {
  .pdx-slide--video video { object-fit: cover; }
  .pdx-title { font-size: 18px; }
  .pdx-tab { font-size: 15px; }
}
@media (min-width: 990px) { .pdx .buybar { display: none; } }
.pdx-tab { padding: 14px 6px; font-size: 15px; white-space: nowrap; } .pdx-tabs { grid-auto-columns: auto; justify-content: space-between; }
.pdx .buybar .btn { color: var(--on-olive); font-family: var(--rc-font); font-size: 15px; text-transform: uppercase; letter-spacing: 0.12em; }
