.product-video {
  overflow: hidden;
  border: 1px solid #34455e;
  border-radius: 26px;
  background: #131c2a;
  box-shadow: 0 34px 90px -46px #154c8f66;
}

.product-video-preview {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: #f1f5fc;
  background: #0b111b;
  cursor: pointer;
  aspect-ratio: 16 / 9;
  isolation: isolate;
}

.product-video-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-video-preview::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, #050a1280, transparent 38%, #050a12c9);
}

.product-video-preview img { position: relative; z-index: -2; }
.product-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-video-play svg {
  width: 78px;
  height: 78px;
  padding: 24px;
  color: #fff;
  background: #1677ff;
  border: 1px solid #ffffff52;
  border-radius: 50%;
  box-shadow: 0 12px 44px #1677ff55;
  transition: transform 180ms ease, background 180ms ease;
}

.product-video-preview:hover .product-video-play svg { transform: scale(1.08); background: #3188ff; }
.product-video-preview:focus-visible { outline: 3px solid #8cbcff; outline-offset: -5px; }
.product-video-caption {
  position: absolute;
  bottom: 26px;
  left: 26px;
  right: 26px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  text-align: left;
  font: 700 clamp(17px, 2vw, 26px)/1.3 var(--display);
}
.product-video-caption small { flex: 0 0 auto; font: 500 14px/1.5 var(--body); color: #b4c6de; }
.product-video-link { display: block; padding: 15px 24px; color: #8ebfff; font-size: 14px; }
.product-video-link:hover { color: #fff; }

.video-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: #f1f5fc;
  background: #070c14;
  overflow: hidden;
  overscroll-behavior: none;
  color-scheme: dark;
}
.video-dialog::backdrop { background: #070c14; }
.video-dialog[open] { display: flex; flex-direction: column; }
.video-dialog-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: max(12px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left));
  background: #101723;
  border-bottom: 1px solid #ffffff12;
}
.video-dialog-heading { display: flex; align-items: center; gap: 12px; font: 700 16px/1.3 var(--display); }
.video-dialog-heading img { width: 30px; height: 30px; }
.video-dialog-actions { display: flex; align-items: center; gap: 8px; }
.video-dialog button { font: 500 14px/1.3 var(--body); cursor: pointer; }
.video-dialog-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid #ffffff26;
  border-radius: 12px;
  color: #d2e0f3;
  background: #ffffff08;
}
.video-dialog-icon:hover { background: #1f3554; color: #fff; }
.video-dialog-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.video-dialog button:focus-visible, .video-dialog video:focus-visible { outline: 3px solid #8cbcff; outline-offset: 3px; }
.video-dialog-stage { position: relative; flex: 1 1 auto; min-height: 0; display: grid; place-items: center; }
.video-dialog video { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #070c14; }
.video-dialog-sound {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border: 1px solid #97bcff6b;
  border-radius: 14px;
  color: #fff;
  background: #1677ff;
  box-shadow: 0 12px 40px #0008;
  white-space: nowrap;
}
.video-dialog-sound svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.video-dialog-sound[hidden], .video-dialog-error[hidden] { display: none; }
.video-dialog-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: #101723;
}
.video-dialog-error a { color: #8ebfff; }
html.is-video-playing { overflow: hidden; overscroll-behavior: none; }

@media (max-width: 760px) {
  .product-video { border-radius: 20px; }
  .product-video-play svg { width: 54px; height: 54px; padding: 17px; }
  .product-video-caption { left: 16px; right: 16px; bottom: 15px; gap: 12px; font-size: 15px; }
  .product-video-caption small { font-size: 11px; }
  .product-video-link { padding: 13px 16px; font-size: 12px; }
  .video-dialog-header { min-height: 60px; padding-inline: max(12px, env(safe-area-inset-left)); }
  .video-dialog-heading { font-size: 13px; gap: 8px; }
  .video-dialog-heading img { width: 26px; height: 26px; }
  .video-dialog-icon { width: 40px; height: 40px; }
  .video-dialog-sound { top: 14px; padding: 11px 15px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .product-video-play svg { transition: none; }
}
