.pwvca-library {
  display: grid;
  gap: 24px;
  grid-template-columns: var(--pwvca-library-columns, 1fr);
}

.pwvca-library > h2,
.pwvca-library > p {
  grid-column: 1 / -1;
}

.pwvca-course-card {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--pwvca-primary, #1b4332) 20%, #ffffff);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--pwvca-card-bg-start, #fffdf8) 0%, var(--pwvca-card-bg-end, #f4efe3) 100%);
  box-shadow: 0 24px 50px rgba(16, 24, 40, 0.09);
}

.pwvca-course-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.pwvca-course-header h3 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.pwvca-course-header p {
  margin: 0;
  color: rgba(15, 23, 42, 0.72);
}

.pwvca-course-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--pwvca-library-columns, repeat(auto-fit, minmax(240px, 1fr)));
  gap: 22px;
}

.pwvca-course-tile {
  display: grid;
  overflow: hidden;
  min-height: 100%;
  border: 1px solid color-mix(in srgb, var(--pwvca-primary, #1b4332) 16%, #ffffff);
  border-radius: 24px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 20px 44px rgba(16, 24, 40, 0.1);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.pwvca-course-tile:hover,
.pwvca-course-tile:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--pwvca-primary, #1b4332) 44%, #ffffff);
  box-shadow: 0 26px 54px rgba(16, 24, 40, 0.16);
  color: inherit;
  text-decoration: none;
}

.pwvca-course-tile-media {
  display: block;
  aspect-ratio: 16 / 9;
  background: color-mix(in srgb, var(--pwvca-primary, #1b4332) 10%, #f8fafc);
}

.pwvca-course-tile-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pwvca-course-tile-body {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.pwvca-course-tile-title {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
}

.pwvca-course-tile-meta {
  color: rgba(15, 23, 42, 0.62);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pwvca-course-tile-access,
.pwvca-course-access-notice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pwvca-primary, #1b4332) 12%, #ffffff);
  color: var(--pwvca-primary, #1b4332);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.pwvca-course-tile-access {
  padding: 8px 11px;
}

.pwvca-course-access-notice {
  margin: 0;
  padding: 10px 14px;
}

.pwvca-course-detail {
  grid-column: 1 / -1;
  display: grid;
  gap: 18px;
}

.pwvca-back-link {
  justify-self: start;
  color: var(--pwvca-primary, #1b4332);
  font-weight: 700;
  text-decoration: none;
}

.pwvca-back-link:hover,
.pwvca-back-link:focus-visible {
  text-decoration: underline;
}

.pwvca-course-detail .pwvca-course-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.pwvca-course-detail .pwvca-player-frame {
  max-width: none;
}

.woocommerce-product-gallery .pwvca-product-preview-slide,
.pwvca-product-preview-slide {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
}

.woocommerce-product-gallery .pwvca-product-preview-trigger,
.pwvca-product-preview-trigger {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0 !important;
  border-radius: 26px;
  background: #020617;
  cursor: pointer;
  color: #fff;
  text-decoration: none !important;
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.18);
}

.woocommerce-product-gallery .pwvca-product-preview-trigger img,
.pwvca-product-preview-trigger img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  opacity: 0.84;
  transform: scale(1.01);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.woocommerce-product-gallery .pwvca-product-preview-trigger:hover img,
.pwvca-product-preview-trigger:hover img {
  opacity: 0.94;
  transform: scale(1.04);
}

.pwvca-product-preview-trigger::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.2), transparent 24%),
    linear-gradient(180deg, transparent 42%, rgba(2, 6, 23, 0.76) 100%);
  pointer-events: none;
}

.pwvca-product-preview-play {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 2;
  width: 82px;
  height: 82px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, background 0.2s ease;
}

.pwvca-product-preview-trigger:hover .pwvca-product-preview-play {
  transform: translate(-50%, -50%) scale(1.06);
  background: #fff;
}

.pwvca-product-preview-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 13px 0 13px 20px;
  border-color: transparent transparent transparent var(--pwvca-primary, #1b4332);
}

.pwvca-product-preview-label {
  position: absolute;
  z-index: 2;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.68);
  color: #fff !important;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.pwvca-product-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 7, 18, 0.82);
}

.pwvca-product-preview-modal[hidden] {
  display: none;
}

.pwvca-product-preview-dialog {
  position: relative;
  width: min(1040px, 100%);
}

.pwvca-product-preview-close {
  position: absolute;
  top: -18px;
  right: -18px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.25);
}

.pwvca-product-preview-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  background: #000;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.45);
}

.pwvca-product-preview-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

body.pwvca-preview-open {
  overflow: hidden;
}

.pwvca-player-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.pwvca-player-shell-selfhosted {
  grid-template-columns: minmax(0, 1fr);
}

.pwvca-player-shell-embedded {
  grid-template-columns: minmax(0, 1fr);
}

.pwvca-video-collection {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.pwvca-video-collection-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding-top: 12px;
}

.pwvca-video-item {
  display: grid;
  gap: 4px;
  min-height: 58px;
  text-align: left;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.07);
  color: rgba(15, 23, 42, 0.86);
  cursor: pointer;
}

.pwvca-video-item:hover,
.pwvca-video-item.is-active {
  background: var(--pwvca-primary, #1b4332);
  color: #fff;
}

.pwvca-video-item-title {
  font-weight: 700;
}

.pwvca-video-item-meta {
  min-height: 14px;
  font-size: 12px;
  opacity: 0.76;
}

.pwvca-panel-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.55);
}

.pwvca-player-frame {
  position: relative;
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
}

.pwvca-video-stage {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #050505;
  min-height: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.pwvca-video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  background: #000;
}

.pwvca-video.is-hidden {
  display: none;
  pointer-events: none;
}

.pwvca-embed-stage {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 1;
}

.pwvca-embed-stage.is-active {
  display: block;
}

.pwvca-embed-frame {
  width: 100%;
  height: 100%;
  border: 0;
}

.pwvca-watermark {
  position: absolute;
  z-index: 4;
  top: 10%;
  left: 8%;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.54);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  pointer-events: none;
  transition: top 0.6s ease, left 0.6s ease, right 0.6s ease, bottom 0.6s ease;
}

.pwvca-player-shell.is-embed .pwvca-video-stage {
  min-height: auto;
  background: #000;
}

.pwvca-player-shell.is-embed .pwvca-video.is-hidden {
  display: none;
}

.pwvca-player-shell.is-embed .pwvca-embed-stage {
  position: relative;
  inset: auto;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.pwvca-player-shell.is-embed .pwvca-embed-frame {
  position: absolute;
  inset: 0;
}

.pwvca-player-shell.is-embed .pwvca-player-frame {
  max-width: 1100px;
}

.pwvca-player-shell.is-embed .pwvca-watermark {
  top: 14px;
  left: 14px;
  z-index: 6;
}

.pwvca-course-notice {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.05);
}

@media (max-width: 900px) {
  .pwvca-player-shell {
    grid-template-columns: 1fr;
  }

  .pwvca-course-card {
    padding: 16px;
    border-radius: 18px;
  }

  .pwvca-video-stage {
    min-height: auto;
    border-radius: 18px;
  }

  .pwvca-watermark {
    font-size: 10px;
    padding: 6px 10px;
  }
}

@media (max-width: 640px) {
  .pwvca-course-grid {
    grid-template-columns: 1fr;
  }

  .pwvca-product-preview-modal {
    padding: 14px;
  }

  .pwvca-product-preview-close {
    top: -12px;
    right: -8px;
  }

  .pwvca-video-collection-list {
    grid-template-columns: 1fr;
  }
}
