/**
 * Korta Studio – YT hover na miniaturach WooCommerce
 * Dostosowane do struktury: li > a.woocommerce-LoopProduct-link > img (bez wrappera)
 */

/* ─── <a> musi być blokiem żeby wymiary działały ── */
.korta-has-yt .woocommerce-LoopProduct-link,
.korta-has-yt .woocommerce-loop-product__link {
  display: block;
}

/* ─── Wrapper na img – tu pozycjonujemy iframe i play ── */
.korta-img-wrap {
  position: relative;
  overflow: hidden;
  display: block;
  line-height: 0;
  /* border-radius przejmuj z motywu jeśli jest */
}

/* ─── Miniatura ──────────────────────────────────── */
.korta-img-wrap img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.32s ease;
  position: relative;
  z-index: 1;
}

.korta-img-wrap img.korta-thumb-hidden {
  opacity: 0;
}

/* ─── Ikona play ─────────────────────────────────── */
.korta-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Delikatne powiększenie ikony przy hover na li */
.korta-has-yt:hover .korta-play-icon:not(.korta-play-hidden) {
  transform: translate(-50%, -50%) scale(1.12);
}

.korta-play-icon.korta-play-hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.75);
}

/* ─── Wrapper iframe ─────────────────────────────── */
.korta-yt-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 2;
  opacity: 0;
  pointer-events: none; /* klik zawsze trafia do <a> */
  transition: opacity 0.35s ease;
  background: #000;
}

.korta-yt-wrap.korta-yt-visible {
  opacity: 1;
  /* pointer-events nadal none – link działa */
}

.korta-yt-wrap iframe {
  position: absolute;
  /* Większy iframe – ucina UI YT (pasek tytułu ~10% góra, logo ~15% dół) */
  top: 50%;
  left: 50%;
  width: 200%;      /* szerszy żeby ukryć boki */
  height: 130%;     /* wyższy żeby ucić pasek tytułu i logo */
  transform: translate(-50%, -50%);
  border: 0;
  display: block;
  pointer-events: none;
}

/* ─── Cień na aktywnej karcie ────────────────────── */
.korta-has-yt.korta-yt-active {
  z-index: 10;
}
.korta-has-yt.korta-yt-active .korta-img-wrap {
  box-shadow: 0 6px 28px rgba(0,0,0,0.25);
}

/* ─── Mobile ─────────────────────────────────────── */
@media (max-width: 480px) {
  .korta-play-icon {
    width: 40px;
    height: 40px;
  }
}
