/* Chattknappen nere till höger (Crisp, 2026-10-08) och språkväxlaren bredvid
   (2026-10-09). Plommon, inte glöd: sidans egen primärknapp är vyns enda glöd. */
.chat-launcher {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 3px solid #FFF8EF;
  border-radius: 50%;
  background: #3B1F3A;
  color: #FFF8EF;
  box-shadow: 0 10px 28px rgba(59, 31, 58, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease, bottom 0.25s ease;
}
.chat-launcher:hover { transform: translateY(-2px); }
.chat-launcher:focus-visible { outline: 3px solid #B4492C; outline-offset: 3px; }
.chat-launcher[hidden] { display: none; }
.chat-launcher svg { width: 28px; height: 28px; }
.chat-launcher[aria-busy="true"] svg { opacity: 0.5; }
.chat-launcher-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  border: 2px solid #FFF8EF;
  border-radius: 50%;
  background: #B4492C;
}
.chat-launcher-dot[hidden] { display: none; }

/* Språkväxlaren: en rund flagga till vänster om chattknappen. */
.lang-switch {
  position: fixed;
  right: 90px;
  bottom: calc(27px + env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 3px solid #FFF8EF;
  border-radius: 50%;
  background: #FFF8EF;
  box-shadow: 0 8px 22px rgba(59, 31, 58, 0.28);
  transition: transform 0.15s ease, bottom 0.25s ease;
}
.lang-switch:hover { transform: translateY(-2px); }
.lang-switch:focus-visible { outline: 3px solid #B4492C; outline-offset: 3px; }
.lang-switch svg { width: 100%; height: 100%; border-radius: 50%; }

.chat-note {
  position: fixed;
  right: 20px;
  bottom: calc(90px + env(safe-area-inset-bottom));
  z-index: 60;
  max-width: min(330px, calc(100vw - 40px));
  margin: 0;
  padding: 0.8rem 1rem;
  border: 1px solid #E6D6C3;
  border-radius: 14px;
  background: #FFFDF9;
  color: #3B1F3A;
  font: 500 0.95rem/1.45 "DM Sans", system-ui, sans-serif;
  box-shadow: 0 12px 32px rgba(59, 31, 58, 0.18);
}
.chat-note[hidden] { display: none; }

/* Startsidans fasta väntelisteknapp på mobilen ligger längst ned: knappen
   lyfts ovanför den. Kakbannern på mobilen täcker hela bredden: då väntar
   chattknappen tills besökaren har svarat. */
body:has(.sticky-cta.show) .chat-launcher { bottom: calc(86px + env(safe-area-inset-bottom)); }
body:has(.sticky-cta.show) .lang-switch { bottom: calc(91px + env(safe-area-inset-bottom)); }
body:has(.sticky-cta.show) .chat-note { bottom: calc(156px + env(safe-area-inset-bottom)); }

@media (max-width: 760px) {
  .chat-launcher { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 54px; height: 54px; }
  .chat-note { right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); max-width: calc(100vw - 28px); }
  .lang-switch { right: 78px; bottom: calc(19px + env(safe-area-inset-bottom)); width: 44px; height: 44px; }
  body:has(.sticky-cta.show) .lang-switch { bottom: calc(91px + env(safe-area-inset-bottom)); }
  body:has(#consent-banner) .chat-launcher,
  body:has(#consent-banner) .lang-switch { display: none; }
}

@media (prefers-color-scheme: dark) {
  .chat-launcher { border-color: #3B1F3A; background: #F5EAE0; color: #3B1F3A; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); }
  .chat-launcher:focus-visible,
  .lang-switch:focus-visible { outline-color: #EE8A66; }
  .lang-switch { border-color: #F5EAE0; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45); }
  .chat-launcher-dot { border-color: #F5EAE0; background: #EE8A66; }
  .chat-note { border-color: #3A2C31; background: #261B20; color: #F5EAE0; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4); }
}

@media (prefers-reduced-motion: reduce) {
  .chat-launcher, .lang-switch { transition: none; }
  .chat-launcher:hover, .lang-switch:hover { transform: none; }
}
