/* ============================================================
   zugpferd.io – Cookie Consent Banner
   DSGVO/GDPR compliant – blocks AdSense until consent given
   ============================================================ */

#cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 35, 0.55);
  z-index: 9998;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #ffffff;
  border-top: 3px solid #E8A820;
  box-shadow: 0 -8px 40px rgba(27, 45, 79, 0.18);
  padding: 24px;
  font-family: 'Inter', system-ui, sans-serif;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.cookie-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.cookie-text {
  flex: 1;
  min-width: 260px;
}

.cookie-text strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #1B2D4F;
  margin-bottom: 6px;
}

.cookie-text p {
  font-size: 13px;
  color: #5A6478;
  line-height: 1.6;
  margin: 0;
}

.cookie-text a {
  color: #1B2D4F;
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.cookie-btn-accept {
  background: #1B2D4F;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.cookie-btn-accept:hover { background: #2A4170; }

.cookie-btn-decline {
  background: transparent;
  color: #5A6478;
  border: 1.5px solid #DDE3EE;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.cookie-btn-decline:hover { background: #F7F8FA; border-color: #B0BFD8; }

.cookie-btn-settings {
  background: transparent;
  color: #5A6478;
  border: none;
  padding: 11px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}

/* Settings panel */
#cookie-settings {
  display: none;
  max-width: 1080px;
  margin: 20px auto 0;
  padding-top: 20px;
  border-top: 1px solid #DDE3EE;
}

#cookie-settings.open { display: block; }

.cookie-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #F7F8FA;
  gap: 16px;
}

.cookie-toggle-info strong {
  font-size: 14px;
  font-weight: 600;
  color: #1B2D4F;
  display: block;
  margin-bottom: 2px;
}

.cookie-toggle-info span {
  font-size: 12px;
  color: #5A6478;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #DDE3EE;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider { background: #1B2D4F; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }

.cookie-settings-save {
  margin-top: 16px;
  background: #E8A820;
  color: #1B2D4F;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.cookie-settings-save:hover { background: #d49a18; }

/* Reopen button (bottom-left after consent) */
#cookie-reopen {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 9000;
  background: #1B2D4F;
  color: rgba(255,255,255,0.8);
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  display: none;
  transition: background 0.15s;
}

#cookie-reopen:hover { background: #2A4170; color: #fff; }

@media (max-width: 600px) {
  .cookie-inner { flex-direction: column; gap: 16px; }
  .cookie-actions { width: 100%; justify-content: stretch; }
  .cookie-btn-accept, .cookie-btn-decline { flex: 1; text-align: center; }
}

/* ── PWA INSTALL BANNER ── */
.pwa-install-banner {
  position: fixed;
  bottom: 16px;
  right: 16px;
  left: 16px;
  max-width: 420px;
  margin: 0 auto 0 auto;
  z-index: 9500;
  background: #ffffff;
  border: 1px solid #DDE3EE;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(27,45,79,0.18);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-family: 'Inter', system-ui, sans-serif;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.pwa-install-banner.visible {
  transform: translateY(0);
  opacity: 1;
}

.pwa-install-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.pwa-install-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pwa-install-text strong {
  font-size: 14px;
  font-weight: 600;
  color: #1B2D4F;
}

.pwa-install-text span {
  font-size: 12px;
  color: #5A6478;
  line-height: 1.5;
}

.pwa-install-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-install-btn {
  background: #1B2D4F;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.pwa-install-btn:hover { background: #2A4170; }

.pwa-install-dismiss {
  background: transparent;
  border: none;
  color: #B0BFD8;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  transition: color 0.15s;
}

.pwa-install-dismiss:hover { color: #5A6478; }

@media (max-width: 480px) {
  .pwa-install-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .pwa-install-actions {
    flex-direction: row;
    justify-content: flex-end;
    width: 100%;
  }
}

@media print {
  .pwa-install-banner { display: none !important; }
}
