/* ==========================================================================
   메인 VIDEO 줄 (PC) — 2026-08-25 신설
   BEST SELLERS 바로 위. 표지그림만 깔고, 누를 때 가운데에서 크게 재생한다.

   [설계 이유]
   - 영상 평균 10MB(최대 38MB)라 자동재생 금지. preload="none" 이 원칙.
   - 한 줄 개수는 관리자 설정(2/3/4)을 --scv-n 변수로 받는다.
     화면이 좁아지면 그 값과 무관하게 줄여서 틀이 깨지지 않게 한다.
   ========================================================================== */

#sc-video-section { --scv-n: 4; }

.scv-grid {
  display: grid;
  grid-template-columns: repeat(var(--scv-n), minmax(0, 1fr));
  gap: 18px;
}

.scv-card { min-width: 0; }

/* ── 표지 ── */
.scv-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #f2f2f2;
  cursor: pointer;
  outline: none;
}
.scv-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .45s ease;
}
.scv-thumb:hover img { transform: scale(1.045); }

.scv-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.28) 100%);
  pointer-events: none;
}

/* 재생 단추 */
.scv-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  box-shadow: 0 4px 18px rgba(0,0,0,.22);
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s ease, background .25s ease;
  z-index: 2;
}
.scv-play::before {
  content: '';
  width: 0; height: 0;
  margin-left: 4px;
  border-left: 15px solid #1a1a1a;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}
.scv-thumb:hover .scv-play { transform: translate(-50%,-50%) scale(1.09); background: #fff; }

/* 오른쪽 위 배지 */
.scv-badge {
  position: absolute; top: 9px; left: 9px;
  background: rgba(26,26,26,.78);
  color: #fff;
  font-size: 10px; font-weight: 700;
  letter-spacing: .5px;
  padding: 3px 7px;
  border-radius: 2px;
  z-index: 2;
}

/* ── 글자 ── */
.scv-info { padding: 11px 2px 0; }
.scv-brand {
  font-size: 11px; font-weight: 700; color: #8a8a8a;
  letter-spacing: .4px; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scv-name {
  font-size: 13px; color: #1a1a1a; line-height: 1.45;
  height: 2.9em; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  margin-bottom: 6px;
}
.scv-price { font-size: 14px; font-weight: 700; color: #1a1a1a; }
.scv-price .scv-off { font-size: 12px; font-weight: 700; color: #c0392b; margin-left: 5px; }
.scv-card a { text-decoration: none; color: inherit; display: block; }
.scv-card a:hover .scv-name { text-decoration: underline; }

/* ── 뼈대(로딩 중) ── */
.scv-skel { background: #f2f2f2; border-radius: 4px; aspect-ratio: 1/1; animation: scvPulse 1.3s ease-in-out infinite; }
@keyframes scvPulse { 0%,100% { opacity: 1 } 50% { opacity: .55 } }

/* ── 가운데 크게 재생 ── */
.scv-modal {
  position: fixed; inset: 0;
  z-index: 99999;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.scv-modal.on { display: flex; }
.scv-modal__bg { position: absolute; inset: 0; background: rgba(0,0,0,.82); backdrop-filter: blur(2px); }
.scv-modal__box {
  position: relative;
  width: min(860px, 100%);
  max-height: 92vh;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
  display: flex; flex-direction: column;
}
.scv-modal__box video {
  width: 100%;
  max-height: 74vh;
  background: #000;
  display: block;
  outline: none;
}
.scv-modal__close {
  position: absolute; top: 10px; right: 12px;
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; z-index: 5;
  display: flex; align-items: center; justify-content: center;
}
.scv-modal__close:hover { background: rgba(0,0,0,.8); }

.scv-modal__foot {
  background: #fff;
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.scv-modal__t { min-width: 0; flex: 1; }
.scv-modal__brand { font-size: 11px; font-weight: 700; color: #8a8a8a; letter-spacing: .4px; }
.scv-modal__name { font-size: 15px; color: #1a1a1a; line-height: 1.45; margin-top: 3px; }
.scv-modal__price { font-size: 16px; font-weight: 700; color: #1a1a1a; margin-top: 5px; }
.scv-modal__price .scv-off { font-size: 13px; color: #c0392b; margin-left: 6px; }
.scv-modal__go {
  flex-shrink: 0;
  display: inline-block;
  padding: 11px 22px;
  background: #1a1a1a; color: #fff;
  font-size: 13px; font-weight: 600;
  border-radius: 4px; text-decoration: none;
  transition: background .2s;
}
.scv-modal__go:hover { background: #333; color: #fff; }

/* 소리 안내 */
.scv-modal__mute {
  position: absolute; top: 10px; left: 12px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 6px 11px; border-radius: 20px;
  z-index: 5; pointer-events: none;
  transition: opacity .4s;
}
.scv-modal__mute.hide { opacity: 0; }

/* 불러오는 중 */
.scv-modal__load {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 42px; height: 42px;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: scvSpin .8s linear infinite;
  z-index: 4;
}
.scv-modal__load.hide { display: none; }
@keyframes scvSpin { to { transform: translate(-50%,-50%) rotate(360deg) } }

/* ── 반응형 : 설정값보다 좁으면 줄여서 틀이 깨지지 않게 ── */
@media (max-width: 1199px) {
  .scv-grid { grid-template-columns: repeat(min(var(--scv-n), 3), minmax(0, 1fr)); gap: 15px; }
}
@media (max-width: 991px) {
  .scv-grid { grid-template-columns: repeat(min(var(--scv-n), 3), minmax(0, 1fr)); gap: 13px; }
  .scv-play { width: 46px; height: 46px; }
  .scv-play::before { border-left-width: 13px; border-top-width: 8px; border-bottom-width: 8px; }
}
@media (max-width: 767px) {
  .scv-grid { grid-template-columns: repeat(min(var(--scv-n), 2), minmax(0, 1fr)); gap: 11px; }
  .scv-name { font-size: 12px; }
  .scv-price { font-size: 13px; }
  .scv-modal { padding: 12px; }
  .scv-modal__box video { max-height: 62vh; }
  .scv-modal__foot { padding: 12px 14px; }
  .scv-modal__go { width: 100%; text-align: center; }
}
@media (max-width: 420px) {
  .scv-grid { grid-template-columns: 1fr; }
}
