/* ==========================================================================
   SOHRAAZ — IMMERSIVE REEL FEED (loaded after store.css)
   Instagram-grade motion, gestures and playback feedback.
   ========================================================================== */

body.wb-open { overflow: hidden; overscroll-behavior: none; }
body.wb-open .sz-fbag,
body.wb-open .chat-dock,
body.wb-open .mbar,
body.wb-open .site-header,
body.wb-open .header,
body.wb-open .footer { display: none !important; }

.wb-stage {
  background: #08070a;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

/* Directional transitions — no cross-fade jumps. */
.wb-reel {
  opacity: 0;
  transform: translateY(0);
  transition: opacity .38s cubic-bezier(.22,.7,.25,1), transform .38s cubic-bezier(.22,.7,.25,1);
  will-change: transform, opacity;
}
.wb-reel.on { opacity: 1; transform: none; }
.wb-reel.out-up { opacity: 0; transform: translateY(-24%); pointer-events: none; }
.wb-reel.out-down { opacity: 0; transform: translateY(24%); pointer-events: none; }
.wb-reel.on.in-down { animation: wbInDown .42s cubic-bezier(.22,.7,.25,1) both; }
.wb-reel.on.in-up { animation: wbInUp .42s cubic-bezier(.22,.7,.25,1) both; }
@keyframes wbInDown { from { opacity: .35; transform: translateY(24%); } to { opacity: 1; transform: none; } }
@keyframes wbInUp { from { opacity: .35; transform: translateY(-24%); } to { opacity: 1; transform: none; } }

.wb-vframe { background: #08070a; }
.wb-vframe video {
  object-fit: cover;
  transition: transform .35s ease;
  backface-visibility: hidden;
}
.wb-reel:not(.on) video { transform: scale(1.01); }

/* Mute control — icon always mirrors the real audio state. */
.wb-mute { transition: transform .2s ease, background .2s ease; }
.wb-mute svg .wb-slash { display: none; }
.wb-mute.is-muted svg .wb-waves { display: none; }
.wb-mute.is-muted svg .wb-slash {
  display: block;
  stroke: var(--theme-on-dark, #fff);
  stroke-width: 2;
  stroke-linecap: round;
}
.wb-mute:active { transform: scale(.92); }

/* Tap feedback (play / pause) */
.wb-tap {
  position: absolute; z-index: 5; left: 50%; top: 48%;
  width: 84px; height: 84px; margin: -42px 0 0 -42px;
  border-radius: 50%;
  background: rgba(12,10,8,.48);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  opacity: 0; pointer-events: none;
  transform: scale(.7);
}
.wb-tap.show { animation: wbTap .62s ease forwards; }
.wb-tap svg { width: 36px; height: 36px; fill: #fff; }
.wb-tap .wb-pause-mark { display: none; }
.wb-tap.paused .wb-play-mark { display: none; }
.wb-tap.paused .wb-pause-mark { display: block; }
@keyframes wbTap {
  0% { opacity: 0; transform: scale(.65); }
  28% { opacity: .95; transform: scale(1); }
  70% { opacity: .8; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.12); }
}

/* Double-tap heart burst */
.wb-hearts { position: absolute; z-index: 6; inset: 0; pointer-events: none; }
.wb-heart {
  position: absolute; width: 92px; height: 92px; margin: -46px;
  color: #ff3b5c;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.35));
  animation: wbHeart .9s cubic-bezier(.2,.8,.2,1) forwards;
}
.wb-heart svg { width: 100%; height: 100%; fill: currentColor; }
@keyframes wbHeart {
  0% { opacity: 0; transform: scale(.3) rotate(-14deg); }
  25% { opacity: 1; transform: scale(1.15) rotate(6deg); }
  55% { opacity: 1; transform: scale(1) rotate(0); }
  100% { opacity: 0; transform: scale(1.25) translateY(-90px); }
}

/* Playback progress */
.wb-scrub {
  position: absolute; z-index: 5; left: 16px; right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 3px);
  height: 3px; border-radius: 99px;
  background: rgba(255,255,255,.22);
  overflow: hidden;
}
.wb-scrub i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg,#e6cca0,#fff3d9);
  border-radius: 99px;
  transition: width .12s linear;
}

/* Navigation dots — bigger targets, pill for the active one. */
.wb-progress { bottom: calc(env(safe-area-inset-bottom) + 12px); gap: 3px; max-width: 74%; overflow: hidden; }
.wb-progress button { width: 12px; height: 12px; }
.wb-progress button::after { inset: 4.5px; transition: transform .25s ease, background .25s ease; }
.wb-progress button.on::after { transform: scaleX(2.4) scaleY(1); border-radius: 99px; }

/* Rail & buttons */
.wb-action, .wb-cs-close, .wb-cs-form button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.wb-action { transition: transform .18s ease; }
.wb-action:active { transform: scale(.9); }
.wb-action.liked .rb { animation: wbPop .42s ease; }
@keyframes wbPop { 50% { transform: scale(1.22); } }
.wb-bag { transition: transform .18s ease, box-shadow .2s ease; }
.wb-bag:active { transform: scale(.97); }

/* Comments sheet sits above the reel chrome. */
.wb-commentsheet { z-index: 9; }
.wb-cs-tools { display: flex; gap: 10px; margin-top: 5px; }
.wb-cs-tools button {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--gold-text, #b58b50); font-size: 11px; font-weight: 600;
}
.wb-cs-tools button:hover { text-decoration: underline; }
.wb-cs-signin {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: var(--gap-5xl) var(--gap-7xl);
  border-top: var(--gap-p1) solid color-mix(in srgb, var(--theme-on-dark) 14%, transparent);
  color: var(--ink-2); font-size: var(--fs-p12_5);
}
.wb-cs-signin a {
  color: var(--gold-text, #b58b50); font-weight: 700; text-decoration: underline;
  text-underline-offset: 3px;
}

/* Edge-to-edge on phones and tablets. */
@media (max-width: 900px) {
  .wb-vframe video { width: 100%; max-width: none; height: 100%; }
  .wb-blur { display: none; }
  .wb-bottom { left: 14px; right: 78px; bottom: calc(env(safe-area-inset-bottom) + 26px); }
  .wb-rail { right: 8px; bottom: calc(env(safe-area-inset-bottom) + 104px); }
  .wb-action .rb { width: 50px; height: 50px; }
  .wb-action svg { width: 24px; height: 24px; }
  .wb-title { font-size: 15px; }
  .wb-price b { font-size: 20px; }
  .wb-progress button { width: 10px; height: 10px; }
  .wb-progress button::after { inset: 4px; }
}

/* Short screens / landscape: keep the garment fully visible. */
@media (max-height: 560px) and (orientation: landscape) {
  .wb-vframe video { width: auto; max-width: 52%; height: 100%; aspect-ratio: 9/16; }
  .wb-set, .wb-brand em { display: none; }
  .wb-rail { bottom: 14px; gap: 6px; }
  .wb-action .rb { width: 40px; height: 40px; }
  .wb-bottom { bottom: 14px; }
  .wb-scrub { bottom: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .wb-reel, .wb-reel.on.in-down, .wb-reel.on.in-up { animation: none !important; transition: none !important; }
  .wb-tap, .wb-heart, .wb-action.liked .rb { animation-duration: .01s !important; }
}
