.product-detail__video .product-detail__video-trigger {
  align-items: center;
}

.product-detail__video .product-detail__video-content {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding-inline: 0;
}

.product-detail__video,
.product-detail__video > details,
.product-detail__video .additional__content {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.product-detail__video-content::after {
  height: 22px;
}

.product-detail__video-carousel {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.product-detail__video-card:focus-visible,
.product-detail__video-modal-close:focus-visible,
.product-detail__video-fallback-link:focus-visible {
  outline: 3px solid rgb(var(--color-text));
  outline-offset: 3px;
}

.product-detail__video-track {
  display: flex;
  gap: 12px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.product-detail__video-track::-webkit-scrollbar {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .product-detail__video-track {
    cursor: grab;
  }

  .product-detail__video-track .product-detail__video-card {
    cursor: grab;
  }

  .product-detail__video-track.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    scroll-snap-type: none;
    user-select: none;
  }

  .product-detail__video-track.is-dragging .product-detail__video-card {
    cursor: grabbing;
  }
}

.product-detail__video-card {
  position: relative;
  flex: 0 0 clamp(160px, calc((100% - 36px) / 4), 190px);
  width: clamp(160px, calc((100% - 36px) / 4), 190px);
  aspect-ratio: 9 / 14.5;
  padding: 0;
  overflow: hidden;
  color: #fff;
  font: inherit;
  text-align: inherit;
  appearance: none;
  background: rgba(var(--color-text), 0.09);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  box-shadow: inset 0 0 0 0 rgba(255, 255, 255, 0);
  transition: box-shadow 160ms ease;
}

.product-detail__video-card.is-active {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.72),
    0 0 0 1px rgba(var(--color-text), 0.18);
}

.product-detail__video-carousel[data-video-layout="single"] .product-detail__video-card {
  flex-basis: clamp(220px, 42%, 260px);
  width: clamp(220px, 42%, 260px);
}

.product-detail__video-carousel[data-video-layout="pair"] .product-detail__video-card {
  flex-basis: clamp(190px, calc((100% - 12px) / 2), 240px);
  width: clamp(190px, calc((100% - 12px) / 2), 240px);
}

.product-detail__video-carousel[data-video-count="3"] .product-detail__video-card {
  flex-basis: clamp(170px, calc((100% - 24px) / 3), 200px);
  width: clamp(170px, calc((100% - 24px) / 3), 200px);
}

.product-detail__video-carousel[data-video-count="4"] .product-detail__video-card {
  flex-basis: clamp(155px, calc((100% - 36px) / 4), 180px);
  width: clamp(155px, calc((100% - 36px) / 4), 180px);
}

.product-detail__video-carousel[data-video-layout="many"] .product-detail__video-card {
  flex-basis: clamp(148px, 17vw, 176px);
  width: clamp(148px, 17vw, 176px);
}

.product-detail__video-preview {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(var(--color-text), 0.16), rgba(var(--color-text), 0.52)),
    rgb(var(--color-text));
}

.product-detail__video-preview::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 45%, rgba(0, 0, 0, 0.42) 100%);
}

.product-detail__video-poster {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 180ms ease;
}

.product-detail__video-preview-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  object-fit: cover;
  background: transparent;
  border: 0;
}

.product-detail__video-card.is-preview-playing .product-detail__video-poster {
  opacity: 0;
}

.product-detail__video-provider {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  padding: 4px 7px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 3px;
}

.product-detail__video-provider:empty {
  display: none;
}

.product-detail__video-play {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #111;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.24);
  transition: background-color 140ms ease, transform 140ms ease;
}

.product-detail__video-card.is-preview-playing .product-detail__video-play {
  opacity: 0;
  transform: scale(0.92);
}

.product-detail__video-loading {
  position: absolute;
  bottom: 14px;
  left: 50%;
  z-index: 3;
  display: block;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  pointer-events: none;
  opacity: 0;
  border: 2px solid rgba(255, 255, 255, 0.46);
  border-top-color: #fff;
  border-radius: 50%;
}

.product-detail__video-card.is-preview-loading .product-detail__video-loading {
  opacity: 1;
  animation: product-video-preview-loading 700ms linear infinite;
}

.product-detail__video-card.is-preview-loading .product-detail__video-play {
  opacity: 0.72;
}

@keyframes product-video-preview-loading {
  to {
    transform: rotate(360deg);
  }
}

.product-detail__video-play-icon {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid currentColor;
}

.product-detail__video-card:hover .product-detail__video-play,
.product-detail__video-card:focus-visible .product-detail__video-play {
  background: #fff;
  transform: scale(1.04);
}

.product-detail__video-unavailable {
  position: relative;
  z-index: 3;
  max-width: calc(100% - 28px);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.product-detail__video-external-action {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 3;
  padding: 9px 10px;
  color: #111;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 4px;
}

.product-detail__video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 36px 84px 48px;
  overflow: hidden;
  background: rgba(32, 28, 24, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.product-detail__video-modal.is-open {
  opacity: 1;
}

.product-detail__video-modal-dialog {
  position: relative;
  width: min(420px, calc(100vw - 120px), 46.125vh);
  max-width: 100%;
}

.product-detail__video-modal-frame {
  position: relative;
  width: 100%;
  max-height: 82vh;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 14px;
  box-shadow: none;
  opacity: 1;
  transition: opacity 120ms ease;
}

.product-detail__video-modal-frame.is-switching {
  opacity: 0;
}

.product-detail__video-modal-frame video,
.product-detail__video-modal-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: 9 / 16;
  background: transparent;
  border: 0;
}

.product-detail__video-modal-frame video {
  object-fit: contain;
}

.product-detail__video-modal-navigation {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.product-detail__video-modal-navigation[hidden] {
  display: none;
}

.product-detail__video-modal-nav {
  position: absolute;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  color: #27231f;
  background: rgba(248, 245, 240, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  opacity: 0.74;
  pointer-events: auto;
  transform: translateY(-50%);
  transition:
    background-color 200ms ease,
    opacity 200ms ease,
    transform 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .product-detail__video-modal-dialog:hover .product-detail__video-modal-nav,
  .product-detail__video-modal-nav:focus-visible {
    opacity: 1;
  }

  .product-detail__video-modal-nav:not(:disabled):hover {
    background: #f8f5f0;
    transform: translateY(-50%) scale(1.05);
  }
}

.product-detail__video-modal-nav--previous {
  left: -68px;
}

.product-detail__video-modal-nav--next {
  right: -68px;
}

.product-detail__video-modal-nav--previous svg {
  transform: rotate(180deg);
}

.product-detail__video-modal-nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.product-detail__video-modal-pagination {
  position: absolute;
  bottom: -30px;
  left: 50%;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transform: translateX(-50%);
}

.product-detail__video-modal-pagination[hidden] {
  display: none;
}

.product-detail__video-modal-dot {
  display: block;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 50%;
}

.product-detail__video-modal-dot.is-active {
  width: 7px;
  height: 7px;
  background: rgba(255, 255, 255, 0.95);
}

.product-detail__video-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #fff;
  background: rgba(20, 20, 20, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  cursor: pointer;
  transition:
    background-color 200ms ease,
    transform 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .product-detail__video-modal-close:hover {
    background: rgba(20, 20, 20, 0.78);
    transform: scale(1.05);
  }
}

.product-detail__video-modal-close:focus-visible,
.product-detail__video-modal-nav:focus-visible,
.product-detail__video-fallback-link:focus-visible {
  outline-color: #fff;
}

.product-detail__video-modal-close svg {
  width: 18px;
  height: 18px;
}

.product-detail__video-modal-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 36px 24px;
  color: rgb(var(--color-text));
  text-align: center;
  background: #f8f5f0;
}

.product-detail__video-modal-fallback p {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 700;
}

.product-detail__video-fallback-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  background: rgb(var(--color-text));
  border-radius: 4px;
}

.product-video-modal-open {
  overflow: hidden;
}

@media (min-width: 960px) {
  .product-detail[data-desktop-direction="row"] .product-detail__info,
  .product-detail[data-desktop-direction="row"] .product-detail__media-group,
  .product-detail[data-desktop-direction="row"] > .product-detail__media-gallery {
    min-width: 0;
  }

}

@media (min-width: 768px) and (max-width: 900px) {
  .product-detail__video-modal-nav--previous {
    left: -58px;
  }

  .product-detail__video-modal-nav--next {
    right: -58px;
  }
}

@media (max-width: 767px) {
  .product-detail__video-modal {
    padding: 16px 12px 44px;
  }

  .product-detail__video-modal-dialog {
    width: min(calc(100vw - 24px), 430px);
    width: min(calc(100vw - 24px), 430px, calc(56.25svh - 36px));
  }

  .product-detail__video-modal-frame {
    max-height: calc(100svh - 64px);
    border-radius: 13px;
  }

  .product-detail__video-modal-navigation {
    z-index: 3;
    display: block;
  }

  .product-detail__video-modal-nav {
    width: 40px;
    height: 48px;
    color: rgba(255, 255, 255, 0.88);
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
    opacity: 0.7;
    transition: opacity 200ms ease;
  }

  .product-detail__video-modal-nav:active,
  .product-detail__video-modal-nav:focus-visible {
    background: transparent;
    opacity: 1;
    transform: translateY(-50%);
  }

  .product-detail__video-modal-dialog:hover .product-detail__video-modal-nav {
    opacity: 0.7;
  }

  .product-detail__video-modal-nav:not(:disabled):hover {
    background: transparent;
    opacity: 1;
    transform: translateY(-50%);
  }

  .product-detail__video-modal-nav svg {
    width: 20px;
    height: 20px;
  }

  .product-detail__video-modal-nav--previous {
    left: 10px;
  }

  .product-detail__video-modal-nav--next {
    right: 10px;
  }

  .product-detail__video-modal-pagination {
    bottom: -28px;
  }

  .product-detail__video-modal-close {
    top: 12px;
    right: 12px;
  }
}

@media (min-width: 600px) and (max-width: 959px) {
  .product-detail__video-track {
    gap: 12px;
    padding-inline-end: 18px;
  }

  .product-detail__video-carousel[data-video-layout="single"] .product-detail__video-card {
    flex-basis: 260px;
    width: 260px;
  }

  .product-detail__video-carousel[data-video-layout="pair"] .product-detail__video-card {
    flex-basis: clamp(180px, calc((100% - 12px) / 2), 230px);
    width: clamp(180px, calc((100% - 12px) / 2), 230px);
  }

  .product-detail__video-carousel[data-video-layout="few"] .product-detail__video-card,
  .product-detail__video-carousel[data-video-layout="many"] .product-detail__video-card {
    flex-basis: clamp(150px, 25vw, 180px);
    width: clamp(150px, 25vw, 180px);
  }
}

@media (max-width: 599px) {
  .product-detail__video-track {
    gap: 10px;
    padding-inline-end: 16px;
  }

  .product-detail__video-carousel[data-video-layout="single"] .product-detail__video-card {
    flex-basis: clamp(220px, 70vw, 260px);
    width: clamp(220px, 70vw, 260px);
  }

  .product-detail__video-carousel[data-video-layout="pair"] .product-detail__video-card {
    flex-basis: clamp(145px, calc((100% - 10px) / 2), 165px);
    width: clamp(145px, calc((100% - 10px) / 2), 165px);
  }

  .product-detail__video-carousel[data-video-layout="few"] .product-detail__video-card,
  .product-detail__video-carousel[data-video-layout="many"] .product-detail__video-card {
    flex-basis: clamp(125px, 38vw, 145px);
    width: clamp(125px, 38vw, 145px);
  }

  .product-detail__video-play {
    width: 50px;
    height: 50px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .product-detail__video-track {
    scroll-behavior: auto;
  }

  .product-detail__video-card,
  .product-detail__video-poster,
  .product-detail__video-play,
  .product-detail__video-modal-frame,
  .product-detail__video-modal-close,
  .product-detail__video-modal-nav,
  .product-detail__video-modal {
    transition: none;
  }

  .product-detail__video-card.is-preview-loading .product-detail__video-loading {
    animation: none;
  }

  .product-detail__video-card:hover .product-detail__video-play,
  .product-detail__video-card:focus-visible .product-detail__video-play {
    transform: none;
  }
}
