/* ============================================================
   Product voice: the small player that reads the product aloud.
   Idle: only the play button. Playing: back / pause / forward and a thick
   frame around the bar that fills as the voice goes. Finished: replay icon.
   Colours and sizes come from variables set by the widget's controls.
   ============================================================ */

.vp { position: relative; direction: rtl; font-family: inherit; }

.vp__bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--vp-bg, #f3f0ff);
  color: var(--vp-text, #23254b);
  box-sizing: border-box;
  transition: box-shadow .2s, background .2s;
}

/* the frame: a thick line just outside the bar */
.vp__frame { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); overflow: visible; pointer-events: none; z-index: -1; }
.vp__frame path { fill: none; stroke-width: 2; stroke-linecap: round; }
.vp__track { stroke: var(--vp-track, #e2d9ff); stroke-width: 2; }
/* the frame is moved by the script on every animation frame: no transition, or it would stop and start */
.vp__prog { stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; }
.vp.is-active .vp__prog, .vp.is-done .vp__prog { opacity: 1; }
.vp.is-done .vp__prog { stroke-dashoffset: 0; }

.vp__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: right; }
.vp__title { font-size: var( --vp-font, 13px ); font-weight: 800; line-height: 1.6; color: var(--vp-text, #23254b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp__sub { font-size: 11px; color: var(--vp-sub, #7c7f8c); line-height: 1.5; }

/* The subtitle can be turned off per device in the widget. */
.vp[style*="--vp-show-sub: 0"] .vp__sub,
.vp[style*="--vp-show-sub:0"] .vp__sub { display: none; }

.vp__ctrl { display: inline-flex; align-items: center; gap: 6px; flex: none; direction: rtl; }

.vp__skip {
  position: relative;
  width: 30px; height: 30px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--vp-skip, var(--vp-accent, #7a5af5));
  display: inline-flex;
  align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.vp__skip svg { width: 24px; height: 24px; }
.vp__skip i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 9px; font-weight: 700; }
.vp__skip:active { transform: scale(.94); }

.vp__play {
  position: relative;
  width: var(--vp-play, 42px); height: var(--vp-play, 42px);
  border: 0; border-radius: 50%;
  background: var(--vp-play-bg, #fff);
  color: var(--vp-play-icon, var(--vp-accent, #7a5af5));
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  box-shadow: 0 1px 4px rgba(122, 90, 245, .18);
}
.vp__spin { display: none; width: 18px; height: 18px; border: 2px solid var(--vp-track, #e2d9ff); border-top-color: var(--vp-accent, #7a5af5); border-radius: 50%; animation: vp-spin .8s linear infinite; }
.vp.is-wait .vp__spin { display: block; }
.vp.is-wait .vp__ic { display: none !important; }
@keyframes vp-spin { to { transform: rotate(360deg); } }
.vp__play:active { transform: scale(.96); }
.vp__ic { position: relative; width: 44%; height: 44%; }
.vp__ic--pause, .vp__ic--replay { display: none; }
.vp.is-playing .vp__ic--play, .vp.is-done .vp__ic--play { display: none; }
.vp.is-playing .vp__ic--pause { display: block; }
.vp.is-done:not(.is-playing) .vp__ic--replay { display: block; width: 52%; height: 52%; }

/* the AI star; in the stuck bar it turns into the close button */
.vp__badge {
  position: relative; flex: none;
  width: 34px; height: 34px; padding: 0;
  border: 0; background: none;
  color: var(--vp-accent, #7a5af5);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: default;
}
.vp__badge svg { width: 24px; height: 24px; }
.vp__badge-x { display: none; }
.vp.is-stuck .vp__badge { cursor: pointer; width: 28px; height: 28px; }
.vp.is-stuck .vp__badge-ai { display: none; }
.vp.is-stuck .vp__badge-x { display: block; }
.vp.is-stuck .vp__sub { display: none; }
.vp.is-stuck .vp__bar { padding: 5px 10px; }
.vp.is-stuck .vp__play { width: 34px; height: 34px; }

.vp__msg { margin: 6px 4px 0; font-size: 12.5px; color: #b4232f; line-height: 1.8; }
.vp__msg[hidden] { display: none; }

/* while playing and the page has scrolled past: under the header.
   An Elementor column with a transform becomes the containing block of a
   fixed child, so `top` alone would be measured from that column. The bar is
   pinned to the viewport corner and moved with translate(), which no ancestor
   can intercept. */
.vp__ph { height: 0; }
.vp.is-stuck .vp__bar {
  position: fixed;
  inset: 0 auto auto 0;
  top: 0;
  left: 0;
  right: auto;
  bottom: auto;
  width: var(--vp-width, calc(100% - 16px));
  max-width: none;
  margin: 0;
  overflow: visible;
  z-index: 2147483000;
  transform: translate( var(--vp-left, 8px), var(--vp-top, 56px) );
  background: var(--vp-bg-stuck, var(--vp-bg, #f3f0ff));
  box-shadow: 0 6px 20px rgba(30, 24, 90, .18);
}

/* The widget's host sits above the site header (z-index 90) while the bar is
   stuck; otherwise a transformed Elementor column would paint it underneath. */
:host([data-vp-lifted]) { z-index: 2147483000 !important; }

/* The same lift when the player is not inside a shadow root. */
.vp[data-vp-lifted] { z-index: 2147483000 !important; }

/* a little smaller on a computer */
@media (min-width: 769px) {
  .vp { max-width: 340px; }
  .vp__bar { gap: 10px; padding: 5px 12px 5px 7px; }
  .vp__title { font-size: 12.5px; }
  .vp__sub { font-size: 11px; }
  .vp__play { width: var(--vp-play, 34px); height: var(--vp-play, 34px); }
  .vp__skip { width: 26px; height: 26px; }
  .vp__skip svg { width: 21px; height: 21px; }
  .vp.is-mobile-only { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .vp__spin { animation-duration: 2.4s; }
}
