/* Right-edge theme tab; stays on the right in Arabic and English. */
.bm-theme-toggle {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 1030;
  display: grid;
  place-items: center;
  width: 50px;
  height: 54px;
  padding: 12px;
  color: #ff9b5d;
  background: #24231f;
  border: 1px solid #494237;
  border-right: 0;
  border-radius: 16px 0 0 16px;
  box-shadow: -4px 4px 20px rgb(0 0 0 / 18%);
  cursor: pointer;
  touch-action: manipulation;
}
.bm-theme-toggle:hover { background: #343027; }
.bm-theme-toggle:focus-visible { outline: 2px solid #ff7f32; outline-offset: 3px; }
.bm-theme-toggle svg { width: 24px; height: 24px; }
.bm-theme-toggle .bm-theme-moon { display: none; }
/* Reveal the new page snapshot in a circle originating at the mode tab. */
html.bm-theme-transition::view-transition-group(root) { animation: none; }
html.bm-theme-transition::view-transition-old(root),
html.bm-theme-transition::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
html.bm-theme-transition::view-transition-old(root) { z-index: 1; }
html.bm-theme-transition::view-transition-new(root) { z-index: 2; }
.bm-theme-veil {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
}
html[data-theme="light"] .bm-theme-toggle {
  background: #fff;
  color: #a8490e;
  border-color: #dedbd2;
  box-shadow: -4px 4px 20px rgb(42 36 24 / 10%);
}
html[data-theme="light"] .bm-theme-toggle:hover { background: #fff3e9; }
html[data-theme="light"] .bm-theme-toggle .bm-theme-sun { display: none; }
html[data-theme="light"] .bm-theme-toggle .bm-theme-moon { display: block; }
@media (max-width: 575px) {
  .bm-theme-toggle { width: 44px; height: 48px; padding: 10px; }
}

/* WhatsApp contact: inset on desktop, within thumb reach on small screens. */
.bm-whatsapp {
  position: fixed;
  right: clamp(24px, 10vw, 100px);
  bottom: clamp(28px, 14vh, 100px);
  z-index: 1025;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 2px solid rgb(255 255 255 / 90%);
  border-radius: 50%;
  background: #128c4a;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 22px rgb(0 0 0 / 22%);
  touch-action: manipulation;
  isolation: isolate;
}
.bm-whatsapp:hover { background: #0c743d; color: #fff; }
.bm-whatsapp:focus-visible { outline: 3px solid #ff7f32; outline-offset: 5px; }
.bm-whatsapp svg { width: 34px; height: 34px; fill: currentColor; animation: bm-whatsapp-nudge 6s ease-in-out infinite; }
.bm-whatsapp::before {
  content: "";
  position: absolute;
  inset: -2px;
  border: 2px solid #25d366;
  border-radius: inherit;
  pointer-events: none;
  animation: bm-whatsapp-ring 6s ease-out infinite;
}
html[dir="rtl"] .bm-whatsapp { right: auto; left: clamp(24px, 10vw, 100px); }
@keyframes bm-whatsapp-nudge {
  0%, 16%, 100% { transform: rotate(0); }
  3%, 9% { transform: rotate(-12deg); }
  6%, 12% { transform: rotate(12deg); }
}
@keyframes bm-whatsapp-ring {
  0% { transform: scale(1); opacity: .65; }
  22%, 100% { transform: scale(1.65); opacity: 0; }
}
@media (max-width: 575px) {
  .bm-whatsapp {
    width: 54px;
    height: 54px;
    right: 20px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  html[dir="rtl"] .bm-whatsapp { left: 20px; }
  .bm-whatsapp svg { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .bm-whatsapp svg, .bm-whatsapp::before { animation: none; }
  .bm-whatsapp::before { display: none; }
}
