/* Gemeinsames Cookie-Consent-UI (Nectify-Dock-Layout, Marken via CSS-Variablen) */
html {
  scrollbar-gutter: stable;
}

:root {
  --cc-overlay: rgba(6, 4, 14, 0.52);
  --cc-card-bg: rgba(255, 253, 251, 0.98);
  --cc-card-border: rgba(15, 23, 42, 0.12);
  --cc-card-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  --cc-card-glow: rgba(255, 145, 29, 0.12);
  --cc-title: #0f172a;
  --cc-body: #475569;
  --cc-body-strong: #0f172a;
  --cc-link: #c2410c;
  --cc-link-hover: #9a3412;
  --cc-btn-ghost-bg: #f3f2f6;
  --cc-btn-ghost-text: #2d2640;
  --cc-btn-ghost-border: #e4e2ea;
  --cc-btn-reject-bg: #ffffff;
  --cc-btn-reject-text: #5b21b6;
  --cc-btn-reject-border: rgba(109, 40, 217, 0.42);
  --cc-btn-settings-bg: #f8f6fd;
  --cc-btn-settings-text: #4a4460;
  --cc-btn-settings-border: rgba(139, 92, 246, 0.22);
  --cc-btn-accept-bg: linear-gradient(110deg, #e67e17, #ff911d 45%, #ffc978 55%, #ff911d);
  --cc-btn-accept-text: #fff;
  --cc-btn-accept-shadow: 0 3px 10px rgba(230, 126, 23, 0.28);
  --cc-focus: #ff911d;
  --cc-fab-bg: rgba(15, 23, 42, 0.92);
  --cc-fab-border: rgba(255, 145, 29, 0.45);
  --cc-fab-color: #fff7ed;
  --cc-fab-panel-bg: rgba(255, 253, 251, 0.98);
  --cc-fab-panel-border: rgba(15, 23, 42, 0.12);
  --cc-font-title: "DM Sans", "Plus Jakarta Sans", system-ui, sans-serif;
  --cc-font-body: "DM Sans", "Inter", system-ui, sans-serif;
}

html.cc-cookie-lock,
body.cc-cookie-lock {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.cc-cookie-lock {
  touch-action: none;
}

body.cc-cookie-lock .cc-consent,
body.cc-cookie-lock #ccCookiePrefs {
  touch-action: auto;
}

.cc-consent {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 16px max(16px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  font-family: var(--cc-font-body);
  pointer-events: none;
}

.cc-consent[hidden] {
  display: none !important;
}

.cc-consent__overlay {
  position: absolute;
  inset: 0;
  background: var(--cc-overlay);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  pointer-events: auto;
}

.cc-consent__card {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: var(--cc-card-bg);
  border: 1px solid var(--cc-card-border);
  box-shadow: var(--cc-card-shadow), 0 0 0 1px var(--cc-card-glow);
  pointer-events: auto;
}

.cc-consent__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 0;
  text-align: left;
}

.cc-consent__logo {
  display: block;
  width: auto;
  height: 22px;
  max-width: min(180px, 34vw);
  margin: 0;
  flex-shrink: 0;
  object-fit: contain;
}

.cc-consent__logo--text {
  height: auto;
  margin: 0;
  font-family: var(--cc-font-title);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--cc-title);
}

.cc-consent__title {
  margin: 0;
  padding: 0;
  font-family: var(--cc-font-title);
  font-size: clamp(0.82rem, 1.8vw, 0.95rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--cc-title);
}

.cc-consent__body {
  flex: 0 1 auto;
  overflow-y: auto;
  padding: 8px 18px 4px;
  text-align: left;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--cc-body);
  -webkit-font-smoothing: antialiased;
  scrollbar-width: thin;
}

.cc-consent__body p {
  margin: 0 0 8px;
}

.cc-consent__body p:last-child {
  margin-bottom: 0;
}

.cc-consent__body strong {
  font-weight: 600;
  color: var(--cc-body-strong);
}

.cc-consent__body a {
  color: var(--cc-link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-consent__body a:hover {
  color: var(--cc-link-hover);
}

.cc-consent__footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 18px 14px;
}

.cc-consent__footer--balanced,
.cc-consent__footer--stacked {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 18px 14px;
}

.cc-consent__footer--balanced .cc-consent__btn,
.cc-consent__footer--stacked .cc-consent__btn {
  width: 100%;
  margin: 0;
}

.cc-consent__footer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cc-consent__footer-row {
  display: grid;
  gap: 10px;
  width: 100%;
}

.cc-consent__footer-row--secondary {
  grid-template-columns: 1fr 1fr;
}

.cc-consent__footer-row--secondary .cc-consent__btn {
  width: 100%;
  min-height: 38px;
  font-size: 0.8125rem;
  padding: 8px 12px;
}

.cc-consent__btn--reject {
  background: var(--cc-btn-reject-bg);
  color: var(--cc-btn-reject-text);
  border: 1.5px solid var(--cc-btn-reject-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(26, 16, 40, 0.06);
}

.cc-consent__btn--reject:hover {
  filter: brightness(0.98);
}

.cc-consent__btn--settings {
  width: 100%;
  min-height: 38px;
  margin: 0;
  background: var(--cc-btn-settings-bg);
  color: var(--cc-btn-settings-text);
  border: 1.5px solid var(--cc-btn-settings-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.cc-consent__btn--settings:hover {
  filter: brightness(0.98);
}

.cc-consent__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: none;
  border-radius: 9px;
  font-family: var(--cc-font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.cc-consent__btn:hover {
  transform: translateY(-1px);
}

.cc-consent__btn--ghost {
  margin-right: 6px;
  background: var(--cc-btn-ghost-bg);
  color: var(--cc-btn-ghost-text);
  box-shadow: inset 0 0 0 1px var(--cc-btn-ghost-border);
}

.cc-consent__btn--ghost:hover {
  filter: brightness(0.97);
}

.cc-consent__btn--accept {
  margin: 0;
  background: var(--cc-btn-accept-bg);
  color: var(--cc-btn-accept-text);
  box-shadow: var(--cc-btn-accept-shadow);
}

.cc-consent__btn:focus-visible {
  outline: 2px solid var(--cc-focus);
  outline-offset: 2px;
}

.cc-consent__footer-row--primary .cc-consent__btn--accept {
  width: 100%;
}

/* Einstellungen (zweites Modal – zentriert) */
#ccCookiePrefs.cc-consent {
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

#ccCookiePrefs .cc-consent__card {
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
}

#ccCookiePrefs .cc-consent__header {
  display: block;
  padding: 24px 36px 0;
  text-align: center;
}

#ccCookiePrefs .cc-consent__body {
  padding: 18px 36px 8px;
  font-size: 0.8125rem;
}
.cc-consent-prefs__options {
  display: grid;
  gap: 0;
  margin: 8px 0 4px;
}

.cc-consent-prefs__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--cc-card-border);
  cursor: pointer;
}

.cc-consent-prefs__row:first-child {
  border-top: none;
}

.cc-consent-prefs__row strong {
  display: block;
  font-size: 0.875rem;
  color: var(--cc-title);
  margin-bottom: 4px;
}

.cc-consent-prefs__row small {
  display: block;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--cc-body);
  font-weight: 400;
}

.cc-consent-prefs__footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 16px 36px 28px;
}

.cc-consent-prefs__footer .cc-consent__btn {
  margin: 0;
  min-height: 46px;
  font-size: 0.8125rem;
  padding: 10px 12px;
}

/* FAB */
.cc-cookie-fab-wrap {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + var(--hg-cookie-lift, 0px));
  z-index: 2147482000;
  font-family: var(--cc-font-body);
  width: 44px;
  height: 44px;
  pointer-events: none;
}

.cc-cookie-fab {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  pointer-events: auto;
  border-radius: 999px;
  border: 1px solid var(--cc-fab-border);
  background: var(--cc-fab-bg);
  color: var(--cc-fab-color);
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  display: grid;
  place-items: center;
}

.cc-cookie-fab svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.cc-cookie-fab-panel {
  position: absolute;
  right: 0;
  bottom: 48px;
  pointer-events: auto;
  width: min(300px, calc(100vw - 24px));
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--cc-fab-panel-border);
  background: var(--cc-fab-panel-bg);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
  display: grid;
  gap: 8px;
}

.cc-cookie-fab-panel.hidden {
  display: none;
}

.cc-cookie-fab-panel__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--cc-title);
}

.cc-cookie-fab-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--cc-body);
}

.cc-cookie-fab-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.cc-cookie-fab-panel .cc-consent__btn {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.75rem;
  margin: 0;
}

.cc-cookie-fab-feedback {
  position: absolute;
  right: 0;
  bottom: 52px;
  margin: 0;
  max-width: min(280px, calc(100vw - 32px));
  font-size: 0.72rem;
  text-align: right;
  color: var(--cc-body);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cc-cookie-fab-feedback.is-visible {
  opacity: 1;
}

/* Schutz vor Elementor/Theme-Resets (Verkaufsguide lädt WP-CSS im Body) */
#ccCookieFabWrap.cc-cookie-fab-wrap {
  position: fixed !important;
  left: auto !important;
  top: auto !important;
  right: max(16px, env(safe-area-inset-right, 0px)) !important;
  bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + var(--hg-cookie-lift, 0px)) !important;
  z-index: 2147482000 !important;
  width: 44px !important;
  height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
  font-family: var(--cc-font-body) !important;
}

#ccCookieFabWrap .cc-cookie-fab,
#ccCookieFabWrap button.cc-cookie-fab {
  appearance: none !important;
  -webkit-appearance: none !important;
  position: relative !important;
  z-index: 1 !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid var(--cc-fab-border) !important;
  background: var(--cc-fab-bg) !important;
  color: var(--cc-fab-color) !important;
  font: inherit !important;
  line-height: 1 !important;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28) !important;
  display: grid !important;
  place-items: center !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  transform: none !important;
}

#ccCookieFabWrap .cc-cookie-fab svg {
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  fill: none !important;
}

@media (max-width: 520px) {
  .cc-consent {
    padding-left: 12px;
    padding-right: 12px;
  }

  .cc-consent__footer-row--secondary {
    grid-template-columns: 1fr;
  }

  .cc-consent-prefs__footer {
    grid-template-columns: 1fr;
  }
}

/* Legacy: Dashboard nutzt dasselbe Dock-Layout */
body.hg-dashboard-chrome .cc-consent:not(#ccCookiePrefs) .cc-consent__overlay {
  pointer-events: auto;
}

body.hg-dashboard-chrome #ccCookiePrefs.cc-consent {
  align-items: center;
  padding: 24px 20px;
}

body.hg-dashboard-chrome #ccCookiePrefs .cc-consent__card {
  max-height: min(90vh, 720px);
}
