/* ---- Overlay ---- */
#cb-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  --cb-blur: 14px;
  --cb-darken: transparent;
  --cb-darken-opacity: 0;
}

#cb-overlay.cb-active {
  pointer-events: all;
}

#cb-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--cb-darken, transparent) 100%);
  backdrop-filter: blur(var(--cb-blur, 14px));
  -webkit-backdrop-filter: blur(var(--cb-blur, 14px));
  opacity: 0;
  transition: opacity 0.6s ease;
}

#cb-overlay.cb-active::before {
  opacity: 1;
}

#cb-overlay.cb-darken-light::before  { background: rgba(0,0,0,0.3); }
#cb-overlay.cb-darken-medium::before { background: rgba(0,0,0,0.6); }
#cb-overlay.cb-darken-dark::before   { background: rgba(0,0,0,0.8); }

/* ---- Banner ---- */
#cb-banner {
  position: relative;
  z-index: 1;
  pointer-events: all;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 24px;
  padding: 0 16px;
  transform: translateY(24px);
  opacity: 0;
  transition:
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.7s ease;
}

#cb-overlay.cb-active #cb-banner {
  transform: translateY(0);
  opacity: 1;
}

/* Banner inherits font and size settings */
#cb-overlay, #cb-overlay * {
  font-family: inherit !important;
  color: #ffffff !important;
}
#cb-overlay .cb-prefs-panel * {
  font-size: inherit;
}
#cb-overlay {
  font-size: 14px;
}

.cb-inner {
  background: rgba(14, 13, 12, 0.97) !important;
  padding: 12px 0 12px 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  align-items: center;
}

.cb-inner::before {
  display: none;
}

/* ---- Text ---- */
.cb-eyebrow {
  display: block;
  font-size: inherit;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 4px;
}

.cb-headline {
  font-size: 1.55em;
  font-weight: 300;
  letter-spacing: 1px;
  color: #ffffff;
  margin: 0 0 6px;
  line-height: 1.25;
}

.cb-body {
  font-size: inherit;
  font-weight: 300;
  line-height: 1.45;
  color: #ffffff;
  margin: 0;
  max-width: 680px;
}

.cb-body a,
#cb-banner .cb-body a {
  color: #ffffff !important;
  font-size: inherit !important;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  transition: border-color 0.2s;
}

.cb-body a:hover {
  border-color: #ffffff;
}

/* ---- Buttons ---- */
.cb-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  min-width: 220px;
  padding: 12px 32px;
  margin-left: 16px;
}

.cb-btn {
  display: block;
  width: 100%;
  padding: 16px 36px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.08s ease;
  text-align: center;
  box-sizing: border-box;
  line-height: normal;
  -webkit-appearance: none;
  appearance: none;
}

.cb-btn-accept {
  background: #ffffff !important;
  color: #0c0c0c !important;
  border-color: #ffffff !important;
}

.cb-btn-accept:hover,
#cb-overlay .cb-btn-accept:hover,
#cb-banner .cb-btn-accept:hover {
  background: #2d6a2d !important;
  border-color: #2d6a2d !important;
  color: #ffffff !important;
}

.cb-btn-reject {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.cb-btn-reject:hover {
  background: #720510 !important;
  color: #ffffff !important;
  border-color: #720510 !important;
}

.cb-btn-customize {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.cb-btn-customize:hover {
  background: transparent !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.9);
}

/* ---- Hidden state ---- */
#cb-overlay.cb-hidden {
  pointer-events: none !important;
  touch-action: none !important;
}

#cb-overlay.cb-hidden * {
  pointer-events: none !important;
  touch-action: none !important;
}

#cb-overlay.cb-active::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: default;
}

#cb-overlay.cb-active #cb-banner {
  pointer-events: all;
}

#cb-overlay.cb-hidden::before {
  opacity: 0;
}

#cb-overlay.cb-hidden #cb-banner {
  transform: translateY(32px);
  opacity: 0;
  transition:
    transform 0.5s cubic-bezier(0.7, 0, 1, 1),
    opacity 0.4s ease;
}

/* ---- Snackbar ---- */
#cb-snack {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 9999;
  background: rgba(14, 13, 12, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  pointer-events: none;
  touch-action: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
}

@media (max-width: 520px) {
  #cb-snack {
    white-space: normal;
    flex-wrap: wrap;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    bottom: 16px;
    width: calc(100% - 32px);
  }
  #cb-snack.cb-visible {
    transform: translateX(-50%) translateY(0);
  }
  #cb-snack-text {
    flex: 1;
    min-width: 0;
  }
}

#cb-snack.cb-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: none;
  touch-action: none;
}

#cb-snack.cb-visible #cb-snack-reset {
  pointer-events: all;
  touch-action: auto;
}

#cb-snack-indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7eb87e;
  flex-shrink: 0;
}

#cb-snack-indicator.rejected {
  background: #c47a7a;
}

#cb-snack-indicator.custom {
  background: #7ab4c4;
}

#cb-snack-text {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ffffff;
}

#cb-snack-reset {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ffffff;
  padding: 0;
  margin-left: 6px;
  transition: color 0.2s;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}

#cb-snack-reset:hover {
  color: #ffffff;
  text-decoration-color: #ffffff;
}

/* ---- Blocked external content ---- */
.cb-blocked {
  background: #0e0d0c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  gap: 16px;
  min-height: 200px;
  text-align: center;
  box-sizing: border-box;
  width: 100%;
}

.cb-blocked-label {
  font-size: inherit;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #ffffff;
}

.cb-blocked-hint {
  font-size: inherit;
  font-weight: 300;
  color: #ffffff;
  margin: 0;
  max-width: 320px;
  line-height: 1.6;
}

.cb-blocked-unlock {
  margin-top: 8px;
  padding: 10px 24px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-size: inherit;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.cb-blocked-unlock:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
}

.cb-blocked-small {
  display: inline-flex;
  align-items: center;
  background: rgba(14, 13, 12, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  gap: 8px;
}

.cb-blocked-hint-small {
  font-size: inherit;
  font-weight: 400;
  letter-spacing: 1px;
  color: #ffffff;
  white-space: nowrap;
}

.cb-blocked-unlock-inline {
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.4);
  color: #ffffff;
  font-size: inherit;
  font-weight: 500;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s;
}

.cb-blocked-unlock-inline:hover {
  border-color: #ffffff;
}

/* ---- Responsive ---- */
@media (max-width: 680px) {
  /* Banner inherits font and size settings */
#cb-overlay, #cb-overlay * {
  font-family: inherit !important;
  color: #ffffff !important;
}
#cb-overlay .cb-prefs-panel * {
  font-size: inherit;
}
#cb-overlay {
  font-size: 14px;
}

.cb-inner {
    grid-template-columns: 1fr;
    padding: 24px 20px;
    gap: 24px;
  }

  .cb-actions {
    flex-direction: row;
    min-width: 0;
    width: 100%;
    margin-left: 0;
    padding: 0;
  }

  .cb-btn {
    flex: 1;
    padding: 12px 8px;
    font-size: 10px;
    letter-spacing: 2px;
  }

  #cb-banner {
    margin-bottom: 0;
    padding: 0 16px;
  }
}

/* ---- Preferences Panel ---- */
.cb-prefs-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cb-prefs-panel.cb-prefs-open {
  max-height: 600px;
}

.cb-prefs-inner {
  padding: 32px 32px 12px;
  background: rgba(14, 13, 12, 0.97) !important;
}

.cb-prefs-title {
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 10px;
}

.cb-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cb-toggle-row:last-of-type {
  border-bottom: none;
}

.cb-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.cb-toggle-label {
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ffffff;
}

.cb-toggle-desc {
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.65;
}

/* Toggle Switch */
.cb-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.cb-toggle-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cb-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cb-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  transition: background 0.3s ease;
}

.cb-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.cb-toggle input:checked + .cb-toggle-slider {
  background: #e8e3dc;
}

.cb-toggle input:checked + .cb-toggle-slider::before {
  transform: translateX(18px);
  background: #0c0c0c;
}

/* Save Button */
.cb-btn-save {
  margin-top: 20px;
  display: block;
  width: 100%;
  padding: 16px 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff !important;
  font-size: 11px !important;
  font-family: inherit !important;
  font-weight: 500 !important;
  letter-spacing: 3px !important;
  text-transform: uppercase !important;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  box-sizing: border-box;
  line-height: normal !important;
  -webkit-appearance: none;
  appearance: none;
}

.cb-btn-save:hover {
  border-color: rgba(255, 255, 255, 0.9) !important;
  color: #ffffff !important;
  background: transparent !important;
}

@media (max-width: 680px) {
  .cb-prefs-inner {
    padding: 32px 20px 12px;
  }
  .cb-toggle-row {
    gap: 16px;
  }
}
