/* ==========================================================================
   Cookie Consent — banner + preferences panel
   Standalone CSS (no SCSS), uses CSS custom properties from design system.
   ========================================================================== */

/* ------------------------------------------------------------------
   Banner (fixed bottom bar)
   ------------------------------------------------------------------ */

.cc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--ink);
  color: var(--dust);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.cc-banner--visible {
  transform: translateY(0);
}

.cc-banner__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.cc-banner__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  flex: 1;
}

.cc-banner__text a {
  color: var(--chalk);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-banner__text a:hover {
  color: var(--sage);
}

.cc-banner__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ------------------------------------------------------------------
   Shared button styles
   ------------------------------------------------------------------ */

.cc-btn {
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
  line-height: 1;
}

.cc-btn--primary {
  background: var(--sage);
  color: var(--chalk);
  border: 1px solid var(--sage);
  padding: 10px 20px;
}

.cc-btn--primary:hover {
  background: #5a6b4f;
  border-color: #5a6b4f;
}

.cc-btn--secondary {
  background: transparent;
  color: var(--dust);
  border: 1px solid var(--mist);
  padding: 10px 20px;
}

.cc-btn--secondary:hover {
  border-color: var(--chalk);
  color: var(--chalk);
}

.cc-btn--link {
  background: none;
  border: none;
  color: var(--mist);
  padding: 10px 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-btn--link:hover {
  color: var(--chalk);
}

/* ------------------------------------------------------------------
   Overlay + Preferences panel
   ------------------------------------------------------------------ */

.cc-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(26, 26, 24, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cc-overlay--visible {
  opacity: 1;
}

.cc-panel {
  background: var(--ink);
  color: var(--dust);
  border-radius: 8px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  outline: none;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.cc-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.cc-panel__title {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--chalk);
  margin: 0;
}

.cc-panel__close {
  background: none;
  border: none;
  color: var(--mist);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s;
}

.cc-panel__close:hover {
  color: var(--chalk);
}

.cc-panel__body {
  padding: 16px 24px 8px;
  overflow-y: auto;
  flex: 1;
}

.cc-panel__intro {
  font-size: 0.8125rem;
  line-height: 1.55;
  margin: 0 0 20px;
}

/* ------------------------------------------------------------------
   Category rows
   ------------------------------------------------------------------ */

.cc-panel__category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cc-panel__category-info {
  flex: 1;
}

.cc-panel__category-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--chalk);
  margin-bottom: 2px;
}

.cc-panel__badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--sage);
  background: rgba(107, 124, 94, 0.15);
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 4px;
}

.cc-panel__category-desc {
  display: block;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--mist);
  margin-top: 4px;
}

/* ------------------------------------------------------------------
   Toggle switch
   ------------------------------------------------------------------ */

.cc-toggle {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 2px;
}

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

.cc-toggle__track {
  width: 42px;
  height: 24px;
  background: var(--dust);
  border-radius: 12px;
  position: relative;
  transition: background-color 0.25s;
}

.cc-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--ink);
  border-radius: 50%;
  transition: transform 0.25s;
}

.cc-toggle input:checked + .cc-toggle__track {
  background: var(--sage);
}

.cc-toggle input:checked + .cc-toggle__track .cc-toggle__thumb {
  transform: translateX(18px);
  background: var(--chalk);
}

.cc-toggle input:focus-visible + .cc-toggle__track {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
}

/* Disabled (essential category) */
.cc-toggle--disabled {
  cursor: default;
  opacity: 0.5;
}

/* ------------------------------------------------------------------
   Panel footer
   ------------------------------------------------------------------ */

.cc-panel__footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ------------------------------------------------------------------
   Responsive: stack banner on mobile
   ------------------------------------------------------------------ */

@media (max-width: 575.98px) {
  .cc-banner__inner {
    flex-direction: column;
    text-align: center;
    padding: 16px 20px;
    gap: 16px;
  }

  .cc-banner__actions {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: 8px;
  }

  .cc-btn--primary,
  .cc-btn--secondary {
    flex: 1 1 auto;
    min-width: 120px;
  }

  .cc-btn--link {
    width: 100%;
    text-align: center;
  }

  .cc-panel__footer {
    flex-direction: column;
  }

  .cc-panel__footer .cc-btn {
    width: 100%;
    text-align: center;
  }

  .cc-overlay {
    padding: 12px;
    align-items: flex-end;
  }
}
