/* ==========================================================================
   Cookie Consent Banner — consent.css
   Floating card at bottom of screen.
   Matches project design system: purple #6255ae / orange #ff6d34
   ========================================================================== */

/* ── Wrapper: slides up from bottom ── */
#cb {
  position: fixed;
  bottom: 24px;
  left: 50%;
  width: calc(100% - 48px);
  max-width: 520px;
  z-index: 9999;

  /* hidden initial state */
  transform: translateX(-50%) translateY(calc(100% + 40px));
  opacity: 0;
  pointer-events: none;

  transition:
    transform 0.42s cubic-bezier(0.34, 1.4, 0.64, 1),
    opacity   0.3s ease;
}

#cb.cb--in {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#cb.cb--out {
  transform: translateX(-50%) translateY(calc(100% + 40px));
  opacity: 0;
  pointer-events: none;
}

/* ── Card ── */
.cb-card {
  background: #ffffff;
  border-top: 4px solid #6255ae;
  box-shadow:
    0 4px 6px  rgba(0, 0, 0, 0.06),
    0 24px 56px rgba(98, 85, 174, 0.22);
  padding: 24px 24px 16px;
}

/* ── Header ── */
.cb-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.cb-icon {
  font-size: 22px;
  line-height: 1;
}

.cb-title {
  font-family: 'Source Code Pro', monospace;
  font-size: 16px;
  font-weight: 700;
  color: #1e1f1e;
  margin: 0;
}

/* ── Description ── */
.cb-desc {
  font-size: 13px;
  line-height: 1.65;
  color: #6b6b6b;
  margin-bottom: 20px;
}

/* ── Action buttons ── */
.cb-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cb-btn {
  padding: 10px 16px;
  min-height: 40px;
  font-family: 'Prompt', sans-serif;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition:
    background   0.2s ease,
    border-color 0.2s ease,
    color        0.2s ease,
    box-shadow   0.2s ease;
  outline: none;
  line-height: 1;
  white-space: nowrap;
}

.cb-btn:focus-visible {
  outline: 3px solid #ff6d34;
  outline-offset: 2px;
}

/* Accept All */
.cb-btn--accept {
  background: #6255ae;
  color: #ffffff;
  flex: 1;
  box-shadow: 0 4px 12px rgba(98, 85, 174, 0.35);
}
.cb-btn--accept:hover {
  background: #4e429a;
  box-shadow: 0 6px 18px rgba(98, 85, 174, 0.5);
}

/* Reject All */
.cb-btn--reject {
  background: #ffffff;
  color: #1e1f1e;
  border-color: rgba(30, 31, 30, 0.2);
  flex: 1;
}
.cb-btn--reject:hover {
  border-color: #6255ae;
  color: #6255ae;
}

/* Customize */
.cb-btn--customize {
  background: transparent;
  color: #6255ae;
  border-color: rgba(98, 85, 174, 0.35);
  flex: 0 0 auto;
}
.cb-btn--customize:hover {
  background: #f0eeff;
}

/* Save Preferences */
.cb-save-row {
  margin-top: 10px;
}

.cb-save-row[hidden] { display: none; }

.cb-btn--save {
  width: 100%;
  background: #ff6d34;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 109, 52, 0.3);
}
.cb-btn--save:hover {
  background: #e85a20;
  box-shadow: 0 6px 18px rgba(255, 109, 52, 0.45);
}

/* ── Customize panel ── */
.cb-customize {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(30, 31, 30, 0.1);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cb-customize[hidden] { display: none; }

.cb-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cb-toggle-info {
  flex: 1;
  min-width: 0;
}

.cb-toggle-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1e1f1e;
  margin-bottom: 2px;
}

.cb-toggle-info span {
  display: block;
  font-size: 12px;
  color: #6b6b6b;
  line-height: 1.4;
}

/* ── Toggle switch ── */
.cb-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

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

.cb-slider {
  position: absolute;
  inset: 0;
  background: #d1d1d6;
  border-radius: 12px;
  transition: background 0.2s ease;
}

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

.cb-switch input:checked + .cb-slider {
  background: #6255ae;
}

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

.cb-switch input:focus-visible + .cb-slider {
  outline: 3px solid #ff6d34;
  outline-offset: 2px;
}

/* Functional — always on, visually locked */
.cb-switch--locked {
  cursor: not-allowed;
  opacity: 0.65;
}

.cb-switch--locked .cb-slider {
  background: #6255ae;
}

/* ── Footer ── */
.cb-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(30, 31, 30, 0.08);
  text-align: center;
}

.cb-settings-link {
  font-size: 11px;
  color: #a0a0a0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}
.cb-settings-link:hover {
  color: #6255ae;
}

/* ── Footer banner "Cookie Settings" link ── */
.footer-cookie-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}
.footer-cookie-link:hover {
  color: #ff6d34;
}

/* ── Mobile: full-width bar at bottom ── */
@media (max-width: 520px) {
  #cb {
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    transform: translateY(calc(100% + 8px));
  }

  #cb.cb--in  { transform: translateY(0); }
  #cb.cb--out { transform: translateY(calc(100% + 8px)); }

  .cb-card {
    padding: 20px 16px 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .cb-btn--accept,
  .cb-btn--reject    { flex: 1 1 calc(50% - 4px); }
  .cb-btn--customize { flex: 0 0 100%; }
}
