.product-videos-section {
  padding-block: var(--block-space-lg);

  .section-header {
    margin-bottom: var(--block-space-md);

    @media (min-width: 769px) {
      margin-bottom: 48px;
    }
  }
}

.product-videos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;

  @media (min-width: 640px) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  @media (min-width: 1025px) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
  }
}

.product-videos-single .product-videos {
  grid-template-columns: 1fr;
  max-width: 880px;
  margin-inline: auto;
}

.product-video-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--background-color);
  border: 1px solid var(--neutral-300);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);

  &:hover {
    border-color: var(--brand-primary-200);
    box-shadow: 0 8px 24px rgba(0, 68, 66, 0.1);
  }

  &:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 3px;
  }

  &:hover .product-video-play,
  &:focus-visible .product-video-play {
    transform: scale(1.08);
  }
}

.product-video-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--brand-primary-800);

  img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.product-video-play {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-accent);
  color: var(--brand-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s var(--ease);

  svg {
    width: 20px;
    height: 20px;
    margin-left: 2px;
  }
}

.product-videos-single .product-video-play {
  left: 16px;
  bottom: 16px;
  width: 56px;
  height: 56px;

  svg {
    width: 24px;
    height: 24px;
  }
}

.product-video-duration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 2px 8px;
  border-radius: var(--border-radius-xs);
  background: rgba(0, 49, 48, 0.85);
  color: var(--background-color);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.product-video-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
}

.product-video-title {
  font-weight: 600;
  font-size: 18px;
  line-height: 1.35;
}

.product-video-description {
  color: var(--text-muted);
  line-height: 1.5;
}

.product-videos-download {
  gap: 8px;
}

/* Modal */
html.product-video-open {
  overflow: hidden;
}

.product-video-dialog {
  width: min(1100px, calc(100vw - 2 * var(--site-padding)));
  max-width: none;
  max-height: calc(100dvh - 2 * var(--site-padding));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--border-radius-sm);
  background: var(--brand-primary-800);
  color: var(--background-color);
  overflow: auto;

  &::backdrop {
    background: rgba(0, 20, 19, 0.8);
  }
}

.product-video-dialog-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;

  @media (min-width: 769px) {
    padding: 16px 20px 20px;
  }
}

.product-video-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.product-video-dialog-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.product-video-dialog-close {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;

  &:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  &:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
  }

  svg {
    width: 20px;
    height: 20px;
  }
}

.product-video-player video {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 160px);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--border-radius-xs);
}

.product-video-share {
  align-self: flex-end;
  color: var(--brand-accent);
  font-size: 14px;

  &:hover {
    text-decoration: underline;
  }

  &:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
  }
}
