/* ==========================================================================
   WebDesigner Sovereign Privacy & Cookie Guard
   100% Self-Hosted, Zero Third-Party Tracker, DSGVO & revDSG Compliant
   100% CD/CI Adaptive (Inherits client brand tokens automatically)
   ========================================================================== */

#cookie-consent-banner {
  /* Brand-Inherited CD/CI Tokens with Fallbacks */
  --cc-bg-surface: var(--color-surface-dark, #17191C);
  --cc-accent: var(--color-accent, #B89758);
  --cc-accent-hover: var(--color-accent-hover, #9E7D47);
  --cc-accent-light: var(--color-accent-light, #D4B87E);
  --cc-text-light: var(--color-surface-white, #FFFFFF);
  --cc-text-muted: #A3A8AF;
  --cc-font: var(--font-family-sans, inherit);

  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  left: 1.5rem;
  max-width: 36rem;
  margin-left: auto;
  z-index: 99999;
  
  background-color: #17191C;
  background-color: color-mix(in srgb, var(--cc-bg-surface) 96%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  
  border: 1px solid rgba(184, 151, 88, 0.25);
  border: 1px solid color-mix(in srgb, var(--cc-accent) 28%, transparent);
  border-radius: 0.75rem;
  
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.8), 0 0 1px 1px color-mix(in srgb, var(--cc-accent) 15%, transparent);
  color: #F8F7F4;
  padding: 1.5rem;
  font-family: var(--cc-font);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

#cookie-consent-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#cookie-consent-banner.is-hidden {
  display: none;
}

.cookie-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.cookie-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cc-text-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cookie-shield-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--cc-accent);
}

.cookie-text {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--cc-text-muted);
  margin-bottom: 1.25rem;
}

.cookie-text a {
  color: var(--cc-accent-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.cookie-text a:hover {
  color: var(--cc-text-light);
}

/* Settings Accordion */
.cookie-categories {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background-color: rgba(36, 40, 45, 0.6);
  background-color: color-mix(in srgb, var(--cc-bg-surface) 60%, rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
}

.cookie-categories.is-open {
  display: flex;
}

.cookie-cat-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cookie-cat-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.cookie-cat-info {
  flex: 1;
}

.cookie-cat-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cc-text-light);
}

.cookie-cat-desc {
  font-size: 0.75rem;
  color: #8E949E;
  line-height: 1.4;
  margin-top: 0.15rem;
}

/* Custom Checkbox Toggle */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

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

.cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #373C44;
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 22px;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
}

.cookie-switch input:checked + .cookie-slider {
  background-color: var(--cc-accent);
}

.cookie-switch input:focus + .cookie-slider {
  box-shadow: 0 0 1px var(--cc-accent);
}

.cookie-switch input:checked + .cookie-slider:before {
  transform: translateX(16px);
}

.cookie-switch input:disabled + .cookie-slider {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #526E5B;
}

/* Button Group */
.cookie-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .cookie-actions {
    grid-template-columns: 1fr;
  }
}

.cookie-btn {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-family: inherit;
}

.cookie-btn-accept {
  background-color: var(--cc-accent);
  color: var(--cc-bg-surface);
}

.cookie-btn-accept:hover {
  background-color: var(--cc-accent-hover);
  box-shadow: 0 0 20px color-mix(in srgb, var(--cc-accent) 35%, transparent);
}

.cookie-btn-reject {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: #F8F7F4;
}

.cookie-btn-reject:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
}

.cookie-btn-settings {
  grid-column: 1 / -1;
  background-color: transparent;
  color: var(--cc-text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.cookie-btn-settings:hover {
  color: var(--cc-text-light);
}

/* Footer Trigger Badge */
.cookie-footer-trigger {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
