/* ============================================================
   Side tools compatibility styles for Gemeinde Lotte.

   TYPO3 includes this file through the mandant Site Set. The
   prototype may render .styleswitcher markup during parity checks;
   production min_core accessibility markup uses its own classes.
   ============================================================ */

html.font-size-large,
html.font-size-xlarge {
  zoom: 1;
}

.styleswitcher {
  position: fixed;
  bottom: max(var(--min-space-lg, 2rem), env(safe-area-inset-bottom));
  left: max(var(--min-space-lg, 2rem), env(safe-area-inset-left));
  z-index: 1300;
  font-family: var(--mandant-font-body, var(--min-font-sans, system-ui, sans-serif));
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}

.styleswitcher__trigger {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 2px solid var(--lotte-green, #84bd00);
  border-radius: 50%;
  background: #fff;
  color: var(--lotte-primary, #145675);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .24), 0 0 0 4px rgba(255, 255, 255, .88);
  transition: background-color .25s ease, color .25s ease, transform .2s ease, box-shadow .25s ease;
}

.styleswitcher__trigger:hover {
  background: var(--lotte-primary, #145675);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28), 0 0 0 4px rgba(132, 189, 0, .28);
}

.styleswitcher__trigger:focus-visible {
  outline: 3px solid var(--lotte-green, #84bd00);
  outline-offset: 2px;
}

.styleswitcher__trigger-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform .3s ease;
}

.styleswitcher__trigger[aria-expanded="true"] {
  border-color: var(--lotte-green, #84bd00);
  background: var(--lotte-green, #84bd00);
  color: #1a1a1a;
}

.styleswitcher__trigger[aria-expanded="true"] .styleswitcher__trigger-icon {
  transform: rotate(90deg);
}

.styleswitcher__panel {
  position: absolute;
  bottom: calc(100% + .5rem);
  left: 0;
  display: flex;
  flex-direction: column;
  width: min(320px, calc(100vw - 3rem));
  max-height: calc(100dvh - 6rem);
  padding: var(--min-space-md, 1rem);
  overflow-y: auto;
  border-radius: var(--mandant-radius-md, 8px);
  border: 1px solid rgba(20, 86, 117, .18);
  background: #fff;
  color: var(--lotte-text, #1f2933);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem);
  visibility: hidden;
  transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
}

.styleswitcher__trigger[aria-expanded="true"] + .styleswitcher__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.styleswitcher__group {
  padding-block: .75rem;
  border-bottom: 1px solid rgba(20, 86, 117, .16);
}

.styleswitcher__group:first-child { padding-block-start: 0; }
.styleswitcher__group:last-child {
  padding-block-end: 0;
  border-bottom: 0;
}

.styleswitcher__group-label {
  display: block;
  margin-block-end: .5rem;
  color: var(--lotte-primary, #145675);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.styleswitcher__pills,
.styleswitcher__font-control,
.styleswitcher__dots,
.styleswitcher__speed-control {
  display: flex;
  align-items: center;
}

.styleswitcher__pills { gap: 4px; }
.styleswitcher__font-control { gap: 6px; }
.styleswitcher__dots { gap: 3px; }
.styleswitcher__speed-control { gap: 6px; }

.styleswitcher__pill,
.styleswitcher__toggle,
.styleswitcher__select {
  border: 1px solid rgba(20, 86, 117, .24);
  background: #f7faf8;
  color: var(--lotte-text, #1f2933);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
}

.styleswitcher__pill {
  flex: 1;
  padding: 6px 8px;
  border-radius: 9999px;
  font-weight: 500;
  text-align: center;
}

.styleswitcher__toggle {
  min-width: 2.5rem;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
}

.styleswitcher__select {
  max-width: 150px;
  padding: 4px 8px;
  border-radius: 4px;
}

.styleswitcher__select option {
  background: #fff;
  color: var(--lotte-text, #1f2933);
}

.styleswitcher__pill:hover,
.styleswitcher__toggle:hover {
  border-color: var(--lotte-green, #84bd00);
  background: rgba(132, 189, 0, .12);
}

.styleswitcher__pill:focus-visible,
.styleswitcher__toggle:focus-visible,
.styleswitcher__select:focus-visible {
  outline: 2px solid var(--lotte-green, #84bd00);
  outline-offset: 2px;
}

.styleswitcher__pill--active,
.styleswitcher__toggle--active {
  border-color: var(--lotte-green, #84bd00);
  background: var(--lotte-green, #84bd00);
  color: #1a1a1a;
}

.styleswitcher__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding-block: 4px;
}

.styleswitcher__row-label {
  color: var(--lotte-text, #1f2933);
  font-size: .9375rem;
  font-weight: 400;
}

.styleswitcher__range {
  width: 80px;
  height: 4px;
  border-radius: 2px;
  appearance: none;
  background: rgba(20, 86, 117, .18);
  cursor: pointer;
  outline: none;
}

.styleswitcher__range::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  appearance: none;
  background: var(--lotte-green, #84bd00);
  cursor: pointer;
}

.styleswitcher__range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--lotte-green, #84bd00);
  cursor: pointer;
}

.styleswitcher__range:focus-visible {
  outline: 2px solid var(--lotte-green, #84bd00);
  outline-offset: 4px;
}

.styleswitcher__speed-label {
  min-width: 2rem;
  color: var(--lotte-primary, #145675);
  font-size: .8125rem;
  font-weight: 600;
  text-align: right;
}

.styleswitcher__progress-track {
  width: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(20, 86, 117, .14);
}

.styleswitcher__progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 2px;
  background: var(--lotte-green, #84bd00);
  transition: width .1s linear;
}

.styleswitcher__progress-fill--active {
  width: 100%;
}

body.is-offcanvas-open {
  overflow: hidden;
}

.text-switcher {
  position: fixed;
  top: 50%;
  right: 52px;
  z-index: 9997;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--color-border, var(--min-color-border, #ccc));
  border-radius: 8px 0 0 8px;
  background: var(--color-white, var(--min-color-bg, #fff));
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  transform: translateY(-50%);
}

.text-switcher__button {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: var(--color-white, var(--min-color-bg, #fff));
  color: var(--color-text, var(--min-color-text, #1a1a1a));
  cursor: pointer;
}

.text-switcher__button--easy {
  font-size: .75rem;
  font-weight: 700;
}

.text-switcher__button.is-active {
  background: var(--color-primary, var(--min-color-primary, #145675));
  color: var(--color-white, #fff);
}

.lotte-a11y-toolbar__text-symbol {
  font-weight: 700;
}

.lotte-a11y-toolbar__text-symbol--large {
  font-size: .8125rem;
}

.lotte-a11y-toolbar__text-symbol--small {
  font-size: .6875rem;
}

.styleswitcher__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(20, 86, 117, .24);
  transition: background .2s ease, transform .2s ease;
}

.styleswitcher__dot.active {
  background: var(--lotte-green, #84bd00);
  transform: scale(1.25);
}

@media (max-width: 479px) {
  .styleswitcher {
    bottom: max(var(--min-space-md, 1rem), env(safe-area-inset-bottom));
    left: max(var(--min-space-md, 1rem), env(safe-area-inset-left));
  }

  .styleswitcher__panel {
    width: min(300px, calc(100vw - 2rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  .styleswitcher__trigger,
  .styleswitcher__trigger-icon,
  .styleswitcher__panel,
  .styleswitcher__pill,
  .styleswitcher__toggle,
  .styleswitcher__dot,
  .styleswitcher__progress-fill {
    transition: none;
  }

  .styleswitcher__trigger:hover {
    transform: none;
  }
}

@media print {
  .styleswitcher { display: none !important; }
}

/* Lotte nutzt den Prototyp-.styleswitcher als Mandant-SSoT. Falls der
   generische min_core-Switcher versehentlich mitkommt, bleibt er unsichtbar. */
.min-style-switcher {
  display: none !important;
}

/* Floating helper controls. The real chatbot widget owns the bottom-right slot. */
.lotte-search-helper {
  position: fixed;
  left: max(var(--min-space-lg, 2rem), env(safe-area-inset-left));
  bottom: calc(max(var(--min-space-lg, 2rem), env(safe-area-inset-bottom)) + 3.75rem);
  z-index: 1010;
  font-family: var(--mandant-font-body, var(--min-font-sans, system-ui, sans-serif));
}

.lotte-search-helper__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 3.5rem;
  min-height: 3rem;
  gap: .55rem;
  padding: 0 1rem;
  border: 0;
  border-radius: var(--mandant-radius-md, 6px);
  background: var(--lotte-primary, var(--mandant-primary, #145675));
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
  cursor: pointer;
  font: inherit;
}

.lotte-search-helper__trigger:hover {
  background: color-mix(in srgb, var(--lotte-primary, #145675) 82%, black);
}

.lotte-search-helper__trigger:focus-visible {
  outline: 3px solid var(--lotte-green, #84bd00);
  outline-offset: 2px;
}

.lotte-search-helper__trigger-text {
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.lotte-search-helper__trigger.is-requested {
  background: var(--lotte-green, #84bd00);
  color: #1a1a1a;
}

.lotte-search-agent__panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + .75rem);
  width: min(380px, calc(100vw - 2rem));
  overflow: hidden;
  border: 1px solid var(--mandant-border, #d7dde1);
  border-radius: var(--mandant-radius-md, 6px);
  background: var(--mandant-bg, #fff);
  box-shadow: 0 18px 50px rgb(0 0 0 / .24);
  color: var(--mandant-text, #1a1a1a);
}

.lotte-search-agent__panel[hidden] {
  display: none;
}

.lotte-search-agent__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: var(--lotte-primary, var(--mandant-primary, #145675));
  color: #fff;
}

.lotte-search-agent__header h2 {
  margin: 0;
  color: inherit;
  font-size: 1rem;
  line-height: 1.2;
}

.lotte-search-agent__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgb(255 255 255 / .45);
  border-radius: var(--mandant-radius-md, 6px);
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
}

.lotte-search-agent__form {
  display: grid;
  gap: .5rem;
  padding: 1rem 1rem .75rem;
}

.lotte-search-agent__form label {
  color: var(--mandant-muted, #4a4a4a);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lotte-search-agent__field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem;
}

.lotte-search-agent__field input {
  width: 100%;
  min-width: 0;
  border: 2px solid var(--mandant-border, #ccc);
  border-radius: var(--mandant-radius-md, 6px);
  padding: .75rem .85rem;
  font: inherit;
}

.lotte-search-agent__field input:focus {
  border-color: var(--lotte-primary, var(--mandant-primary, #145675));
  outline: 3px solid color-mix(in srgb, var(--lotte-green, #84bd00) 35%, transparent);
}

.lotte-search-agent__field button {
  border: 0;
  border-radius: var(--mandant-radius-md, 6px);
  background: var(--lotte-green, var(--mandant-secondary, #84bd00));
  color: #10230a;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0 .9rem;
}

.lotte-search-agent__results {
  display: grid;
  max-height: min(310px, 44vh);
  overflow-y: auto;
  padding: 0 1rem .75rem;
}

.lotte-search-agent__results p {
  margin: 0;
  color: var(--mandant-muted, #4a4a4a);
  font-size: .92rem;
  line-height: 1.45;
}

.lotte-search-agent__result {
  display: grid;
  gap: .2rem;
  padding: .75rem 0;
  border-top: 1px solid var(--mandant-border, #d7dde1);
  color: var(--lotte-primary, var(--mandant-primary, #145675));
  text-decoration: none;
}

.lotte-search-agent__result:hover,
.lotte-search-agent__result:focus-visible {
  color: color-mix(in srgb, var(--lotte-primary, #145675) 78%, black);
  text-decoration: underline;
  text-decoration-color: var(--lotte-green, #84bd00);
  text-underline-offset: 3px;
}

.lotte-search-agent__result span {
  font-weight: 800;
}

.lotte-search-agent__result small {
  color: var(--mandant-muted, #4a4a4a);
  font-size: .78rem;
  overflow-wrap: anywhere;
}

.lotte-search-agent__quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  padding: .85rem 1rem 1rem;
  border-top: 1px solid var(--mandant-border, #d7dde1);
  background: var(--mandant-surface, #f5f8fa);
}

.lotte-search-agent__quicklinks a {
  border: 1px solid color-mix(in srgb, var(--lotte-primary, #145675) 22%, transparent);
  border-radius: var(--mandant-radius-md, 6px);
  background: #fff;
  color: var(--lotte-primary, var(--mandant-primary, #145675));
  font-size: .84rem;
  font-weight: 800;
  padding: .45rem .6rem;
  text-decoration: none;
}

.lotte-search-agent__quicklinks a:hover,
.lotte-search-agent__quicklinks a:focus-visible {
  border-color: var(--lotte-green, #84bd00);
  outline: none;
}

.lotte-back-to-top,
.mincore-back-to-top {
  right: max(var(--min-space-lg, 2rem), env(safe-area-inset-right));
  bottom: calc(max(var(--min-space-lg, 2rem), env(safe-area-inset-bottom)) + 56px + 0.75rem);
}

.lotte-back-to-top:not([hidden]) {
  display: flex;
}

.mincore-back-to-top {
  z-index: 1001;
}

html.lotte-controls-over-footer .lotte-search-helper,
html.lotte-controls-over-footer .lotte-back-to-top,
html.lotte-controls-over-footer .mincore-back-to-top {
  opacity: 0;
  pointer-events: none;
  transform: translateY(.5rem);
  visibility: hidden;
}

@media (max-width: 479px) {
  .lotte-search-helper {
    left: max(var(--min-space-md, 1rem), env(safe-area-inset-left));
    bottom: calc(max(var(--min-space-md, 1rem), env(safe-area-inset-bottom)) + 3.25rem);
  }

  .lotte-search-helper__trigger {
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
  }

  .lotte-search-helper__trigger-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .lotte-search-agent__panel {
    left: 0;
    width: calc(100vw - 2rem);
  }

  .lotte-search-agent__field {
    grid-template-columns: 1fr;
  }

  .lotte-search-agent__field button {
    padding: .75rem .9rem;
  }

  .lotte-back-to-top,
  .mincore-back-to-top {
    right: max(var(--min-space-md, 1rem), env(safe-area-inset-right));
    bottom: calc(max(var(--min-space-md, 1rem), env(safe-area-inset-bottom)) + 48px + 0.5rem);
  }
}

@media print {
  .lotte-search-helper,
  .lotte-back-to-top,
  .mincore-back-to-top {
    display: none !important;
  }
}
