/* =========================
   SLIDER WRAPPER
========================= */

.ytvm-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: block;
}

/* =========================
   TRACK (THIS WAS MISSING)
========================= */

.ytvm-track {
  display: flex;
  transition: transform 0.5s ease;
  will-change: transform;
}

/* =========================
   SLIDE ITEM
========================= */

.ytvm-item {
  flex: 0 0 calc(33.3333% - 20px);
  margin-right: 20px;
  box-sizing: border-box;
  position: relative;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .ytvm-item {
    flex: 0 0 calc(50% - 16px);
    margin-right: 16px;
  }
}

@media (max-width: 768px) {
  .ytvm-item {
    flex: 0 0 100%;
    margin-right: 0;
  }
}

.ytvm-item img {
  width: 100%;
  display: block;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.ytvm-item:hover img {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

/* =========================
   PLAY ICON
========================= */

.ytvm-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.15));
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ytvm-item:hover .ytvm-play {
  opacity: 1;
}

/* =========================
   ARROWS
========================= */

.ytvm-prev,
.ytvm-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 50;
}

.ytvm-prev {
  left: 10px;
}
.ytvm-next {
  right: 10px;
}

/* =========================
   OVERLAY (FULLSCREEN FIX)
========================= */

.ytvm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999999; /* beats header */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.ytvm-overlay.active {
  display: flex;
}

/* =========================
   VIDEO FRAME
========================= */

.ytvm-overlay iframe {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  background: #000;
}

/* =========================
   CLOSE BUTTON (FIXED)
========================= */

.ytvm-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 26px;
  border: none;
  cursor: pointer;
  z-index: 10000000;
}

.ytvm-track .ytvm-item:last-child {
  margin-right: 0;
}
