/* Hagelschaden-Störer (Pill unten rechts, Teaser-Karte, Dialog)
   Eigenständige CSS-Datei, bewusst nicht Teil des SCSS-Kompilats.
   Eingebunden in templates/standard.wDocument.php */

:root {
  --hs-orange: #E67B3B;
  --hs-orange-dark: #CC6628;
  --hs-teal: #179BA8;
  --hs-teal-dark: #127E89;
  --hs-dark: #4C4F57;
  --hs-text: #333333;
  --hs-muted: #6B6E76;
  --hs-line: #E6E6E6;
  --hs-radius: 18px;
  --hs-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --hs-offset-right: 56px;   /* Platz für den Scroll-nach-oben-Pfeil (40px, rechts aussen) */
  --hs-offset-bottom: 22px;
}

/* ---------- Container unten rechts ---------- */

.hagelStoerer {
  position: fixed;
  right: var(--hs-offset-right);
  bottom: var(--hs-offset-bottom);
  z-index: 1000;
  font-family: 'MuseoSans-300', Arial, sans-serif;
  color: var(--hs-text);
  -webkit-font-smoothing: antialiased;
}

html.wglEditor .hagelStoerer,
html.weditor .hagelStoerer {
  display: none;
}

/* Symbol: Span muss Blockmass haben, sonst nimmt das SVG die volle Breite */
.hagelStoerer .hsIcon,
.hsDialog .hsIcon {
  display: block;
  flex: 0 0 auto;
}

.hagelStoerer .hsIcon svg,
.hsDialog .hsIcon svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
}

/* ---------- Pill ---------- */

.hsPill {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0 22px 0 14px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: var(--hs-orange);
  color: #fff;
  font-family: 'Changa One', 'MuseoSans-700', Arial, sans-serif;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(230, 123, 59, 0.45);
  transform: translateY(120px);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.35s ease, background-color 0.2s ease;
}

.hagelStoerer.hsReady .hsPill {
  transform: translateY(0);
  opacity: 1;
}

.hsPill:hover,
.hsPill:focus-visible {
  background: var(--hs-orange-dark);
  outline: none;
}

.hsPill:focus-visible {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9), 0 0 0 7px var(--hs-orange);
}

.hsPill .hsIcon {
  display: block;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
}

.hsPill .hsIcon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Puls-Ring, damit die Pille auffällt (alle paar Sekunden) */
.hagelStoerer.hsReady[data-state="pill"] .hsPill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(230, 123, 59, 0.6);
  animation: hsPulse 5s ease-out 1.5s infinite;
  pointer-events: none;
}

.hsPill {
  position: relative;
}

@keyframes hsPulse {
  0%   { box-shadow: 0 0 0 0 rgba(230, 123, 59, 0.6); }
  18%  { box-shadow: 0 0 0 18px rgba(230, 123, 59, 0); }
  100% { box-shadow: 0 0 0 18px rgba(230, 123, 59, 0); }
}

/* ---------- Teaser-Karte ---------- */

.hsCard {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: calc(100vw - var(--hs-offset-right) - 16px);
  padding: 24px 24px 20px;
  border-radius: var(--hs-radius);
  background: #fff;
  box-shadow: var(--hs-shadow);
  transform-origin: 100% 100%;
  transform: scale(0.6);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.15), opacity 0.3s ease;
}

.hsCard::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  border-radius: var(--hs-radius) var(--hs-radius) 0 0;
  background: var(--hs-orange);
}

.hagelStoerer[data-state="card"] .hsCard {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.hagelStoerer[data-state="card"] .hsPill {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.hsCardClose {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--hs-muted);
  font-size: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.hsCardClose::before,
.hsCardClose::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.hsCardClose::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.hsCardClose:hover,
.hsCardClose:focus-visible {
  background: #F0F0F0;
  color: var(--hs-dark);
  outline: none;
}

.hsCardHead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 36px 10px 0;
}

.hsCardHead .hsIcon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 8px;
  border-radius: 50%;
  background: var(--hs-orange);
  color: #fff;
}

.hsCardHead .hsIcon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hsCardTitle {
  font-family: 'Changa One', 'MuseoSans-700', Arial, sans-serif;
  font-size: 26px;
  line-height: 1.05;
  color: var(--hs-dark);
}

.hsCardText {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
}

.hsCardLogos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
}

.hsCardLogos img {
  display: block;
  height: 26px;
  width: auto;
  max-width: 88px;
  object-fit: contain;
  padding: 3px 6px;
  border: 1px solid var(--hs-line);
  border-radius: 6px;
  background: #fff;
}

.hsCardActions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hsBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  font-family: 'MuseoSans-700', Arial, sans-serif;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.hsBtn:active {
  transform: translateY(1px);
}

.hsBtnPrimary {
  background: var(--hs-orange);
  color: #fff;
}

.hsBtnPrimary:hover,
.hsBtnPrimary:focus-visible {
  background: var(--hs-orange-dark);
  color: #fff;
  outline: none;
}

.hsBtnSecondary {
  background: var(--hs-teal);
  color: #fff;
}

.hsBtnSecondary:hover,
.hsBtnSecondary:focus-visible {
  background: var(--hs-teal-dark);
  color: #fff;
  outline: none;
}

.hsBtnGhost {
  background: transparent;
  color: var(--hs-dark);
  padding: 0 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hsBtnGhost:hover,
.hsBtnGhost:focus-visible {
  color: var(--hs-teal);
  outline: none;
}

.hsBtn:focus-visible {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--hs-teal);
}

/* ---------- Dialog ---------- */

.hsDialog {
  box-sizing: border-box;
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: #fff;
  color: var(--hs-text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  font-family: 'MuseoSans-300', Arial, sans-serif;
  overflow: hidden;
}

.hsDialog::backdrop {
  background: rgba(30, 32, 38, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.hsDialog[open] {
  animation: hsDialogIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

@keyframes hsDialogIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Fallback, falls <dialog> nicht unterstützt wird */
.hsDialog.hsFallback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100000;
}

.hsBackdropFallback {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(30, 32, 38, 0.72);
}

html.hsNoScroll,
html.hsNoScroll body {
  overflow: hidden;
}

.hsDialogInner {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.hsDialogHead {
  position: relative;
  padding: 36px 40px 28px;
  background: var(--hs-orange);
  color: #fff;
  overflow: hidden;
}

.hsDialogHead::after {
  /* dekorative, grosse Hagel-Wolke rechts oben */
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.hsDialogHead .hsIcon {
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
}

.hsDialogHead .hsIcon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hsDialogTitle {
  margin: 0 56px 10px 0;
  font-family: 'Changa One', 'MuseoSans-700', Arial, sans-serif;
  font-size: 40px;
  line-height: 1.02;
  color: #fff;
}

.hsDialogLead {
  margin: 0;
  max-width: 640px;
  font-size: 18px;
  line-height: 1.5;
}

.hsDialogClose {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.hsDialogClose::before,
.hsDialogClose::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 2px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.hsDialogClose::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.hsDialogClose:hover,
.hsDialogClose:focus-visible {
  background: rgba(255, 255, 255, 0.35);
  outline: none;
}

.hsDialogBody {
  padding: 32px 40px 36px;
}

.hsSteps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
  counter-reset: hsStep;
}

.hsSteps li {
  position: relative;
  padding: 0 0 0 52px;
  font-size: 15px;
  line-height: 1.5;
  counter-increment: hsStep;
}

.hsSteps li::before {
  content: counter(hsStep);
  position: absolute;
  left: 0;
  top: -2px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--hs-teal);
  color: #fff;
  font-family: 'Changa One', 'MuseoSans-700', Arial, sans-serif;
  font-size: 20px;
  line-height: 38px;
  text-align: center;
}

.hsSteps li strong {
  display: block;
  margin-bottom: 2px;
  font-family: 'MuseoSans-700', Arial, sans-serif;
  font-weight: normal;
  color: var(--hs-dark);
}

.hsSteps .hsStepLogo {
  display: block;
  width: auto;
  height: 56px;
  margin-top: 10px;
}

.hsPartnerTitle {
  margin: 0 0 14px;
  font-family: 'MuseoSans-700', Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hs-muted);
}

.hsPartnerLogos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 0 14px;
}

.hsPartnerLogos div {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 74px;
  padding: 12px 16px;
  border: 1px solid var(--hs-line);
  border-radius: 12px;
  background: #fff;
}

.hsPartnerLogos img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.hsPartnerLogos .hsLogoSquare img {
  max-height: 48px;
}

.hsHint {
  margin: 0 0 28px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--hs-muted);
}

.hsDialogActions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hsDialogActions .hsBtn {
  height: 52px;
  padding: 0 26px;
  font-size: 16px;
}

/* Desktop: Melden-Button zuerst, die beiden Links daneben in derselben Reihe */
.hsDialogLinks {
  display: contents;
}

.hsDialogMain {
  display: contents;
}

.hsDialogMain .hsBtn {
  order: -1;
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
  :root {
    --hs-offset-right: 48px;
    --hs-offset-bottom: 14px;
  }

  .hsPill {
    height: 50px;
    padding: 0 18px 0 12px;
    font-size: 18px;
  }

  .hsCard {
    width: calc(100vw - 28px);
    max-width: none;
    right: calc(-1 * var(--hs-offset-right) + 14px);
    padding: 20px 20px 18px;
  }

  .hsCardTitle {
    font-size: 23px;
  }

  .hsCardText {
    font-size: 14px;
  }

  .hsCardActions {
    flex-wrap: wrap;
  }

  .hsDialog {
    width: 100vw;
    max-width: none;
    max-height: 100vh;
    max-height: 100dvh;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  .hsDialog[open] {
    animation-name: hsSheetIn;
  }

  @keyframes hsSheetIn {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }

  .hsDialogInner {
    max-height: 100vh;
    max-height: 100dvh;
  }

  .hsDialogHead {
    padding: 28px 22px 22px;
  }

  .hsDialogTitle {
    font-size: 30px;
    margin-right: 44px;
  }

  .hsDialogLead {
    font-size: 16px;
  }

  .hsDialogBody {
    padding: 24px 22px 28px;
  }

  .hsSteps {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 26px;
  }

  .hsPartnerLogos {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .hsPartnerLogos div {
    height: 64px;
    padding: 10px 14px;
  }

  /* Mobile: nur der Melden-Button klebt unten (Milchglas), die Links stehen am Ende des Inhalts */
  .hsDialogBody {
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .hsDialogActions {
    display: contents; /* damit der Sticky-Button den ganzen Inhalt als Bezug hat */
  }

  .hsDialogLinks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin: 0 0 22px;
  }

  .hsDialogActions .hsBtnSecondary {
    height: 44px;
    padding: 0 18px;
    font-size: 14px;
  }

  .hsDialogActions .hsBtnGhost {
    height: 44px;
    padding: 0;
    font-size: 15px;
  }

  .hsDialogBody {
    padding-bottom: 0;
  }

  /* Hülle klebt unten, Milchglas liegt hinter dem Button */
  .hsDialogMain {
    display: block;
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0 -22px 0;
    padding: 12px 22px calc(14px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    backdrop-filter: blur(12px) saturate(1.2);
  }

  .hsDialogMain .hsBtn {
    order: 0;
    width: 100%;
    height: 52px;
    box-shadow: 0 6px 18px rgba(230, 123, 59, 0.3);
  }

  .hsHint {
    margin-bottom: 18px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hsPartnerLogos {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hsPill,
  .hsCard,
  .hsDialog[open] {
    transition: none;
    animation: none;
  }

  .hagelStoerer.hsReady[data-state="pill"] .hsPill::after {
    animation: none;
  }
}

@media print {
  .hagelStoerer,
  .hsDialog {
    display: none !important;
  }
}
