/* «پرو مجازی» — product-page button + bottom sheet (phone) / dialog (desktop). Valabi sales assistant 0.21.0 */
.wsbt, .wsb-tryon-open {
  --wsbt-accent: #1f8a57;
  --wsbt-accent-deep: #156c43;
  --wsbt-accent-soft: #e6f4ec;
  --wsbt-ink: #15231c;
  --wsbt-muted: #5d6b64;
  --wsbt-line: #e3e8e5;
  --wsbt-paper: #ffffff;
  --wsbt-card: #f6f8f7;
  font-family: inherit;
}

/* ── the button on the product page ── */
.wsb-tryon-open {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 12px 0 16px; padding: 11px 14px;
  border: 1.5px solid var(--wsbt-accent); border-radius: 16px; background: var(--wsbt-accent-soft);
  color: var(--wsbt-accent-deep); cursor: pointer; text-align: right; font: inherit; line-height: 1.5;
  transition: background .15s, transform .1s;
}
.wsb-tryon-open:hover { filter: brightness(.97); }
.wsb-tryon-open em { margin-inline-start: auto; font-style: normal; display: inline-flex; color: var(--wsbt-accent); }
.wsb-tryon-open em.wsb-tryon-chev svg { flex: 0 0 20px; width: 20px; height: 20px; padding: 0; border-radius: 0; background: none; color: var(--wsbt-accent); stroke: currentColor; }
.wsb-tryon-open:active { transform: translateY(1px); }
.wsb-tryon-open[hidden] { display: none; }
.wsb-tryon-open svg { flex: 0 0 34px; width: 34px; height: 34px; padding: 6px; border-radius: 10px; background: var(--wsbt-accent);
  fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wsb-tryon-open span { display: flex; flex-direction: column; font-weight: 800; font-size: 15px; color: var(--wsbt-ink); }
.wsb-tryon-open small { font-weight: 500; font-size: 12.5px; color: var(--wsbt-muted); }

/* ── overlay ── */
html.wsbt-lock, html.wsbt-lock body { overflow: hidden !important; }
.wsbt { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: flex-end; justify-content: center; color: var(--wsbt-ink); }
.wsbt[hidden] { display: none; }
.wsbt-backdrop { position: absolute; inset: 0; background: rgba(12, 20, 16, .55); opacity: 0; transition: opacity .25s; }
.wsbt.is-open .wsbt-backdrop { opacity: 1; }
.wsbt-sheet {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 480px; max-height: 94dvh;
  background: var(--wsbt-paper); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.wsbt.is-open .wsbt-sheet { transform: none; }
@media (min-width: 720px) {
  .wsbt { align-items: center; }
  .wsbt-sheet { border-radius: 22px; max-height: min(860px, 92dvh); transform: translateY(24px) scale(.98); opacity: 0; transition: transform .25s, opacity .2s; }
  .wsbt.is-open .wsbt-sheet { opacity: 1; }
}
.wsbt *, .wsbt *::before, .wsbt *::after { box-sizing: border-box; }
.wsbt svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.wsbt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px 10px; border-bottom: 1px solid var(--wsbt-line); }
.wsbt-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 42px; height: 4px; margin-left: -21px; border-radius: 4px; background: #d5dbd8; }
@media (min-width: 720px) { .wsbt-head::before { display: none; } }
.wsbt-head h2 { margin: 6px 0 0; font-size: 17px; font-weight: 800; color: var(--wsbt-ink); }
.wsbt-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--wsbt-muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.wsbt-x { flex: 0 0 36px; width: 36px; height: 36px; margin-top: 2px; padding: 8px; border: 0; border-radius: 50%; background: var(--wsbt-card); color: var(--wsbt-ink); cursor: pointer; }
.wsbt-x:hover { background: var(--wsbt-line); }

.wsbt-body { flex: 1 1 auto; overflow-y: auto; padding: 14px 18px 4px; overscroll-behavior: contain; }

/* stage: guide, pair, working, result */
.wsbt-stage { margin-bottom: 12px; }
.wsbt-guide { text-align: center; padding: 10px 6px 4px; }
.wsbt-guide h3 { margin: 10px 0 8px; font-size: 16px; font-weight: 800; }
.wsbt-guide p { margin: 0; color: var(--wsbt-muted); font-size: 13.5px; line-height: 1.8; }
.wsbt-guide ul { list-style: none; margin: 0 auto; padding: 0; max-width: 300px; text-align: right; }
.wsbt-guide li { position: relative; padding: 5px 24px 5px 0; font-size: 13.5px; color: var(--wsbt-ink); }
.wsbt-guide li::before { content: "✓"; position: absolute; right: 0; top: 5px; color: var(--wsbt-accent); font-weight: 800; }
.wsbt-guide.is-error h3 { color: #a8321f; font-size: 15px; line-height: 1.8; }
.wsbt-figure { display: grid; place-items: center; width: 104px; height: 120px; margin: 0 auto; border-radius: 22px; background: var(--wsbt-accent-soft); color: var(--wsbt-accent); }
.wsbt .wsbt-figure svg { width: 64px; height: 90px; fill: var(--wsbt-accent); stroke: none; opacity: .9; }
.wsbt .wsbt-figure svg[viewBox="0 0 24 24"] { width: 46px; height: 46px; fill: none; stroke: var(--wsbt-accent); }

.wsbt-pair { display: grid; grid-template-columns: 1fr auto .8fr; align-items: center; gap: 10px; }
.wsbt-pair figure { margin: 0; text-align: center; }
.wsbt-pair img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; background: var(--wsbt-card); }
.wsbt-pair .is-product img { object-fit: contain; background: #fff; border: 1px solid var(--wsbt-line); }
.wsbt-pair figcaption { margin-top: 6px; font-size: 12px; color: var(--wsbt-muted); }
.wsbt-plus { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--wsbt-accent); color: #fff; font-weight: 800; }

.wsbt-working { position: relative; overflow: hidden; border-radius: 16px; background: var(--wsbt-card); }
.wsbt-working img { display: block; width: 100%; max-height: 52dvh; object-fit: contain; filter: saturate(.6) blur(1.5px); opacity: .55; }
.wsbt-scan { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--wsbt-accent) 24%, transparent) 48%, transparent 52%); background-size: 100% 220%; animation: wsbt-scan 2.2s linear infinite; }
@keyframes wsbt-scan { from { background-position: 0 100%; } to { background-position: 0 -120%; } }
.wsbt-progress { position: absolute; inset: auto 12px 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .94); box-shadow: 0 6px 20px rgba(0, 0, 0, .1); }
.wsbt-progress b { display: block; font-size: 14px; }
.wsbt-progress small { display: block; margin-top: 6px; color: var(--wsbt-muted); font-size: 11.5px; }
.wsbt-bar { height: 6px; margin-top: 8px; border-radius: 6px; background: var(--wsbt-line); overflow: hidden; }
.wsbt-bar i { display: block; width: 2%; height: 100%; border-radius: 6px; background: var(--wsbt-accent); transition: width .4s; }
.wsbt-dots { display: flex; gap: 4px; margin-top: 7px; }
.wsbt-dots span { flex: 1; height: 3px; border-radius: 3px; background: var(--wsbt-line); transition: background .3s; }
.wsbt-dots span.is-on { background: var(--wsbt-accent); }
.wsbt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wsbt-chips span { font-size: 12px; padding: 2px 10px; border-radius: 99px; background: var(--wsbt-card); color: var(--wsbt-muted); }
@media (prefers-reduced-motion: reduce) { .wsbt-scan { animation: none; } .wsbt-sheet { transition: none; } }

.wsbt-result { position: relative; margin: 0; }
.wsbt-result .wsbt-after { display: block; width: 100%; max-height: 56dvh; object-fit: contain; border-radius: 16px; background: var(--wsbt-card); }
.wsbt-ai { position: absolute; top: 10px; inset-inline-start: 10px; padding: 2px 10px; border-radius: 99px; background: rgba(255, 255, 255, .92); color: var(--wsbt-ink); font-size: 11px; font-weight: 700; }
.wsbt-before { position: absolute; bottom: 10px; inset-inline-end: 10px; width: 64px; padding: 0; border: 2px solid #fff; border-radius: 11px; overflow: hidden; background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); cursor: pointer; font: inherit; }
.wsbt-before img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.wsbt-before span { display: block; padding: 1px 0; font-size: 11px; font-weight: 800; color: var(--wsbt-ink); text-align: center; }

/* colours, like the shop's own swatches */
.wsbt-colors { margin: 4px 0 10px; }
.wsbt-colors-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; font-size: 14px; }
.wsbt-colors-head span { font-size: 13px; color: var(--wsbt-muted); }
.wsbt-colors-head em { font-style: normal; font-weight: 700; color: var(--wsbt-ink); }
.wsbt-swatches { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.wsbt-swatch { position: relative; flex: 0 0 76px; padding: 0; border: 1.5px solid var(--wsbt-line); border-radius: 12px; background: #fff; cursor: pointer; overflow: hidden; scroll-snap-align: center; font: inherit; color: var(--wsbt-ink); }
.wsbt-swatch img, .wsbt-swatch i { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--wsbt-card); }
.wsbt-swatch span { display: block; padding: 3px 4px; font-size: 11px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wsbt-swatch small { position: absolute; top: 28%; inset-inline: 0; color: #fff; font-weight: 800; font-size: 12px; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); }
.wsbt-swatch.is-out img { filter: grayscale(.4) brightness(.8); }
.wsbt-swatch.is-on { border-color: var(--wsbt-accent); box-shadow: 0 0 0 2px var(--wsbt-accent-soft); }
.wsbt-swatch:disabled { cursor: default; opacity: .6; }

.wsbt-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 8px; font-size: 12.5px; line-height: 1.8; color: var(--wsbt-muted); }
.wsbt-note::before { content: ""; flex: 0 0 7px; width: 7px; height: 7px; margin-top: 8px; border-radius: 50%; background: var(--wsbt-accent); opacity: .7; }
.wsbt-note.is-privacy { padding: 10px 12px; border-radius: 12px; background: var(--wsbt-card); color: var(--wsbt-ink); }
.wsbt-note.is-privacy::before { display: none; }
.wsbt-note svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 3px; color: var(--wsbt-accent); }

/* actions */
.wsbt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--wsbt-line); background: var(--wsbt-paper); border-radius: 0 0 22px 22px; }
.wsbt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 14px; border: 1.5px solid transparent; border-radius: 14px; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; text-decoration: none !important; transition: filter .15s, transform .1s; }
.wsbt-btn svg { width: 20px; height: 20px; }
.wsbt-btn:active { transform: translateY(1px); }
.wsbt-btn.is-primary { grid-column: 1 / -1; min-height: 52px; background: var(--wsbt-accent); color: #fff !important; }
.wsbt-btn.is-primary:hover, .wsbt-btn.is-secondary:hover { filter: brightness(1.08); }
.wsbt-btn.is-secondary { background: var(--wsbt-accent); color: #fff; }
.wsbt-btn.is-ghost { background: #fff; color: var(--wsbt-accent); border-color: var(--wsbt-accent); }
.wsbt-btn:focus-visible, .wsbt-swatch:focus-visible, .wsbt-before:focus-visible, .wsbt-x:focus-visible { outline: 3px solid var(--wsbt-accent); outline-offset: 2px; }
.wsbt-btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.4); }
.wsbt-actions > .wsbt-btn.is-ghost:only-of-type:last-child { grid-column: auto; }
.wsbt-actions .is-primary + .is-ghost:last-child { grid-column: 1 / -1; }

.wsbt-toast { position: fixed; z-index: 2147483001; inset-inline: 16px; bottom: 20px; max-width: 420px; margin: 0 auto; padding: 12px 16px; border-radius: 14px; background: #15231c; color: #fff; font-size: 14px; line-height: 1.7; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .25s; }
.wsbt-toast.is-in { opacity: 1; transform: none; }

.wsbt [hidden] { display: none !important; }
