/* Farben und Schriften aus dem Theme rollrasenshop. */
.rr-chat {
  --rr-dark: #1e3223;
  --rr-green: #679800;
  --rr-green-dark: #557d00;
  --rr-orange: #e85e13;
  --rr-light: #f4f8ec;
  --rr-line: #dfe8cf;
  --rr-text: #333;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1040;
  font-family: Raleway, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  color: var(--rr-text);
}

/* Der Block sitzt im Footer, dessen Linkfarbe mit !important weiß ist. */
.rr-chat .rr-chat__msg a {
  color: var(--rr-green-dark) !important;
}
.rr-chat .rr-chat__msg a.rr-chat__product {
  color: var(--rr-text) !important;
}
.rr-chat .rr-chat__head a {
  color: #fff !important;
}
.rr-chat .rr-chat__note a {
  color: #777 !important;
}

/* Der Klaro-Knopf (Cookie-Einstellungen) sitzt sonst unter dem Chat. */
.klaro_toggle_dialog.klaro_toggle_dialog_override,
.klaro_toggle_dialog {
  right: auto;
  left: 25px;
}

/* Startknopf */
.rr-chat__launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 8px 20px 8px 8px;
  background: var(--rr-dark);
  color: #fff;
  font: 700 15px/1.2 Raleway, sans-serif;
  box-shadow: 0 8px 24px rgba(30, 50, 35, .35);
  cursor: pointer;
  transition: transform .15s ease;
}
.rr-chat__launcher:hover,
.rr-chat__launcher:focus-visible {
  transform: translateY(-2px);
}
.rr-chat__launcher:focus-visible,
.rr-chat button:focus-visible,
.rr-chat textarea:focus-visible {
  outline: 3px solid var(--rr-orange);
  outline-offset: 2px;
}
.rr-chat__avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--rr-green);
}
.rr-chat__avatar svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}
.rr-chat__online {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--rr-dark);
  border-radius: 50%;
  background: #8fd400;
}
.rr-chat__launcher-text small {
  display: block;
  font-weight: 500;
  font-size: 12px;
  opacity: .85;
}
.rr-chat.is-open .rr-chat__launcher,
.rr-chat.is-open .rr-chat__teaser {
  display: none;
}

/* Sprechblase mit Einladung */
.rr-chat__teaser {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: 260px;
  padding: 12px 34px 12px 14px;
  border-radius: 14px 14px 4px 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  line-height: 1.4;
  cursor: pointer;
  animation: rr-chat-in .35s ease-out;
}
.rr-chat__teaser[hidden] {
  display: none;
}
.rr-chat__teaser strong {
  color: var(--rr-dark);
}
.rr-chat__teaser-close {
  position: absolute;
  top: 4px;
  right: 6px;
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: #777;
  cursor: pointer;
}

/* Fenster */
.rr-chat__panel {
  display: flex;
  flex-direction: column;
  width: 390px;
  height: min(620px, calc(100vh - 40px));
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .3);
  overflow: hidden;
  animation: rr-chat-in .25s ease-out;
}
.rr-chat__panel[hidden] {
  display: none;
}
.rr-chat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--rr-dark);
  color: #fff;
}
.rr-chat__title {
  flex: 1;
  min-width: 0;
}
.rr-chat__title strong {
  display: block;
  font: 700 26px/1 "Amatic SC", cursive;
  letter-spacing: .5px;
}
.rr-chat__title small {
  font-size: 12px;
  opacity: .85;
}
.rr-chat__title a {
  color: #fff;
}
.rr-chat__close {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.rr-chat__log {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: var(--rr-light);
  overscroll-behavior: contain;
}
.rr-chat__msg {
  max-width: 88%;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  animation: rr-chat-in .2s ease-out;
}
.rr-chat__msg p,
.rr-chat__msg ul {
  margin: 0 0 6px;
}
.rr-chat__msg p:last-child,
.rr-chat__msg ul:last-child {
  margin-bottom: 0;
}
.rr-chat__msg ul {
  padding-left: 18px;
}
.rr-chat__msg a {
  color: var(--rr-green-dark);
  font-weight: 600;
}
.rr-chat__msg--bot {
  border: 1px solid var(--rr-line);
  border-bottom-left-radius: 4px;
  background: #fff;
}
.rr-chat__msg--user {
  margin-left: auto;
  border-bottom-right-radius: 4px;
  background: var(--rr-green);
  color: #fff;
}
.rr-chat__typing {
  display: inline-flex;
  gap: 4px;
}
.rr-chat__typing i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rr-green);
  animation: rr-chat-dot 1s infinite ease-in-out;
}
.rr-chat__typing i:nth-child(2) {
  animation-delay: .15s;
}
.rr-chat__typing i:nth-child(3) {
  animation-delay: .3s;
}
.rr-chat__sources {
  margin-top: 8px !important;
  padding-top: 8px;
  border-top: 1px solid var(--rr-line);
  font-size: 13px;
}
.rr-chat__rate {
  font-size: 13px;
  color: #666;
}
.rr-chat__rate button {
  border: 1px solid var(--rr-line);
  border-radius: 999px;
  background: #fff;
  padding: 0 8px;
  margin-left: 4px;
  cursor: pointer;
}

/* Produktkarten unter der Antwort */
.rr-chat__products {
  display: flex;
  gap: 8px;
  margin: 10px -4px 4px;
  padding: 0 4px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.rr-chat__msg .rr-chat__product {
  display: flex;
  flex-direction: column;
  flex: 0 0 132px;
  padding: 6px;
  border: 1px solid var(--rr-line);
  border-radius: 12px;
  background: #fff;
  color: var(--rr-text);
  font-weight: 400;
  text-decoration: none;
  scroll-snap-align: start;
}
.rr-chat__product img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--rr-light);
}
.rr-chat__product-title {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rr-chat__product-price {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--rr-green-dark);
}
.rr-chat__product-cta {
  margin-top: auto;
  padding-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--rr-orange);
}
.rr-chat__msg .rr-chat__product:hover {
  border-color: var(--rr-green);
}

/* Fragevorschläge */
.rr-chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.rr-chat__chips button {
  border: 1.5px solid var(--rr-green);
  border-radius: 999px;
  padding: 6px 12px;
  background: #fff;
  color: var(--rr-dark);
  font: 600 13px/1.3 Raleway, sans-serif;
  cursor: pointer;
}
.rr-chat__chips button:hover {
  background: var(--rr-green);
  color: #fff;
}

/* Eingabe */
.rr-chat__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--rr-line);
  background: #fff;
}
.rr-chat__form textarea {
  flex: 1;
  max-height: 120px;
  resize: none;
  border: 1.5px solid var(--rr-line);
  border-radius: 12px;
  padding: 9px 12px;
  font: 15px/1.4 Raleway, sans-serif;
}
.rr-chat__send {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--rr-orange);
  cursor: pointer;
}
.rr-chat__send svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}
.rr-chat__send:disabled {
  opacity: .5;
}
.rr-chat__note {
  margin: 0;
  padding: 0 12px 10px;
  background: #fff;
  font-size: 11px;
  color: #777;
}
.rr-chat__note a {
  color: #777;
}

@keyframes rr-chat-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes rr-chat-dot {
  0%, 80%, 100% {
    opacity: .3;
    transform: scale(.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .rr-chat * {
    animation: none !important;
    transition: none !important;
  }
}

/* Handy: runder Knopf über der Kaufen-Leiste, Fenster als Vollbild. */
@media (max-width: 575px) {
  .rr-chat {
    right: 14px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
  .rr-chat__launcher {
    padding: 6px;
  }
  .rr-chat__launcher-text {
    display: none;
  }
  .rr-chat__teaser {
    width: min(250px, calc(100vw - 40px));
  }
  .rr-chat.is-open {
    inset: 0;
  }
  .rr-chat__panel {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
  .rr-chat__form {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .rr-chat__form textarea {
    font-size: 16px;
  }
}
