/* ═══════════════════════════════════════════════════════
   PRODUCT MODAL
   Reference: 1920px → 1px = 0.05208vw
   Design system: Gilroy (--font-ui) headings, Playfair Display (--font-display) body
   Same font sizes as main-page.css / wallpapers.css
═══════════════════════════════════════════════════════ */

/* ── Overlay — semi-transparent backdrop; sheet inside is the actual card ── */
.pmod {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);   /* darkened backdrop = clear "modal" signal */
  color: #303030;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pmod--open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Toolbar — fixed inside modal (transform ancestor = containing block) ── */
.pmod__toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 2.604vw 5.208vw;
  background: transparent;
  z-index: 10;
  pointer-events: none;
}

/* ── Close button ── */
.pmod__close {
  pointer-events: auto;
  width: 2.917vw;
  height: 2.917vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0.083vw solid #303030;
  border-radius: 50%;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 1.25vw;
  color: #303030;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.pmod__close:hover {
  background: #303030;
  color: #F2F2F2;
}

/* Light state — when close button overlaps dark photo/video content */
.pmod__close--light {
  border-color: rgba(242, 242, 242, 0.8);
  color: #F2F2F2;
}

.pmod__close--light:hover {
  background: rgba(242, 242, 242, 0.2);
  border-color: #F2F2F2;
  color: #F2F2F2;
}

/* ── Sheet — sits at bottom, leaving 12vh dark backdrop visible at top.
   Slides up from bottom when modal opens. Same treatment for all screens;
   mobile only slightly overrides top offset (10vh) for content density.
   Expanded state (added by JS on first scroll) grows sheet to fullscreen
   — top backdrop strip hides, corners un-round smoothly. */
.pmod__scroll {
  position: absolute;
  top: 12vh;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  background: #FFFFFF;
  border-radius: 1.04vw 1.04vw 0 0;
  padding-top: 2.604vw;
  transform: translateY(100%);
  transition:
    transform    0.45s cubic-bezier(0.16, 1, 0.3, 1),
    top          0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, top;
}

.pmod--open .pmod__scroll {
  transform: translateY(0);
}

.pmod--expanded .pmod__scroll {
  top: 0;
  border-radius: 0;
}

.pmod__scroll::-webkit-scrollbar { display: none; }


/* ═══════════════════════════════════════════════════════
   MAIN PRODUCT SECTION — 2 columns, centered on page
   Columns: 20.83vw video + 3.646vw gap + 31vw info = 55.476vw total
   justify-content: center → equal ~22.26vw margins each side
   align-items: stretch → info col same height as video col
═══════════════════════════════════════════════════════ */

.pmod__main {
  display: grid;
  grid-template-columns: 20.83vw 31vw;
  column-gap: 3.646vw;
  justify-content: center;
  align-items: stretch;
}

/* ── Left: video — same width/ratio as catalog card ── */
.pmod__media-col {
  overflow: hidden;
}

/* ── Video container — прямоугольник 9:16 (натуральный аспект видео).
     Без SVG-рамки телефона, без border-radius. HUD-overlay поверху. */
.pmod__phone {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
}
/* Видео — заполняет весь контейнер */
.pmod__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* HUD (время + дата + swipe hint) — поверх видео, ниже phone frame */
.pmod__phone-hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 5;
  color: #fff;
  font-family: -apple-system, 'Helvetica Neue', sans-serif;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.pmod__phone-time {
  margin-top: 12%;
  font-size: 2.75vw;
  font-weight: 100;
  letter-spacing: -0.02em;
  line-height: 1;
}
.pmod__phone-date {
  margin-top: 0.4vw;
  font-size: 0.85vw;
  font-weight: 400;
  color: rgba(255,255,255,0.85);
}
.pmod__phone-swipe {
  margin-top: auto;
  margin-bottom: 6%;
  font-size: 0.75vw;
  font-weight: 400;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.06em;
}

/* ── Right: product info ──
   Height locked to video-column height (grid align-items: stretch on parent
   .pmod__main). Video-col dictates track height via aspect-ratio 9/16, so
   info-col matches. min-height: 0 lets the desc scroll if long. Flex-column
   + margin-top:auto on backstage pins it to the info-col bottom = same
   vertical line as bottom of video. */
.pmod__info-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.pmod__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.0vw;
}

/* Title — Gilroy, same as wp-heading on wallpapers page */
.pmod__title {
  font-family: var(--font-ui);
  font-size: 1.875vw;
  font-weight: 400;
  color: #303030;
  line-height: 1.15;
}

/* Price — same weight as title */
.pmod__price {
  font-family: var(--font-ui);
  font-size: 1.875vw;
  font-weight: 400;
  color: #898989;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4vw;
}

/* Discount markup inside .pmod__price — shown when cart has items and popup item is not in it */
.pmod__price-old {
  color: #B0B0B0;
  text-decoration: line-through;
  font-size: 1.35vw;
}
.pmod__price-new {
  color: #2e7d32;
  font-weight: 500;
}

/* Left cluster in pmod__top: title + price */
.pmod__top-left {
  display: flex;
  align-items: baseline;
  gap: 1.04vw;
  min-width: 0;
}

.pmod__divider {
  border: none;
  border-top: 0.052vw solid rgba(48, 48, 48, 0.25);
  margin: 0 0 1.875vw;
}

/* ── Description ── */
/* Label — Gilroy at mp-pill standard size */
.pmod__desc-label {
  font-family: var(--font-ui);
  font-size: 0.948vw;
  font-weight: 400;
  color: #303030;
  margin: 0 0 0.625vw;
}

/* Body text — Playfair Display, same as mp-about__bio / mp-collab__desc (1.25vw).
   Clamped to 5 lines by default; JS shows the read-more toggle when the text
   is clipped. .pmod__desc-text--expanded removes the clamp. */
.pmod__desc-text {
  font-family: var(--font-display);
  font-size: 1.25vw;
  font-weight: 400;
  color: #303030;
  line-height: 1.55;
  margin: 0 0 1.875vw;
  /* pre-line: сохраняет \n\n в desc-строке как визуальный разрыв абзаца
     (используется для отделения location-метаданных от основного текста). */
  white-space: pre-line;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}
.pmod__desc-text--expanded {
  -webkit-line-clamp: unset;
  display: block;
}

/* Read-more toggle — subtle underlined link right under desc-text */
.pmod__desc-toggle {
  background: none;
  border: none;
  padding: 0;
  margin: -1.25vw 0 1.875vw;
  font-family: var(--font-ui);
  font-size: 0.85vw;
  color: #303030;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15vw;
  align-self: flex-start;
}
.pmod__desc-toggle:hover {
  color: #000;
}
.pmod__desc-toggle[hidden] { display: none; }

/* ── Tab pills — mp-pill standard ── */
.pmod__tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.521vw;
  margin-bottom: 1.875vw;
}

/* Accordion — one panel visible at a time; mirrors active tab.
   Only one panel открыт одновременно (управляется через .pmod__tab--active). */
.pmod__acc {
  margin-bottom: 1.875vw;
}
.pmod__acc-panel {
  display: none;
  font-family: var(--font-display);
  font-size: 1.25vw;
  font-weight: 400;
  color: #303030;
  line-height: 1.55;
  padding: 0.417vw 0 0;
}
.pmod__acc-panel--open {
  display: block;
}
.pmod__acc-panel a {
  color: #303030;
  text-decoration: underline;
}

.pmod__tab {
  font-size: 0.948vw !important;
  padding: 0.63vw 2.1vw !important;
}

.pmod__tab--active,
.pmod__tab--active:hover {
  background: #303030 !important;
  color: #F2F2F2 !important;
}

/* ── Add to cart — mp-pill style ── */
.pmod__add-to-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0.63vw 2.1vw;
  border-radius: 50vw;
  border: 0.08vw solid #303030;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 0.948vw;
  font-weight: 400;
  color: #303030;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease;
  margin-bottom: 1.875vw;
}

.pmod__add-to-cart:hover,
.pmod__add-to-cart--in-cart {
  background: #303030;
  color: #F2F2F2;
}

.pmod__add-to-cart--in-cart:hover {
  background: #555;
}

/* ── Toast — appears after "add to cart", auto-hides after 3s ── */
.pmod__toast {
  position: fixed;
  bottom: 2vw;
  left: 50%;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.25vw;
  padding: 0.83vw 1.667vw;
  background: #303030;
  color: #F2F2F2;
  border-radius: 0.5vw;
  font-family: var(--font-display);
  font-size: 1vw;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 0.4vw 1.5vw rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  transition:
    opacity   0.3s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pmod__toast--show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.pmod__toast-text {
  color: #F2F2F2;
}

.pmod__toast-link {
  color: #F2F2F2;
  text-decoration: underline;
  text-underline-offset: 0.2vw;
  cursor: pointer;
  font-family: var(--font-ui);
}

/* ── Backstage — compact strip at bottom of info col.
   Each image = 14.583vw × (aspect-ratio 3/2); container grows to fit N images.
   margin-top: auto pushes the strip to the info-col bottom → visually aligns
   with the bottom edge of the phone/video in the media-col. */
.pmod__backstage {
  display: flex;
  gap: 0.5vw;
  align-items: flex-end;
  margin-top: auto;
  margin-bottom: 1.875vw;
  min-height: 9.72vw;                       /* = 14.583vw × 2/3 → holds placeholder space */
  background: transparent;
}

/* Placeholder-only mode (no images) — JS toggles .pmod__backstage--empty */
.pmod__backstage--empty {
  max-width: 14.583vw;
  width: 100%;
  aspect-ratio: 3 / 2;
  min-height: 0;
  background: #D8D8D8;
  align-items: center;
  justify-content: center;
}

.pmod__backstage-img {
  width: 14.583vw;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  background: #1c1c1c;
  transition: opacity 0.2s ease;
}
.pmod__backstage-img:hover {
  opacity: 0.9;
}

.pmod__backstage-ph {
  font-family: var(--font-display);
  font-size: 1.25vw;
  color: #999;
  font-style: italic;
  cursor: default;
}

/* ── Backstage lightbox ── */
.pmod__lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
}

.pmod__lightbox--open {
  display: flex;
}

.pmod__lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.pmod__lightbox-close {
  position: absolute;
  top: 1.5vw;
  right: 1.5vw;
  background: none;
  border: none;
  color: rgba(242, 242, 242, 0.85);
  font-size: 1.667vw;
  line-height: 1;
  cursor: pointer;
  padding: 0.5vw;
  transition: color 0.2s ease;
}

.pmod__lightbox-close:hover {
  color: #F2F2F2;
}


/* ═══════════════════════════════════════════════════════
   CAROUSEL SECTIONS
═══════════════════════════════════════════════════════ */

.pmod__carousel-section {
  padding: 5.0vw 0 0;
  overflow: hidden;
}

/* Heading — Playfair Display at mp-nl__captions size (scaled 20% down) */
.pmod__carousel-heading {
  font-family: var(--font-display);
  font-size: 1.166vw;
  font-weight: 400;
  color: #303030;
  padding: 0 5.208vw;
  margin: 0 0 2.0vw;
}

/* Stage clips the track */
.pmod__carousel-stage {
  overflow: hidden;
  cursor: pointer;
}

.pmod__carousel-track {
  display: flex;
  gap: 0 1.666vw;
  will-change: transform;
}

/* ── Carousel card — scaled 20% smaller than catalog cards ── */
.pmod__ccard {
  flex-shrink: 0;
  width: 16.664vw;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.pmod__ccard-media {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #1c1c1c;
  overflow: hidden;
}

.pmod__ccard-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.35s ease;
  pointer-events: none;
}

.pmod__ccard:hover .pmod__ccard-media::after {
  background: rgba(0, 0, 0, 0.06);
}

.pmod__ccard-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pmod__ccard-foot {
  padding: 0.584vw 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.208vw;
}

.pmod__ccard-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.pmod__ccard-title {
  font-family: var(--font-ui);
  font-size: 0.8vw;
  font-weight: 400;
  color: #303030;
}

.pmod__ccard-price {
  font-family: var(--font-ui);
  font-size: 0.8vw;
  font-weight: 400;
  color: #303030;
  display: inline-flex;
  align-items: baseline;
  gap: 0.3vw;
}

/* Discount markup — shown when cart has items and this ccard is not in cart */
.pmod__ccard-price-old {
  color: #999;
  text-decoration: line-through;
  font-size: 0.68vw;
}
.pmod__ccard-price-new {
  color: #2e7d32;
  font-weight: 500;
}

.pmod__ccard-coll {
  font-family: var(--font-ui);
  font-size: 0.598vw;
  font-weight: 400;
  color: #888;
}

.pmod__ccard-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.104vw 0.48vw;
  border-radius: 8.19vw;
  border: 0.059vw solid #888;
  font-family: var(--font-ui);
  font-size: 0.562vw;
  font-weight: 400;
  color: #888;
  white-space: nowrap;
}

/* ── Dots row — reuses mp-dot from main-page.css ── */
.pmod__carousel-dots {
  display: flex;
  align-items: center;
  gap: 0.294vw;
  padding: 1.666vw 5.208vw 3.333vw;
  justify-content: center;
}


/* ═══════════════════════════════════════════════════════
   VIDEO FULLSCREEN OVERLAY
═══════════════════════════════════════════════════════ */

.pmod__vid-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.pmod__vid-overlay--open {
  opacity: 1;
  pointer-events: auto;
}

.pmod__vid-overlay-video {
  height: 90vh;
  width: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  display: block;
  cursor: default;
  pointer-events: none;
}

.pmod__vid-overlay-close {
  position: fixed;
  top: 2.604vw;
  right: 5.208vw;
  width: 2.917vw;
  height: 2.917vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0.052vw solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 1.25vw;
  color: #fff;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.pmod__vid-overlay-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}


/* ── Carousel cursor (shared: psMore + modal carousels on print-shop & wallpapers) ── */
.pmod__cursor {
  position: fixed;
  pointer-events: none;
  z-index: 1100;  /* above modals (z-index 1000) */
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: rgba(242, 242, 242, 0.92);  /* light — visible over dark card content */
  opacity: 0;
  transition: opacity 0.2s ease;
  left: -500px;
  top: -500px;
  white-space: nowrap;
}
.pmod__cursor--visible {
  opacity: 1;
}

/* Info panel fade on product switch */
.pmod__info-col {
  transition: opacity 0.25s ease;
}
.pmod__info-col--switching {
  opacity: 0;
}


/* ═══════════════════════════════════════════════════════
   IN-MODAL COLLECTION PICKER (mirrors ps-col-nav in print-shop)
═══════════════════════════════════════════════════════ */

.pmod__col-nav {
  overflow: hidden;
  padding: 2vw 0 1.5vw;
  clip-path: inset(0 5.208vw);
}

.pmod__col-nav__track {
  display: flex;
  gap: 1.04vw;
  will-change: transform;
}

.pmod__col-nav__card {
  flex: 0 0 12.5vw;
  cursor: pointer;
  position: relative;
  transform: scale(0.94);
  transition: transform 0.5s ease;
}

.pmod__col-nav__media {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #1c1c1c;
}

.pmod__col-nav__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.pmod__col-nav__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pmod__col-nav__card--active {
  transform: scale(1.04);
}

.pmod__col-nav__card--active .pmod__col-nav__media::after {
  opacity: 0;
}

.pmod__col-nav__card:not(.pmod__col-nav__card--active):hover .pmod__col-nav__media::after {
  opacity: 0.5;
}
