:root {
  --ws-contact-edge: 24px;
  --ws-contact-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  --ws-contact-size: 60px;
}

.ws-whatsapp, .ws-whatsapp * { box-sizing: border-box; }
.ws-whatsapp {
  position: fixed;
  right: var(--ws-contact-edge);
  bottom: var(--ws-contact-bottom);
  z-index: 950;
  color: #112051;
  font-family: 'Public Sans', Arial, sans-serif;
}
.ws-whatsapp__trigger {
  display: grid;
  place-items: center;
  width: var(--ws-contact-size);
  height: var(--ws-contact-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 6px 22px #075e5433;
  cursor: pointer;
  list-style: none;
  transition: background 160ms ease, box-shadow 160ms ease;
}
.ws-whatsapp__trigger::-webkit-details-marker { display: none; }
.ws-whatsapp__trigger::marker { content: ''; }
.ws-whatsapp__trigger img { display: block; width: 34px; height: 38px; filter: brightness(0) invert(1); }
.ws-whatsapp__trigger:hover { background: #20c460; box-shadow: 0 8px 25px #075e5440; }
.ws-whatsapp__trigger:focus-visible, .ws-whatsapp__close:focus-visible, .ws-whatsapp__option:focus-visible { outline: 3px solid #0079c8; outline-offset: 4px; }
.ws-whatsapp__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: min(330px, calc(100vw - 32px));
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  padding: 22px;
  border: 1px solid #dce9e3;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 44px #11205126;
}
.ws-whatsapp:not([open]) .ws-whatsapp__panel { display: none; }
.ws-whatsapp[open] .ws-whatsapp__panel { animation: ws-whatsapp-in 160ms ease-out; }
.ws-whatsapp__heading { display: flex; align-items: center; gap: 12px; }
.ws-whatsapp__heading h2 { margin: 0; color: #112051; font-family: inherit; font-size: 17px; font-weight: 700; line-height: 1.4; letter-spacing: -.02em; }
.ws-whatsapp__close { display: grid; flex: none; place-items: center; width: 30px; height: 30px; margin: -4px -5px -4px auto; padding: 0; border: 0; border-radius: 50%; background: #f0f5f3; color: #52637a; font: 24px/1 Arial, sans-serif; cursor: pointer; }
.ws-whatsapp__close svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ws-whatsapp__panel > p { margin: 7px 0 18px; color: #64748b; font-size: 14px; line-height: 1.5; }
.ws-whatsapp__options { display: grid; gap: 10px; }
.ws-whatsapp__option { display: flex; align-items: center; gap: 12px; padding: 14px 12px; border: 1px solid #dce9e3; border-radius: 14px; background: #f7fcf9; color: #112051; text-decoration: none; transition: border-color 160ms ease, background 160ms ease; }
.ws-whatsapp__option:hover { border-color: #25d366; background: #edf9f1; color: #112051; }
.ws-whatsapp__option-icon { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #e2f7e9; color: #087c44; font-size: 17px; }
.ws-whatsapp__option strong { display: block; font-size: 15px; font-weight: 700; line-height: 1.4; }
.ws-whatsapp__option small { display: block; margin-top: 3px; color: #64748b; font-size: 12px; line-height: 1.4; }
.ws-whatsapp__arrow { margin-left: auto; color: #087c44; font-size: 19px; }

/* Both controls share a baseline; the panel opens above their row. */
.ws-page .ws-scroll-top {
  right: calc(var(--ws-contact-edge) + var(--ws-contact-size) + 12px);
  bottom: calc(var(--ws-contact-bottom) + (var(--ws-contact-size) - 48px) / 2);
}

@keyframes ws-whatsapp-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 640px) {
  :root { --ws-contact-edge: 16px; --ws-contact-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); --ws-contact-size: 56px; }
  .ws-whatsapp__trigger img { width: 32px; height: 36px; }
  .ws-whatsapp__panel { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .ws-whatsapp[open] .ws-whatsapp__panel { animation: none; }
  .ws-whatsapp__trigger, .ws-whatsapp__option { transition: none; }
}
