/* =========================================
   1. CORE HORIZONTAL FEED
   ========================================= */
.wcsvf-feed { position: relative; margin: 20px 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.wcsvf-track { display: flex; gap: var(--wcsvf-gap); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 20px; -webkit-overflow-scrolling: touch; }
.wcsvf-slide { flex: 0 0 calc(100% / var(--wcsvf-cards)); min-width: calc(100% / var(--wcsvf-cards)); scroll-snap-align: start; cursor: pointer; position: relative; }

.wcsvf-video-wrap { position: relative; border-radius: 12px; overflow: hidden; background: #000; width: 100%; }
.wcsvf-card-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.wcsvf-play-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 44px; height: 44px; background: rgba(0,0,0,0.4); border-radius: 50%; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); pointer-events: none; transition: opacity 0.2s; }
.wcsvf-slide.playing .wcsvf-play-icon { opacity: 0; }

@media(max-width:1024px){ .wcsvf-slide { flex: 0 0 calc(100% / var(--wcsvf-cards-md)); min-width: calc(100% / var(--wcsvf-cards-md)); } }
@media(max-width:767px){ .wcsvf-slide { flex: 0 0 calc(100% / var(--wcsvf-cards-sm)); min-width: calc(100% / var(--wcsvf-cards-sm)); } }

/* =========================================
   2. LIGHTBOX & VERTICAL TRACK
   ========================================= */
.wcsvf-lightbox { position: fixed; inset: 0; background: #000; z-index: 99999; display: none; flex-direction: column; width: 100vw; height: 100dvh; }
.wcsvf-lightbox.active { display: flex; }

.wcsvf-vertical-track { width: 100%; height: 100%; overflow: hidden; }
.wcsvf-v-slide { width: 100%; height: 100%; position: relative; background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.wcsvf-v-video-container { width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 1; }
.wcsvf-v-video-container video { width: 100%; height: 100%; display: block; object-fit: cover; }

/* =========================================================
   DROP-IN CSS (Controls rail + counters alignment)
   AND Close button pinned ~30% from top (NO PHP changes)
   ========================================================= */

/* ---------- 3. CONTROLS (Right Stack) ---------- */
.wcsvf-controls{
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  bottom: calc(180px + env(safe-area-inset-bottom));
  z-index: 20;

  display: flex;
  flex-direction: column;
  align-items: center;

  /* space so the absolute counters under each button don't collide */
  gap: 22px;

  padding: 10px 8px;
  border-radius: 999px;

  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 12px 40px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.25);

  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
}

/* Buttons inside the rail */
.wcsvf-controls .wcsvf-icon-btn{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  padding: 0;

  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.16);

  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);

  box-shadow: 0 10px 26px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.14);

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

  /* CRITICAL: don't stack icon + counter */
  flex-direction: row;

  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);

  position: relative; /* anchor for counters */
}

.wcsvf-controls .wcsvf-icon-btn:hover{
  background: rgba(0,0,0,0.28);
  border-color: rgba(255,255,255,0.22);
}

.wcsvf-controls .wcsvf-icon-btn:active{
  transform: scale(0.92);
  background: rgba(0,0,0,0.35);
}

/* Normalize SVG sizing so icons center perfectly */
.wcsvf-controls .wcsvf-icon-btn svg{
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

/* Like state */
.wcsvf-like-btn.liked svg{
  fill: #ff2c55;
  color: #ff2c55;
}

/* Counters UNDER each button (no layout shift / no misalignment) */
.wcsvf-controls .wcsvf-like-count,
.wcsvf-controls .wcsvf-share-count{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -18px;

  width: max-content;
  margin: 0;

  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.2px;

  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 2px rgba(0,0,0,0.65);
  pointer-events: none;
}

/* ---------- Close button (separate, fixed at ~30% from top) ---------- */
/* NOTE: Your close button lives directly under .wcsvf-lightbox, not inside .wcsvf-controls */
.wcsvf-lightbox .wcsvf-close{
  position: absolute;
    bottom: calc(80px + env(safe-area-inset-bottom));
  right: max(15px, env(safe-area-inset-right));
  transform: translateY(-50%);
  z-index: 100;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  padding: 0;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  box-shadow: 0 10px 26px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.wcsvf-lightbox .wcsvf-close:hover{
  background: rgba(0,0,0,0.28);
  border-color: rgba(255,255,255,0.22);
}

.wcsvf-lightbox .wcsvf-close:active{
  transform: translateY(-50%) scale(0.92);
  background: rgba(0,0,0,0.35);
}

/* =========================================
   4. PRODUCT CARD — MATCH THE SAME GLASS LANGUAGE
   ========================================= */
.wcsvf-v-card{
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 10px;
  right: 10px;
  z-index: 10;

  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;

  border-radius: 22px;

  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.18),
    rgba(255,255,255,0.10)
  );
  border: 1px solid rgba(255,255,255,0.18);

  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);

  box-shadow:
    0 16px 55px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.22);
}

.wcsvf-v-thumb{
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;

  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.14);
}

.wcsvf-v-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.wcsvf-v-title{
  font-size: 14px;
  font-weight: 650;
  color: rgba(255,255,255,0.94);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.55);
}

.wcsvf-v-price{
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}

.wcsvf-v-cta{
  padding: 9px 16px;
  border-radius: 999px;

  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.18);

  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);

  color: rgba(255,255,255,0.95);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;

  box-shadow:
    0 10px 26px rgba(0,0,0,0.24),
    inset 0 1px 0 rgba(255,255,255,0.12);

  transition: transform 0.12s ease, background 0.12s ease;
}

.wcsvf-v-cta:active{
  transform: scale(0.96);
  background: rgba(0,0,0,0.45);
}

/* =========================================
   5. PROGRESS BAR
   ========================================= */
.wcsvf-progress { position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: rgba(255,255,255,0.2); z-index: 10; }
.wcsvf-bar { height: 100%; background: #ff2c55; width: 0%; transition: width 0.1s linear; }
body[style*="overflow: hidden"] { -webkit-overflow-scrolling: auto; }
