/* ==========================================================================
   Floating WhatsApp Chat Button
   Sitewide widget (incl. checkout) so a customer can reach support to finish
   an order or ask a question without leaving the page. Bubble stays WhatsApp
   brand green for instant recognition; the popup card uses the site's own
   design tokens so it still reads as "Royal-One".
   ========================================================================== */

.us-wa-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99970; /* above the mobile sticky ATC bar (9990), below the cart drawer/overlay (99998/99999) */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: var(--font-body, sans-serif);
  /* The box is as big as the (hidden) greeting card, so without this it
     swallows taps on whatever sits underneath it — on phones that was the
     right half of Add to Cart / Buy Now / the PayPal and card buttons.
     Only the bubble and the open card take clicks. */
  pointer-events: none;
}
.us-wa-bubble {
  pointer-events: auto;
}

/* --- Bubble --- */
.us-wa-bubble {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(18, 140, 82, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}
.us-wa-bubble:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 22px rgba(18, 140, 82, 0.45);
}
.us-wa-bubble .us-wa-icon {
  width: 30px;
  height: 30px;
}
.us-wa-bubble .us-wa-icon-close {
  display: none;
  width: 22px;
  height: 22px;
}
.us-wa-widget.is-open .us-wa-bubble .us-wa-icon-chat {
  display: none;
}
.us-wa-widget.is-open .us-wa-bubble .us-wa-icon-close {
  display: block;
}

/* Quiet attention pulse until the widget is opened once this session. */
.us-wa-bubble.us-wa-pulse::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25D366;
  animation: us-wa-pulse 2.2s ease-out infinite;
  z-index: -1;
}
@keyframes us-wa-pulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  100% { transform: scale(1.9); opacity: 0; }
}
.us-wa-bubble { position: relative; }

/* --- Greeting card --- */
.us-wa-card {
  width: min(300px, calc(100vw - 40px));
  background: var(--surface, #fff);
  border: 1px solid var(--line, #E8E1D5);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-lg, 0 10px 25px rgba(24, 21, 18, 0.10));
  padding: 18px;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}
.us-wa-widget.is-open .us-wa-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}

.us-wa-card-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--muted, #6E665D);
  cursor: pointer;
  padding: 4px;
}
.us-wa-card-close:hover {
  color: var(--text, #181512);
}

.us-wa-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-right: 18px;
}
.us-wa-card-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--text, #181512);
}
.us-wa-card-status {
  font-size: 12px;
  color: var(--save, #15803D);
  font-weight: 600;
}

.us-wa-card-msg {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted, #6E665D);
  margin: 0 0 16px;
}

.us-wa-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: #25D366;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border-radius: var(--radius-md, 10px);
  padding: 12px 16px;
  box-sizing: border-box;
  transition: background 0.15s ease;
}
.us-wa-card-btn:hover {
  background: #1EBE5A;
  color: #fff;
}
.us-wa-card-btn .us-wa-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Stay clear of the mobile sticky Add-to-Cart bar on product pages. */
@media (max-width: 600px) {
  .us-wa-widget {
    right: 14px;
    bottom: 14px;
  }
  .single-product .us-wa-widget {
    bottom: 86px;
  }
}
