/* Rich product description (pd-*) */
.product-desc:has(.pd-fold),
.product-desc:has(.pd-rich) {
  max-width: none;
}

/* ——— Rich designer description (Rozetka / Milesight style) ——— */
.pd-rich {
  max-width: none;
  margin: 0;
  padding: 0 2px;
  color: #121212;
  overflow: visible;
}
.pd-rich__intro {
  margin: 0 0 28px;
  max-width: 62ch;
  font-size: 1.05rem;
  line-height: 1.65;
  color: #2a2a2a;
}

/* ——— Collapse like Rozetka ——— */
.pd-fold {
  position: relative;
  overflow: visible;
}
.pd-fold__body {
  /* both axes must be non-visible — otherwise CSS forces overflow-y to auto and fold won't clip */
  overflow: hidden;
  transition: max-height .45s var(--ease);
}
.pd-fold:not(.is-open) .pd-fold__body {
  max-height: 520px;
}
.pd-fold.is-open .pd-fold__body {
  max-height: none;
}
.pd-fold__fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 52px;
  height: 120px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.92) 55%, #fff 100%);
  opacity: 1;
  transition: opacity .25s var(--ease);
}
.pd-fold.is-open .pd-fold__fade {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.pd-fold__btn {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 14px 16px;
  border: 0;
  border-top: 1px solid rgba(16, 40, 32, .08);
  background: transparent;
  color: var(--accent-deep);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.pd-fold__btn:hover {
  color: var(--accent);
  background: rgb(var(--accent-rgb) / .06);
}
.pd-fold__btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform .3s var(--ease);
}
.pd-fold.is-open .pd-fold__btn svg {
  transform: rotate(180deg);
}
.pd-fold__btn .pd-fold__label-close { display: none; }
.pd-fold.is-open .pd-fold__btn .pd-fold__label-open { display: none; }
.pd-fold.is-open .pd-fold__btn .pd-fold__label-close { display: inline; }

.pd-hero {
  position: relative;
  margin: 0 0 8px;
  border-radius: 20px;
  overflow: hidden;
  min-height: clamp(300px, 44vw, 440px);
  background-color: #0a1210;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  color: #fff;
}
.pd-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.35) 48%, rgba(0,0,0,.15) 100%);
}
.pd-hero__inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
  min-height: inherit;
  padding: clamp(20px, 4vw, 40px);
}
.pd-hero__copy h2,
.product-desc .pd-hero__copy h2 {
  margin: 0 0 10px;
  font-size: clamp(1.55rem, 3.2vw, 2.35rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.pd-hero__copy p {
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  opacity: .92;
  font-weight: 500;
}
.pd-hero__badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pd-hero__cam {
  justify-self: end;
  align-self: center;
  width: min(100%, 340px);
  height: auto;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 24px 40px rgba(0,0,0,.45));
}

.pd-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 28px;
  margin: 18px 8px 36px;
  padding: 18px 20px;
  border-radius: 16px;
  background: #0f1c17;
  color: #eaf6f0;
}
.pd-chips li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.92rem; line-height: 1.4; font-weight: 560;
}
.pd-chips li::before {
  content: "";
  flex: 0 0 8px; height: 8px; margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .25);
}

.pd-block {
  margin: 0 0 8px;
  padding: clamp(28px, 4vw, 48px) clamp(16px, 3vw, 32px);
  border-radius: 20px;
  background: #f3f6f5;
}
.pd-block--dark {
  background: #0e1613;
  color: #f2f7f4;
}
.pd-block--dark .pd-muted { color: #a8bfb4; }
.pd-block--white { background: #fff; border: 1px solid rgba(16,40,32,.06); }
.pd-block--accent {
  background: linear-gradient(160deg, #e8faf2 0%, #f7fcf9 100%);
  border: 1px solid rgb(var(--accent-rgb) / .18);
}

.pd-kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-deep);
}
.pd-block--dark .pd-kicker { color: #7dffc0; }
.pd-title {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 22ch;
  color: var(--ink);
}
.product-desc .pd-block--dark .pd-title,
.pd-block--dark h3.pd-title {
  color: #fff;
}
.pd-title--wide { max-width: 28ch; }
.pd-lead {
  margin: 0 0 22px;
  max-width: 58ch;
  font-size: 1.02rem;
  line-height: 1.65;
  color: #334;
}
.pd-block--dark .pd-lead { color: #c5d7ce; }
.pd-muted { color: var(--mute); }

.pd-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
}
.pd-split--flip > :first-child { order: 2; }
.pd-split--flip > :last-child { order: 1; }

.pd-media {
  border-radius: 16px;
  overflow: hidden;
  background: #0c0f0e;
  line-height: 0;
}
.pd-media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center center;
}
/* Full marketing frame — show entire asset, no crop */
.pd-media--photo {
  display: flex;
  justify-content: center;
  background: #0c0f0e;
}
.pd-media--photo img {
  /* ~75%: CMS/Milesight diagrams look soft when forced full-bleed */
  width: 75%;
  max-width: 100%;
  height: auto;
}
/* Diagrams / UI screenshots */
.pd-media--contain {
  display: flex;
  justify-content: center;
  background: #0c0f0e;
  padding: 0;
}
.pd-media--contain img {
  width: 75%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}
.pd-block--dark .pd-media--contain {
  background: #0c0f0e;
}
/* In split / shot grids the column is already narrow — keep full width */
.pd-split .pd-media--photo img,
.pd-split .pd-media--contain img,
.pd-shot .pd-media--photo img,
.pd-shot .pd-media--contain img {
  width: 100%;
}
/*
 * Milesight assets leave empty space for HTML text overlays.
 * Crop/zoom so the real graphic fills the rounded frame edge-to-edge.
 */
.pd-media--focus-right,
.pd-media--focus-left {
  display: grid;
  overflow: hidden;
  background: #f4f6f5;
  line-height: 0;
  aspect-ratio: 16 / 10;
}
.pd-media--focus-right img,
.pd-media--focus-left img {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
/* VCA graphic on the right */
.pd-media--focus-right img {
  object-position: right center;
}
/* MSense graphic on the left — fill whole frame */
.pd-media--focus-left img {
  object-position: left center;
}
/* Light-canvas diagrams (before/after, packaging) — full asset, no crop */
.pd-media--light {
  display: flex;
  justify-content: center;
  background: #eef2f0;
  line-height: 0;
}
.pd-media--light img {
  display: block;
  width: 75%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}
.pd-split .pd-media--light img,
.pd-shot .pd-media--light img {
  width: 100%;
}

/* ——— Videos ——— */
.pd-videos {
  margin: 8px 0;
  padding: clamp(28px, 4vw, 48px) clamp(16px, 3vw, 32px);
  border-radius: 20px;
  background: #0e1613;
  color: #f2f7f4;
}
.pd-videos .pd-kicker { color: #7dffc0; }
.pd-videos .pd-title { color: #fff; max-width: 28ch; }
.pd-videos .pd-lead { color: #c5d7ce; }
.pd-video-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  margin-top: 8px;
}
.pd-video {
  margin: 0;
  display: grid;
  gap: 10px;
}
.pd-video__frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  isolation: isolate;
}
.pd-video__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .4s var(--ease);
}
.pd-video__frame:hover img {
  transform: scale(1.04);
}
.pd-video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.pd-video__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.45) 100%);
  transition: background .2s;
}
.pd-video__frame:hover .pd-video__play {
  background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.35) 100%);
}
.pd-video__play-btn {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgb(var(--accent-rgb) / .92);
  color: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
  transition: transform .2s var(--ease), background .2s;
}
.pd-video__frame:hover .pd-video__play-btn {
  transform: scale(1.06);
  background: var(--accent);
}
.pd-video__play-btn svg {
  width: 26px;
  height: 26px;
  margin-left: 3px;
}
.pd-video figcaption {
  display: grid;
  gap: 4px;
  padding: 0 2px;
}
.pd-video figcaption strong {
  font-size: 0.98rem;
  font-weight: 750;
  color: #fff;
}
.pd-video figcaption span {
  font-size: 0.86rem;
  line-height: 1.45;
  color: #a8bfb4;
}
.pd-video.is-playing .pd-video__play,
.pd-video.is-playing .pd-video__frame img {
  display: none;
}

.pd-shot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
  align-items: start;
}
.pd-shot {
  margin: 0;
  display: grid;
  gap: 10px;
}
.pd-shot .pd-media {
  background: #0c0f0e;
}
.pd-shot .pd-media img {
  width: 100%;
  height: auto;
}
.pd-shot figcaption {
  display: grid;
  gap: 4px;
  padding: 0 2px;
}
.pd-shot figcaption strong {
  font-size: 0.98rem;
  font-weight: 750;
  color: var(--ink);
}
.pd-shot figcaption span {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--mute);
}

.pd-feat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.pd-feat {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(16,40,32,.06);
}
.pd-block--dark .pd-feat {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.08);
}
.pd-feat h4 {
  margin: 0 0 6px;
  font-size: 0.98rem;
  font-weight: 750;
}
.pd-feat p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--mute);
}
.pd-block--dark .pd-feat p { color: #a8bfb4; }

.pd-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.pd-step {
  position: relative;
  padding: 18px 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(16,40,32,.07);
}
.pd-step__n {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}
.pd-step h4 {
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.3;
}
.pd-step p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--mute);
}

.pd-cases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.pd-case {
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(16,40,32,.07);
  box-shadow: 0 8px 22px rgba(10,40,30,.05);
}
.pd-case__media {
  background: #0c0f0e;
  overflow: hidden;
  line-height: 0;
}
.pd-case img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center center;
}
.pd-case__body { padding: 16px 16px 18px; }
.pd-case__body h4 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 750;
}
.pd-case__body p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--mute);
}

.pd-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}
.pd-stat {
  padding: 16px;
  border-radius: 14px;
  background: rgb(var(--accent-rgb) / .1);
  text-align: center;
}
.pd-stat strong {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent-deep);
  margin-bottom: 4px;
}
.pd-stat span {
  font-size: 0.84rem;
  color: var(--mute);
  font-weight: 560;
}

.pd-note {
  margin: 18px 8px 0;
  font-size: 0.78rem;
  color: var(--mute);
  text-align: center;
}

@media (max-width: 900px) {
  .product-hero { grid-template-columns: 1fr; }
  .pd-hero__inner { grid-template-columns: 1fr; align-items: start; }
  .pd-hero__cam { justify-self: center; max-width: 260px; transform: none; }
  .pd-split,
  .pd-split--flip { grid-template-columns: 1fr; }
  .pd-split--flip > :first-child,
  .pd-split--flip > :last-child { order: initial; }
  .pd-feat-grid,
  .pd-shot-grid,
  .pd-cases,
  .pd-video-grid { grid-template-columns: 1fr; }
  .pd-steps { grid-template-columns: 1fr 1fr; }
  .pd-chips { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pd-steps,
  .pd-stats { grid-template-columns: 1fr; }
  .product-tabs { padding: 14px 12px 18px; }
  .pd-rich { margin: 0; }
}
