/* Floating WhatsApp button and chat box. Colours and sizes come from Customize > WhatsApp chat. */
.rb-wa {
  position: fixed;
  bottom: calc(var(--rb-wa-bottom, 24px) + env(safe-area-inset-bottom, 0px));
  z-index: 190; /* Under the sticky header (200) and the open mobile menu (210+). */
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: calc(100vw - 2 * var(--rb-wa-side, 24px));
  font-family: var(--wp--preset--font-family--sans, sans-serif);
}

.rb-wa--bottom-right {
  right: var(--rb-wa-side, 24px);
  align-items: flex-end;
}

.rb-wa--bottom-left {
  left: var(--rb-wa-side, 24px);
  align-items: flex-start;
}

.rb-wa__button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--rb-wa-size, 56px);
  max-width: 100%;
  padding: 0 calc(var(--rb-wa-size, 56px) * 0.36);
  border-radius: 8px;
  background: var(--rb-wa-bg, #25d366);
  color: var(--rb-wa-fg, #fff);
  font-size: var(--rb-wa-font, 16px);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rb-wa__button:hover {
  color: var(--rb-wa-fg, #fff);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
}

.rb-wa__button:focus-visible,
.rb-wa__close:focus-visible,
.rb-wa__contact:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.rb-wa--rounded .rb-wa__button {
  border-radius: 999px;
}

.rb-wa__icon {
  flex: 0 0 auto;
  width: calc(var(--rb-wa-size, 56px) * 0.46);
  height: calc(var(--rb-wa-size, 56px) * 0.46);
}

.rb-wa--bubble .rb-wa__button {
  justify-content: center;
  width: var(--rb-wa-size, 56px);
  height: var(--rb-wa-size, 56px);
  padding: 0;
}

.rb-wa--bubble .rb-wa__icon {
  width: 56%;
  height: 56%;
}

/* Chat box */
.rb-wa__box {
  width: min(340px, calc(100vw - 2 * var(--rb-wa-side, 24px)));
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  color: #303030;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}

.rb-wa__box[hidden] {
  display: none;
}

.rb-wa__head {
  position: relative;
  padding: 18px 44px 18px 18px;
  background: var(--rb-wa-bg, #25d366);
  color: var(--rb-wa-fg, #fff);
}

.rb-wa__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.rb-wa__intro {
  margin: 4px 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.rb-wa__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.14);
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.rb-wa__list {
  max-height: min(320px, 50vh);
  overflow-y: auto;
}

.rb-wa__contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}

.rb-wa__contact + .rb-wa__contact {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.rb-wa__contact:hover {
  background: rgba(0, 0, 0, 0.04);
  color: inherit;
}

.rb-wa__contact.is-away .rb-wa__avatar {
  opacity: 0.5;
  filter: grayscale(1);
}

.rb-wa__avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--rb-wa-bg, #25d366);
  color: var(--rb-wa-fg, #fff);
}

.rb-wa__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rb-wa__avatar .rb-wa__icon {
  width: 56%;
  height: 56%;
}

.rb-wa__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.rb-wa__role,
.rb-wa__hours {
  font-size: 0.78rem;
  color: #666;
}

.rb-wa__hours[hidden] {
  display: none;
}

.rb-wa__name {
  font-size: 0.98rem;
  font-weight: 600;
}

.rb-wa__foot {
  margin: 0;
  padding: 10px 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.78rem;
  color: #666;
}

.rb-wa__foot a {
  color: inherit;
  text-decoration: underline;
}

/* Devices are decided here so a cached page is right on every screen. */
@media (max-width: 781px) {
  .rb-wa--show-desktop {
    display: none;
  }
}

@media (min-width: 782px) {
  .rb-wa--show-mobile {
    display: none;
  }
}

/* Attention animations */
.rb-wa--motion-pulse .rb-wa__button {
  animation: rb-wa-pulse 2.4s ease-out infinite;
}

.rb-wa--motion-bounce .rb-wa__button {
  animation: rb-wa-bounce 2.4s ease-in-out infinite;
}

@keyframes rb-wa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
  70%, 100% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
}

@keyframes rb-wa-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  .rb-wa__button,
  .rb-wa__contact {
    animation: none !important;
    transition: none;
  }
}

@media print {
  .rb-wa {
    display: none;
  }
}
