/* ===== PRODUCT VIDEO V3 ===== */

.product-video-section {
  margin-top: 14px;
  font-family: 'Be Vietnam Pro', sans-serif;
}

.product-video-heading {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
  color: #111;
  text-transform: uppercase;
}

/* ===== GRID ===== */

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

@media (min-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .video-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* ===== CARD ===== */

.video-card {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 12px;
  background: #e9e9e9;
  cursor: pointer;
  isolation: isolate;
}

.video-card img,
.video-card iframe,
.video-card video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  background: #000;
}

/* ===== PLAY ICON: CHỈ CHO THUMB ===== */

.video-card.is-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><circle cx="40" cy="40" r="28" fill="rgba(255,255,255,0.88)"/><path d="M34 27 L55 40 L34 53 Z" fill="%23111"/></svg>')
    center center / 56px 56px no-repeat;
}

/* ===== TITLE OVERLAY ===== */

.video-title-overlay {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 3;

  padding: 7px 8px;
  border-radius: 8px;

  font-size: 11px;
  line-height: 1.28;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;

  background: rgba(60, 60, 60, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

@media (min-width: 768px) {
  .video-title-overlay {
    font-size: 12px;
    padding: 8px 9px;
  }
}

/* ===== VIDEO ĐẦU AUTOPLAY ===== */

.video-card.is-live {
  cursor: default;
}

.video-card.is-live::before {
  display: none;
}

/* ===== XEM THÊM / RÚT GỌN ===== */

.video-load-more {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.video-load-more-btn {
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #444;
  cursor: pointer;

  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;

  padding: 4px 8px;
}

.video-load-more-btn:hover {
  color: #111;
}

.video-load-more-btn:active {
  transform: translateY(1px);
}

.video-load-more-btn[hidden],
.video-load-more[hidden] {
  display: none !important;
}

/* ===== POPUP ===== */

#videoPopup {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 10px;
  background: rgba(0, 0, 0, 0.84);
}

#videoPopup.show {
  display: flex;
}

.popup-video-frame {
  width: min(100vw - 20px, 520px);
  height: min(88vh, 92svh);
  aspect-ratio: 9 / 16;

  display: flex;
  flex-direction: column;
  overflow: hidden;

  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.26);
}

.popup-header {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 8px;
  background: #fff;
}

.popup-buy,
.popup-close {
  appearance: none;
  border: 0;
  outline: 0;
  cursor: pointer;

  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;

  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.popup-buy {
  flex: 2;
  background: #e53935;
  color: #fff;
}

.popup-close {
  flex: 1;
  background: #111;
  color: #fff;
}

#popupIframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* ===== SAFETY ===== */

.video-card *,
.popup-video-frame * {
  box-sizing: border-box;
}
.video-live-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
  background: transparent;
}
