/* assets_v2/css/cookie-consent-overlay.css */

/*
   ISOLATION-STRATEGIE:
   Das Theme (responsive.css) setzt html { font-size: 50/60/75/100% } je Breakpoint.
   Dadurch werden rem-Werte im Banner auf allen Viewports falsch berechnet.

   Lösung:
   - #cookie-consent-banner bekommt font-size: 16px (absolut, px)
   - Alle internen Größen nutzen em → relativ zu diesen 16px, nicht zu html
   - So ist der Banner auf jedem Viewport vollständig unabhängig vom Theme-Scaling
*/

/* -------------------------------------------------------
   Backdrop
------------------------------------------------------- */

#cookie-consent-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(17, 15, 16, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 480ms cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
}

#cookie-consent-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

/* -------------------------------------------------------
   Modal – font-size: 16px setzt den em-Kontext
------------------------------------------------------- */

#cookie-consent-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 9999;

  transform: translate(-50%, -50%) scale(1);
  opacity: 1;

  /* Eigener em-Kontext – unabhängig von html font-size des Themes */
  font-size: 16px;

  background: #ffffff;
  color: #1a1a1a;

  width: 560px;
  max-width: calc(100vw - 2em);

  /* em relativ zu den 16px oben → entspricht exakt den alten rem-Werten */
  padding: 2em 2.25em 1.75em;

  border-radius: 4px;

  box-shadow:
    0 2px 8px rgba(17, 15, 16, 0.06),
    0 24px 64px rgba(17, 15, 16, 0.18);

  transition: transform 480ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 380ms cubic-bezier(0.4, 0, 0.2, 1);
}

#cookie-consent-banner.hidden {
  transform: translate(-50%, -48%) scale(0.97);
  opacity: 0;
  pointer-events: none;
}

/* -------------------------------------------------------
   Logo
------------------------------------------------------- */

#cookie-consent-banner .cookie-logo {
  display: block;
  margin-bottom: 1.25em;
}

#cookie-consent-banner .cookie-logo img {
  height: 52px;
  width: auto;
  display: block;
}

/* -------------------------------------------------------
   Titel  →  1.1em × 16px = 17.6px
------------------------------------------------------- */

#cookie-consent-banner .cookie-title {
  font-family: inherit;
  font-weight: 600;
  font-size: 1.1em;
  line-height: 1.25;
  margin-bottom: 0.65em;
  margin-top: 0;
  color: #1a1a1a;
}

/* -------------------------------------------------------
   Fließtext  →  0.875em × 16px = 14px
------------------------------------------------------- */

#cookie-consent-banner .cookie-text {
  font-family: inherit;
  font-size: 0.875em;
  line-height: 1.65;
  color: rgba(26, 26, 26, 0.72);
  margin-bottom: 0;
  margin-top: 0;

  word-break: break-word;
  overflow-wrap: break-word;
}

#cookie-consent-banner .cookie-text a {
  color: #6ab43e;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#cookie-consent-banner .cookie-text a:hover {
  color: #559030;
}

/* -------------------------------------------------------
   Trennlinie
------------------------------------------------------- */

#cookie-consent-banner .cookie-divider {
  border: none;
  border-top: 1px solid rgba(26, 26, 26, 0.1);
  margin: 1.25em 0 1em;
}

/* -------------------------------------------------------
   Zusatz-Links  →  0.8em × 16px = 12.8px
------------------------------------------------------- */

#cookie-consent-banner .cookie-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25em 1em;
  margin-bottom: 1.25em;
}

#cookie-consent-banner .cookie-links a {
  font-size: 0.8em;
  color: rgba(26, 26, 26, 0.5);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#cookie-consent-banner .cookie-links a:hover {
  color: #6ab43e;
}

/* -------------------------------------------------------
   Button-Gruppe
------------------------------------------------------- */

.cookie-consent-buttons {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6em;
  margin-top: 0;
}

/* Ablehnen – Ghost */
#cookie-decline-btn {
  display: inline-block;
  appearance: none;
  border: 1.5px solid rgba(106, 180, 62, 0.45);
  border-radius: 3px;

  background: transparent;
  color: #6ab43e;

  padding: 10px 22px;
  font-size: 13px;

  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.03em;

  cursor: pointer;
  text-align: center;
  white-space: nowrap;

  transition: border-color 250ms ease, background 250ms ease, color 250ms ease;
}

#cookie-decline-btn:hover {
  border-color: #6ab43e;
  background: rgba(106, 180, 62, 0.06);
  color: #559030;
}

/* Akzeptieren – Primary */
#cookie-accept-btn {
  display: inline-block;
  appearance: none;
  border: 1.5px solid #6ab43e;
  border-radius: 3px;

  background: #6ab43e;
  color: #fff;

  padding: 10px 26px;
  font-size: 13px;

  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.03em;

  cursor: pointer;
  text-align: center;
  white-space: nowrap;

  transform: translateZ(0);
  will-change: transform;
  transition: background 250ms ease, border-color 250ms ease,
              transform 520ms cubic-bezier(.2, .8, .2, 1);
}

#cookie-accept-btn:hover {
  background: #559030;
  border-color: #559030;
}

#cookie-accept-btn:active {
  transform: translateZ(0) scale(0.98);
}

/* -------------------------------------------------------
   Mobile – Bottom Sheet  (≤ 560px)
   font-size bleibt 16px durch den Banner-Kontext –
   hier nur Layout und leicht größere Touch-Targets
------------------------------------------------------- */

@media (max-width: 560px) {
  #cookie-consent-banner {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translate(0, 0) scale(1);

    width: 100%;
    max-width: 100%;
    padding: 24px 20px calc(28px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;

    box-shadow: 0 -4px 24px rgba(17, 15, 16, 0.12);
  }

  #cookie-consent-banner.hidden {
    transform: translate(0, 100%) scale(1);
  }

  /* Auf Mobile leicht größer für bessere Lesbarkeit auf Retina */
  #cookie-consent-banner .cookie-title {
    font-size: 13px;
    line-height: 1.3;
  }

  #cookie-consent-banner .cookie-text {
    font-size: 12px;
    line-height: 1.6;
  }

  #cookie-consent-banner .cookie-links a {
    font-size: 11.5px;
  }

  .cookie-consent-buttons {
    flex-direction: column-reverse;
    gap: 8px;
  }

  #cookie-accept-btn {
    width: 100%;
    padding: 14px 26px;
    font-size: 12.5px;
  }

  #cookie-decline-btn {
    width: 100%;
    padding: 12px 22px;
    font-size: 12.5px;
  }
}

/* -------------------------------------------------------
   Isolation gegen page-specific CSS
   (body.contact p, .imprint-wrapper p usw.)
   font-size: inherit zieht jetzt die 16px vom Banner,
   nicht mehr das skalierte rem des Themes
------------------------------------------------------- */

#cookie-consent-banner p,
#cookie-consent-banner .cookie-title,
#cookie-consent-banner .cookie-text {
  margin-top: 0;
  line-height: inherit;
  font-size: inherit;
}

#cookie-consent-banner .cookie-title {
  font-size: 1.1em;
  line-height: 1.25;
  margin-bottom: 0.65em;
}

#cookie-consent-banner .cookie-text {
  font-size: 0.875em;
  line-height: 1.65;
  margin-bottom: 0;
}

#cookie-consent-banner button {
  font-size: 13px;
}

/* Mobile-Overrides für den Isolation-Block */
@media (max-width: 560px) {
  #cookie-consent-banner .cookie-title { font-size: 14px; }
  #cookie-consent-banner .cookie-text  { font-size: 12px; }
  #cookie-consent-banner button        { font-size: 13px; }
}