/* Shared close button */
.modal-x {
  position: absolute;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 16px 38px rgba(0,0,0,.24);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  cursor: pointer;
}

.modal-x::before,
.modal-x::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
}

.modal-x::before { transform: translate(-50%, -50%) rotate(45deg); }
.modal-x::after { transform: translate(-50%, -50%) rotate(-45deg); }

/* Product sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(4,7,14,var(--sheet-fade, .38));
  backdrop-filter: blur(var(--sheet-blur, 8px));
  -webkit-backdrop-filter: blur(var(--sheet-blur, 8px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, background .28s ease, backdrop-filter .28s ease;
}

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

.sheet {
  width: min(100%, 980px);
  max-height: calc(100dvh - 8px);
  min-height: min(720px, calc(100dvh - 8px));
  transform: translateY(var(--sheet-y, 105%));
  transition: transform .46s cubic-bezier(.18,1,.22,1);
  border-radius: 30px 30px 0 0;
  border: 1px solid rgba(255,255,255,.12);
  border-bottom: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(255,106,0,.10), transparent 30%),
    radial-gradient(circle at 84% 10%, rgba(82,104,220,.14), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.032)),
    rgba(8,11,18,.985);
  box-shadow: 0 -28px 110px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.09);
  overflow: hidden;
}

.sheet-backdrop.open .sheet {
  --sheet-y: 0px;
}

.sheet-handle {
  width: 96px;
  height: 34px;
  display: grid;
  place-items: center;
  margin: 6px auto 0;
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.06);
  touch-action: none;
}

.sheet-handle::before {
  content: "";
  width: 54px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.36);
}

.sheet-x {
  right: 16px;
  top: 16px;
  width: 48px;
  height: 48px;
}

.sheet-body {
  max-height: calc(100dvh - 54px);
  overflow-y: auto;
  padding: 22px clamp(22px, 4vw, 46px) 38px;
  display: grid;
  gap: 18px;
}

.sheet-chip,
.viewer-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
  color: rgba(255,255,255,.82);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.sheet-body h2 {
  max-width: 11ch;
  margin: 0;
  color: white;
  font-size: clamp(48px, 8vw, 86px);
  line-height: .92;
  letter-spacing: -.085em;
}

.sheet-body > p:not(.sheet-chip) {
  max-width: 36ch;
  color: rgba(255,255,255,.72);
  font-size: clamp(18px, 2.3vw, 22px);
  line-height: 1.68;
}

.sheet-body ul {
  display: grid;
  gap: 12px;
  max-width: 620px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.sheet-body li {
  position: relative;
  padding-left: 30px;
  color: rgba(255,255,255,.78);
  font-size: 17px;
  line-height: 1.52;
}

.sheet-body li::before {
  content: "•";
  position: absolute;
  left: 8px;
  color: var(--orange);
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

/* Video / Gallery viewers */
.video-viewer,
.gallery-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
  background: rgba(5,8,16,.26);
  backdrop-filter: blur(8px) saturate(112%);
  -webkit-backdrop-filter: blur(8px) saturate(112%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, background .28s ease;
}

.video-viewer.open,
.gallery-viewer.open {
  opacity: 1;
  pointer-events: auto;
}

.viewer-card {
  position: relative;
  width: min(100%, 440px);
  transform: translateY(20px) scale(.975);
  opacity: .98;
  transition: transform .36s cubic-bezier(.18,1,.22,1), opacity .26s ease;
  will-change: transform;
}

.video-viewer.open .viewer-card,
.gallery-viewer.open .viewer-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.video-card {
  height: min(calc(100dvh - 24px), 820px);
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 34px 90px rgba(0,0,0,.44);
  background: #000;
}

.viewer-handle {
  position: absolute;
  left: 50%;
  top: max(16px, env(safe-area-inset-top));
  z-index: 4;
  width: 76px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255,255,255,.52);
  pointer-events: none;
}

.viewer-x {
  right: 16px;
  top: 16px;
  z-index: 5;
  width: 52px;
  height: 52px;
}

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

.video-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4,8,15,.28), rgba(4,8,15,.04) 30%, rgba(4,8,15,.12) 56%, rgba(4,8,15,.80) 100%);
}

.mute-btn {
  position: absolute;
  left: 18px;
  top: 72px;
  z-index: 5;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.20), rgba(255,255,255,.08));
  color: white;
  backdrop-filter: blur(14px);
  cursor: pointer;
}

.video-meta {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 22px;
  z-index: 4;
  display: grid;
  gap: 10px;
}

.video-meta h2,
.gallery-meta h2 {
  margin: 0;
  color: white;
  font-size: clamp(28px, 6vw, 38px);
  line-height: .98;
  letter-spacing: -.055em;
  max-width: 13ch;
  text-wrap: balance;
}

.video-meta p:not(.viewer-pill),
.gallery-meta p:not(.viewer-pill) {
  margin: 0;
  max-width: 31ch;
  color: rgba(255,255,255,.80);
  line-height: 1.5;
}

.gallery-card {
  border-radius: 32px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 80% 10%, rgba(67,96,190,.22), transparent 24%),
    radial-gradient(circle at 18% 12%, rgba(184,101,28,.16), transparent 20%),
    linear-gradient(180deg, rgba(12,16,28,.94), rgba(7,11,18,.94));
  box-shadow: 0 34px 90px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.08);
}

.gallery-full-img {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 24px;
  background: #0d1119;
  border: 1px solid rgba(255,255,255,.10);
}

.gallery-full-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-meta {
  display: grid;
  gap: 9px;
  padding-top: 18px;
}

@media (max-width: 560px) {
  .sheet {
    width: 100%;
    min-height: calc(100dvh - 8px);
    max-height: calc(100dvh - 8px);
  }

  .sheet-body {
    padding-inline: 22px;
  }

  .sheet-actions {
    flex-direction: column;
  }

  .sheet-actions .btn {
    width: 100%;
  }

  .video-viewer,
  .gallery-viewer {
    padding-inline: 10px;
  }

  .video-card {
    height: calc(100dvh - 20px);
    border-radius: 30px;
  }

  .gallery-card {
    width: 100%;
  }
}
