/* =========================
   USF WebBot Widget - V3.3
   Isolated launcher + iframe shell
   ========================= */

:root {
  --usf-wb-z: 999999;
  --usf-wb-radius: 18px;
  --usf-wb-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
  --usf-wb-border: rgba(255, 255, 255, 0.14);

  --usf-wb-bg: #ffffff;
  --usf-wb-header-bg: linear-gradient(135deg, #0a2d66, #0f4fa8);
  --usf-wb-header-text: #ffffff;
  --usf-wb-launcher-bg: linear-gradient(135deg, #0a2d66, #0f4fa8);
  --usf-wb-launcher-text: #ffffff;
  --usf-wb-muted: rgba(255, 255, 255, 0.82);
  --usf-wb-backdrop: rgba(0, 0, 0, 0.42);

  --usf-wb-desktop-width: 390px;
  --usf-wb-desktop-height: min(700px, calc(100dvh - 32px));
  --usf-wb-mobile-header-h: 64px;
  --usf-wb-bottom-offset: 18px;
  --usf-wb-right-offset: 18px;
}

/* Root */
.usf-wb {
  position: fixed;
  right: var(--usf-wb-right-offset);
  bottom: var(--usf-wb-bottom-offset);
  z-index: var(--usf-wb-z);
  font-family: Arial, Helvetica, sans-serif;
}

.usf-wb * {
  box-sizing: border-box;
}

/* Launcher */
.usf-wb-launcher {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--usf-wb-launcher-bg);
  color: var(--usf-wb-launcher-text);
  box-shadow: var(--usf-wb-shadow);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.usf-wb-launcher:hover {
  transform: translateY(-1px);
}

.usf-wb-launcher:active {
  transform: translateY(0);
}

.usf-wb-launcher:focus-visible,
.usf-wb-close:focus-visible,
.usf-wb-open-full:focus-visible {
  outline: 3px solid rgba(15, 79, 168, 0.28);
  outline-offset: 2px;
}

.usf-wb-launcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  line-height: 1;
}

.usf-wb-launcher-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.usf-wb-launcher-text {
  line-height: 1;
}

/* Backdrop */
.usf-wb-backdrop {
  position: fixed;
  inset: 0;
  background: var(--usf-wb-backdrop);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.usf-wb-backdrop.is-visible {
  opacity: 1;
}

/* Panel */
.usf-wb-panel {
  position: fixed;
  right: var(--usf-wb-right-offset);
  bottom: calc(var(--usf-wb-bottom-offset) + 68px);
  width: var(--usf-wb-desktop-width);
  height: var(--usf-wb-desktop-height);
  background: var(--usf-wb-bg);
  border-radius: var(--usf-wb-radius);
  overflow: hidden;
  box-shadow: var(--usf-wb-shadow);
  border: 1px solid var(--usf-wb-border);
  transform: translateY(14px) scale(0.985);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.usf-wb-panel.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.usf-wb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  background: var(--usf-wb-header-bg);
  color: var(--usf-wb-header-text);
}

.usf-wb-header-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.usf-wb-header-text strong {
  font-size: 15px;
  line-height: 1.2;
}

.usf-wb-header-text span {
  font-size: 12px;
  line-height: 1.25;
  color: var(--usf-wb-muted);
}

.usf-wb-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.usf-wb-open-full {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.usf-wb-open-full:hover {
  background: rgba(255, 255, 255, 0.14);
}

.usf-wb-close {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 26px;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.usf-wb-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.usf-wb-frame-wrap {
  width: 100%;
  height: calc(100% - 64px);
  background: #fff;
}

.usf-wb-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

/* Lock body when open */
body.usf-wb-lock {
  overflow: hidden;
  touch-action: none;
}

/* Prevent older fixed elements from sitting above the overlay */
body.usf-wb-lock .whatsapp-float {
  opacity: 0;
  pointer-events: none;
}

/* Mobile */
@media (max-width: 767px) {
  :root {
    --usf-wb-bottom-offset: 14px;
    --usf-wb-right-offset: 14px;
  }

  .usf-wb-launcher {
    min-height: 54px;
    padding: 0 16px;
    font-size: 14px;
  }

  .usf-wb-backdrop {
    background: rgba(0, 0, 0, 0.5);
  }

  .usf-wb-panel {
    inset: 0;
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    right: auto;
    bottom: auto;
    border-radius: 0;
    border: 0;
    transform: translateY(100%);
  }

  .usf-wb-panel.is-open {
    transform: translateY(0);
  }

  .usf-wb-header {
    min-height: var(--usf-wb-mobile-header-h);
    padding: 12px 14px;
  }

  .usf-wb-frame-wrap {
    height: calc(100dvh - var(--usf-wb-mobile-header-h));
  }
}

/* Tiny screens */
@media (max-width: 420px) {
  .usf-wb-launcher-text {
    display: none;
  }

  .usf-wb-launcher {
    width: 56px;
    min-width: 56px;
    padding: 0;
    justify-content: center;
  }

  .usf-wb-open-full {
    display: none;
  }
}