/* ============================================================
   COOKIE CONSENT — Dachwelt Alu
   Branding: #1B3665 (blue) · #52B848 (green)
   ============================================================ */

/* ── Banner ─────────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9900;
  padding: 0 20px 20px;
  pointer-events: none;

  /* slide-up animation */
  transform: translateY(110%);
  transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.cookie-banner.is-visible {
  transform: translateY(0);
  pointer-events: all;
}

.cookie-banner__inner {
  max-width: 960px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 -4px 6px rgba(27, 54, 101, 0.04),
    0 20px 60px rgba(27, 54, 101, 0.18);
  border-top: 4px solid #1b3665;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cookie-banner__top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.cookie-banner__icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.cookie-banner__text {
  flex: 1;
}

.cookie-banner__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1b3665;
  margin-bottom: 6px;
  line-height: 1.3;
}

.cookie-banner__desc {
  font-size: 0.85rem;
  color: #4a5568;
  line-height: 1.6;
}

.cookie-link {
  color: #52b848;
  text-decoration: underline;
  font-weight: 500;
}

.cookie-link:hover {
  color: #3d9035;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

/* ── Shared button base ─────────────────────────────────── */
.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
  white-space: nowrap;
  line-height: 1.2;
}

.cookie-btn:focus-visible {
  outline: 3px solid #52b848;
  outline-offset: 3px;
}

.cookie-btn:active {
  transform: scale(0.97);
}

/* Primary — green fill */
.cookie-btn--primary {
  background: #52b848;
  color: #ffffff;
  border-color: #52b848;
}

.cookie-btn--primary:hover {
  background: #3d9035;
  border-color: #3d9035;
  box-shadow: 0 6px 18px rgba(82, 184, 72, 0.35);
}

/* Secondary — blue outline */
.cookie-btn--secondary {
  background: transparent;
  color: #1b3665;
  border-color: #1b3665;
}

.cookie-btn--secondary:hover {
  background: #1b3665;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(27, 54, 101, 0.2);
}

/* Ghost — subtle text link style */
.cookie-btn--ghost {
  background: transparent;
  color: #1b3665;
  border-color: transparent;
  padding: 10px 12px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-btn--ghost:hover {
  color: #52b848;
  background: rgba(82, 184, 72, 0.06);
  text-decoration: none;
}

/* ── Modal overlay ──────────────────────────────────────── */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 9950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cookie-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.cookie-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 50, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

body.cookie-modal-open {
  overflow: hidden;
}

/* ── Modal dialog ───────────────────────────────────────── */
.cookie-modal__dialog {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(27, 54, 101, 0.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;

  transform: translateY(24px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.34, 1.1, 0.64, 1);
}

.cookie-modal.is-visible .cookie-modal__dialog {
  transform: translateY(0) scale(1);
}

/* Modal header */
.cookie-modal__header {
  background: linear-gradient(135deg, #1b3665 0%, #243f7a 100%);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.cookie-modal__header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cookie-modal__header-icon {
  opacity: 0.9;
  display: flex;
  align-items: center;
}

.cookie-modal__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.cookie-modal__close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.cookie-modal__close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.cookie-modal__close:focus-visible {
  outline: 3px solid #52b848;
  outline-offset: 2px;
}

/* Modal body */
.cookie-modal__body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.cookie-modal__intro {
  font-size: 0.875rem;
  color: #4a5568;
  line-height: 1.65;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e8edf5;
}

/* ── Cookie categories ──────────────────────────────────── */
.cookie-category {
  padding: 18px 0;
  border-bottom: 1px solid #e8edf5;
}

.cookie-category:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.cookie-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.cookie-category__info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-category__name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1b3665;
}

.cookie-category__badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: #e8f4e6;
  color: #2e7d32;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cookie-category__badge--opt {
  background: #eef1f8;
  color: #1b3665;
}

.cookie-category__desc {
  font-size: 0.815rem;
  color: #64748b;
  line-height: 1.6;
}

/* ── Toggle switch ──────────────────────────────────────── */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cookie-toggle__slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 26px;
  transition: background 0.25s ease;
}

.cookie-toggle__slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle__slider {
  background: #52b848;
}

.cookie-toggle input:checked + .cookie-toggle__slider::before {
  transform: translateX(20px);
}

.cookie-toggle input:focus-visible + .cookie-toggle__slider {
  outline: 3px solid #52b848;
  outline-offset: 2px;
}

/* Locked (disabled necessary) */
.cookie-toggle__slider--locked {
  background: #52b848;
  opacity: 0.6;
  cursor: not-allowed;
}

.cookie-toggle__slider--locked::before {
  transform: translateX(20px);
}

/* ── Modal footer ───────────────────────────────────────── */
.cookie-modal__footer {
  padding: 18px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid #e8edf5;
  background: #f8faff;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .cookie-banner {
    padding: 0 12px 12px;
  }

  .cookie-banner__inner {
    padding: 18px 16px;
    border-radius: 14px;
  }

  .cookie-banner__top {
    flex-direction: column;
    gap: 12px;
  }

  .cookie-banner__icon {
    display: none;
  }

  .cookie-banner__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-btn--ghost {
    text-align: center;
  }

  .cookie-modal__footer {
    flex-direction: column-reverse;
  }

  .cookie-modal__footer .cookie-btn {
    width: 100%;
    justify-content: center;
  }
}
