.wasc-root,
.wasc-root *,
.wasc-block,
.wasc-block * { box-sizing: border-box; }

.wasc-root {
  position: fixed;
  bottom: var(--wasc-bottom, 24px);
  width: var(--wasc-size, 60px);
  height: var(--wasc-size, 60px);
  z-index: var(--wasc-z, 99990);
  font-family: inherit;
  line-height: 1.5;
}
.wasc-right { right: var(--wasc-side, 24px); }
.wasc-left  { left:  var(--wasc-side, 24px); }

/* ---------- الزر ---------- */
.wasc-btn {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--wasc-color, #25D366);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease;
}
.wasc-btn:hover,
.wasc-btn:focus-visible { transform: scale(1.07); }
.wasc-btn svg { width: 58%; height: 58%; display: block; }
.wasc-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--wasc-color, #25D366);
  opacity: .45;
  z-index: -1;
  animation: wasc-ring 2.6s ease-out infinite;
}
.wasc-btn.wasc-custom {
  background: transparent;
  box-shadow: none;
}
.wasc-btn.wasc-custom::before { display: none; }
.wasc-btn.wasc-custom img { width: 100%; height: 100%; object-fit: contain; display: block; }

@keyframes wasc-ring {
  0%   { transform: scale(1);   opacity: .45; }
  80%, 100% { transform: scale(1.7); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wasc-btn::before { animation: none; display: none; }
  .wasc-btn, .wasc-pop { transition: none; }
}

/* ---------- إخفاء حسب الجهاز ---------- */
@media (max-width: 782px) { .wasc-hm { display: none !important; } }
@media (min-width: 783px) { .wasc-hd { display: none !important; } }

/* ---------- الفقاعة (تنزلق من خلف الأيقونة) ---------- */
.wasc-btn { z-index: 2; }
.wasc-pop {
  position: absolute;
  z-index: 1;
  top: 50%;
  display: block;
  width: max-content;
  max-width: calc(100vw - var(--wasc-side, 24px) * 2 - var(--wasc-size, 60px) - 14px);
  padding: 10px 18px;
  background: #fff;
  color: #1f2933;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .18);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .25s ease, visibility .35s;
}
.wasc-right .wasc-pop { right: calc(100% + 10px); transform: translate(calc(var(--wasc-size, 60px) * .7), -50%) scale(.6); transform-origin: right center; }
.wasc-left  .wasc-pop { left:  calc(100% + 10px); transform: translate(calc(var(--wasc-size, 60px) * -.7), -50%) scale(.6); transform-origin: left center; }
.wasc-pop.on { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(0, -50%) scale(1); }
.wasc-pop:hover { box-shadow: 0 8px 26px rgba(0, 0, 0, .24); }

/* ذيل الفقاعة المتجه نحو الأيقونة */
.wasc-pop::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 2px;
}
.wasc-right .wasc-pop::after { right: -4px; transform: translateY(-50%) rotate(45deg); }
.wasc-left  .wasc-pop::after { left:  -4px; transform: translateY(-50%) rotate(45deg); }

.wasc-pop-text { position: relative; z-index: 1; white-space: normal; }

/* زر إغلاق صغير وهادئ على طرف الفقاعة */
.wasc-pop .wasc-x {
  position: absolute;
  top: -8px;
  inset-inline-start: -8px;
  width: 20px;
  height: 20px;
  font-size: 14px;
  background: #fff;
  color: #52606d;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  opacity: .9;
  z-index: 2;
}
.wasc-right .wasc-pop .wasc-x { left: -8px; right: auto; }
.wasc-left  .wasc-pop .wasc-x { right: -8px; left: auto; }

@media (max-width: 480px) {
  .wasc-pop { padding: 7px 13px; font-size: 13px; }
  .wasc-pop::after { width: 10px; height: 10px; }
}

.wasc-x {
  position: absolute;
  top: 6px;
  inset-inline-end: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #7b8794;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}
.wasc-x:hover { background: #eef1f4; color: #1f2933; }

/* ---------- نافذة السؤال ---------- */
.wasc-ov {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 32, .55);
  animation: wasc-fade .2s ease;
}
@keyframes wasc-fade { from { opacity: 0; } to { opacity: 1; } }

.wasc-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 26px 22px 20px;
  background: #fff;
  color: #1f2933;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
  text-align: start;
}
.wasc-box .wasc-x { top: 10px; }
.wasc-q {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-inline-end: 26px;
}
.wasc-msg {
  font-size: 16px;
  line-height: 1.9;
  white-space: pre-line;
  margin: 6px 0 14px;
}

.wasc-a {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 13px 14px;
  border: 1.5px solid #d8dee4;
  border-radius: 12px;
  background: #f8fafb;
  color: #1f2933;
  font: inherit;
  font-size: 15px;
  text-align: start;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.wasc-a:hover,
.wasc-a:focus-visible {
  border-color: var(--wasc-color, #25D366);
  background: #fff;
  outline: none;
}
.wasc-a.wasc-center { text-align: center; font-weight: 700; }

/* ---------- شاشة الحظر ---------- */
html.wasc-locked { overflow: hidden !important; }
html.wasc-locked body > *:not(.wasc-block) { display: none !important; }

.wasc-block {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #f5f6f8;
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}
.wasc-block-in {
  width: 100%;
  max-width: 460px;
  padding: 34px 26px;
  background: #fff;
  color: #1f2933;
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .08);
  text-align: center;
}
.wasc-block-in h2 { margin: 0 0 12px; font-size: 22px; color: inherit; }
.wasc-block-in p { margin: 0; font-size: 16px; line-height: 1.9; color: #52606d; white-space: pre-line; }
.wasc-block-note { display: block; margin-top: 14px; color: #b45309; }
.wasc-block-in .wasc-a { margin-top: 18px; }
