/*
 * Animated notification-bar presets.
 *
 * Loaded only when the ACTIVE bar uses a preset other than «classic».
 * The classic bar keeps its own inline <style> in class-bars.php and never
 * loads this file, so every bar that existed before 1.16.0 is untouched.
 *
 * Composition: the outer .vapp-storebar still owns position, colours, the
 * dismiss button and the body offset. Everything here styles the animated
 * CONTENT that sits inside it, so scheduling / one-active / dismiss behave
 * exactly as before.
 */

/* The outer chrome drops its padding so the preset can own its full height. */
.vapp-storebar--anim { padding: 0; }

.vsob-bar {
  --vsob-accent: #ffd34e;
  --vsob-cta-bg: #4a0d1c;
  --vsob-cta-fg: #ffffff;
  --vsob-deco: #f6c64e;
  --vsob-h: 48px;
  --vsob-h-m: 42px;
  --vsob-pad: 16px;
  --vsob-gap: 10px;
  --vsob-shift: 100%;
  --vsob-shift-out: -100%;

  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: var(--vsob-h);
  padding-inline: var(--vsob-pad);
  overflow: hidden;
  color: inherit;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  box-sizing: border-box;
}

.vsob-bar *, .vsob-bar *::before, .vsob-bar *::after { box-sizing: border-box; }
a.vsob-bar, a.vsob-bar:hover, a.vsob-bar:focus { color: inherit; text-decoration: none; }
.vsob-bar:focus-visible { z-index: 10000; outline: 3px solid var(--vsob-accent); outline-offset: -3px; }

.vsob-align-start { justify-content: flex-start; }
.vsob-align-center { justify-content: center; }
.vsob-align-end { justify-content: flex-end; }

.vsob-move-fade { --vsob-shift: 0px; --vsob-shift-out: 0px; }
.vsob-move-slide_fade { --vsob-shift: 12px; --vsob-shift-out: -12px; }

.vsob-text, .vsob-hl, .vsob-cta { position: relative; z-index: 1; }
.vsob-hl { color: var(--vsob-accent); font-weight: 800; }

.vsob-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: var(--vsob-cta-fg);
  background: var(--vsob-cta-bg);
  font-size: .78em;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .18s ease, filter .18s ease;
}
.vsob-cta:hover { color: var(--vsob-cta-fg); filter: brightness(1.12); transform: translateY(-1px); }
.vsob-cta:focus-visible { outline: 2px solid var(--vsob-accent); outline-offset: 2px; }

/* ── Shared rotating-message primitives ─────────────────────────────── */
.vsob-viewport, .vsob-card-viewport, .vsob-hl-viewport, .vsob-deco-content {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
}
.vsob-cycle { position: relative; width: 100%; height: 100%; }
.vsob-item, .vsob-card, .vsob-deco-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: inherit;
  gap: var(--vsob-gap);
  padding-inline: 2px;
  opacity: 0;
  transform: translateY(var(--vsob-shift));
  animation: vsob-cycle-2 var(--vsob-total) ease-in-out infinite;
  animation-delay: calc(var(--vsob-index) * var(--vsob-slot));
}
.vsob-align-start .vsob-item, .vsob-align-start .vsob-card, .vsob-align-start .vsob-deco-item { justify-content: flex-start; }
.vsob-align-center .vsob-item, .vsob-align-center .vsob-card, .vsob-align-center .vsob-deco-item { justify-content: center; }
.vsob-align-end .vsob-item, .vsob-align-end .vsob-card, .vsob-align-end .vsob-deco-item { justify-content: flex-end; }

/* Scoped to the animating elements only — never a bare universal selector. */
.vsob-pause:hover .vsob-item, .vsob-pause:focus-within .vsob-item,
.vsob-pause:hover .vsob-card, .vsob-pause:focus-within .vsob-card,
.vsob-pause:hover .vsob-deco-item, .vsob-pause:focus-within .vsob-deco-item,
.vsob-pause:hover .vsob-hl-item, .vsob-pause:focus-within .vsob-hl-item,
.vsob-pause:hover .vsob-ticker-track, .vsob-pause:focus-within .vsob-ticker-track,
.vsob-pause:hover .vsob-hl, .vsob-pause:focus-within .vsob-hl { animation-play-state: paused; }

.vsob-count-1 .vsob-item, .vsob-count-1 .vsob-card, .vsob-count-1 .vsob-deco-item,
.vsob-count-1 .vsob-hl-item { animation: none; opacity: 1; transform: none; }
.vsob-count-2 .vsob-item, .vsob-count-2 .vsob-card, .vsob-count-2 .vsob-deco-item, .vsob-count-2 .vsob-hl-item { animation-name: vsob-cycle-2; }
.vsob-count-3 .vsob-item, .vsob-count-3 .vsob-card, .vsob-count-3 .vsob-deco-item, .vsob-count-3 .vsob-hl-item { animation-name: vsob-cycle-3; }
.vsob-count-4 .vsob-item, .vsob-count-4 .vsob-card, .vsob-count-4 .vsob-deco-item, .vsob-count-4 .vsob-hl-item { animation-name: vsob-cycle-4; }
.vsob-count-5 .vsob-item, .vsob-count-5 .vsob-card, .vsob-count-5 .vsob-deco-item, .vsob-count-5 .vsob-hl-item { animation-name: vsob-cycle-5; }
.vsob-count-6 .vsob-item, .vsob-count-6 .vsob-card, .vsob-count-6 .vsob-deco-item, .vsob-count-6 .vsob-hl-item { animation-name: vsob-cycle-6; }
.vsob-count-7 .vsob-item, .vsob-count-7 .vsob-card, .vsob-count-7 .vsob-deco-item, .vsob-count-7 .vsob-hl-item { animation-name: vsob-cycle-7; }
.vsob-count-8 .vsob-item, .vsob-count-8 .vsob-card, .vsob-count-8 .vsob-deco-item, .vsob-count-8 .vsob-hl-item { animation-name: vsob-cycle-8; }

@keyframes vsob-cycle-2 { 0%{opacity:0;transform:translateY(var(--vsob-shift))} 5%,45%{opacity:1;transform:none} 50%,100%{opacity:0;transform:translateY(var(--vsob-shift-out))} }
@keyframes vsob-cycle-3 { 0%{opacity:0;transform:translateY(var(--vsob-shift))} 3%,30%{opacity:1;transform:none} 33.333%,100%{opacity:0;transform:translateY(var(--vsob-shift-out))} }
@keyframes vsob-cycle-4 { 0%{opacity:0;transform:translateY(var(--vsob-shift))} 2.5%,22.5%{opacity:1;transform:none} 25%,100%{opacity:0;transform:translateY(var(--vsob-shift-out))} }
@keyframes vsob-cycle-5 { 0%{opacity:0;transform:translateY(var(--vsob-shift))} 2%,18%{opacity:1;transform:none} 20%,100%{opacity:0;transform:translateY(var(--vsob-shift-out))} }
@keyframes vsob-cycle-6 { 0%{opacity:0;transform:translateY(var(--vsob-shift))} 1.7%,15%{opacity:1;transform:none} 16.667%,100%{opacity:0;transform:translateY(var(--vsob-shift-out))} }
@keyframes vsob-cycle-7 { 0%{opacity:0;transform:translateY(var(--vsob-shift))} 1.4%,12.9%{opacity:1;transform:none} 14.286%,100%{opacity:0;transform:translateY(var(--vsob-shift-out))} }
@keyframes vsob-cycle-8 { 0%{opacity:0;transform:translateY(var(--vsob-shift))} 1.25%,11.25%{opacity:1;transform:none} 12.5%,100%{opacity:0;transform:translateY(var(--vsob-shift-out))} }

/* ── چرخش کارتی — rotating cards ────────────────────────────────────── */
.vsob-preset-cards { padding-block: 5px; }
.vsob-preset-cards .vsob-card {
  inset-block: 5px;
  width: min(760px, 92%);
  height: calc(100% - 10px);
  margin-inline: auto;
  padding-inline: 16px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: rgba(255,255,255,.09);
  box-shadow: 0 3px 12px rgba(0,0,0,.08);
}

/* ── تپش تخفیف — pulsing sale ───────────────────────────────────────── */
.vsob-pulse-wrap { display: flex; align-items: center; justify-content: inherit; gap: var(--vsob-gap); width: 100%; }
.vsob-align-start .vsob-pulse-wrap { justify-content: flex-start; }
.vsob-align-center .vsob-pulse-wrap { justify-content: center; }
.vsob-align-end .vsob-pulse-wrap { justify-content: flex-end; }
.vsob-preset-pulse .vsob-hl { display: inline-block; transform-origin: center; animation: vsob-pulse var(--vsob-pulse-speed) ease-in-out infinite alternate; }
.vsob-preset-pulse::before {
  position: absolute;
  width: 180px; height: 180px;
  inset-inline-end: -60px;
  border: 1px solid var(--vsob-accent);
  border-radius: 50%;
  opacity: .35;
  content: "";
  pointer-events: none;
}
@keyframes vsob-pulse { to { opacity: .82; transform: scale(var(--vsob-pulse-scale)); } }

/* ── نوار روان — continuous ticker ──────────────────────────────────── */
.vsob-preset-ticker { padding-inline: 0; }
.vsob-ticker-viewport {
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right,transparent,#000 4%,#000 96%,transparent);
          mask-image: linear-gradient(to right,transparent,#000 4%,#000 96%,transparent);
}
.vsob-ticker-track { display: flex; width: max-content; will-change: transform; animation: vsob-ticker max(12s,var(--vsob-total)) linear infinite; }
.vsob-ticker-group { display: flex; align-items: center; flex-shrink: 0; gap: clamp(24px,4vw,64px); padding-inline-end: clamp(24px,4vw,64px); white-space: nowrap; }
.vsob-ticker-dot { color: var(--vsob-accent); }
[dir="rtl"].vsob-preset-ticker .vsob-ticker-track,
.vsob-preset-ticker:dir(rtl) .vsob-ticker-track { animation-direction: reverse; }
@keyframes vsob-ticker { to { transform: translateX(-50%); } }

/* ── واژهٔ چرخان — changing highlight ───────────────────────────────── */
.vsob-hl-wrap { display: flex; align-items: center; justify-content: inherit; gap: var(--vsob-gap); width: 100%; height: 100%; }
.vsob-align-start .vsob-hl-wrap { justify-content: flex-start; }
.vsob-align-center .vsob-hl-wrap { justify-content: center; }
.vsob-align-end .vsob-hl-wrap { justify-content: flex-end; }
.vsob-hl-viewport { display: inline-grid; align-items: center; width: min(260px,42vw); overflow: hidden; }
.vsob-hl-item {
  position: absolute;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 3px 10px;
  border-radius: 7px;
  color: var(--vsob-cta-bg);
  background: var(--vsob-accent);
  font-weight: 800;
  opacity: 0;
  transform: translateY(var(--vsob-shift));
  animation: vsob-cycle-2 var(--vsob-total) ease-in-out infinite;
  animation-delay: calc(var(--vsob-index) * var(--vsob-slot));
}

/* ── نوار تزئینی — decorative ───────────────────────────────────────── */
.vsob-preset-deco { gap: 18px; }
.vsob-deco { position: relative; flex: 0 0 56px; width: 56px; height: 34px; opacity: .72; }
.vsob-deco::before, .vsob-deco::after { position: absolute; border: 2px solid var(--vsob-deco); border-radius: 50% 0 50% 0; content: ""; transform: rotate(35deg); }
.vsob-deco::before { width: 28px; height: 12px; top: 3px; inset-inline-start: 2px; }
.vsob-deco::after { width: 20px; height: 9px; bottom: 3px; inset-inline-end: 1px; transform: rotate(-25deg); }
.vsob-deco-end { transform: scaleX(-1); }
.vsob-deco-content { flex: 1 1 auto; }
.vsob-deco-item { animation-timing-function: ease-in-out; }

/* ── بدون حرکت — animation switched off in the editor ───────────────── */
.vsob-still .vsob-item, .vsob-still .vsob-card, .vsob-still .vsob-deco-item,
.vsob-still .vsob-hl-item, .vsob-still .vsob-ticker-track, .vsob-still .vsob-hl { animation: none; }
.vsob-still .vsob-item:first-child, .vsob-still .vsob-card:first-child,
.vsob-still .vsob-deco-item:first-child, .vsob-still .vsob-hl-item:first-child { opacity: 1; transform: none; }
.vsob-still .vsob-item:not(:first-child), .vsob-still .vsob-card:not(:first-child),
.vsob-still .vsob-deco-item:not(:first-child), .vsob-still .vsob-hl-item:not(:first-child) { display: none; }

@media (max-width: 782px) {
  .vsob-bar { height: var(--vsob-h-m); }
  .vsob-deco { display: none; }
  .vsob-item, .vsob-card, .vsob-deco-item, .vsob-pulse-wrap, .vsob-hl-wrap { gap: max(5px,calc(var(--vsob-gap) * .7)); }
  .vsob-preset-cards .vsob-card { width: 98%; padding-inline: 9px; }
  .vsob-hl-viewport { width: min(180px,45vw); }
  .vsob-hl-item { min-height: 25px; padding: 2px 7px; }
  .vsob-cta { min-height: 25px; padding: 4px 9px; }
}

/* ── کاهش حرکت — never freeze on a hidden frame ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .vsob-bar *, .vsob-bar *::before, .vsob-bar *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .vsob-item:first-child, .vsob-card:first-child,
  .vsob-deco-item:first-child, .vsob-hl-item:first-child { opacity: 1 !important; transform: none !important; }
  .vsob-item:not(:first-child), .vsob-card:not(:first-child),
  .vsob-deco-item:not(:first-child), .vsob-hl-item:not(:first-child) { display: none !important; }
}
