/* ===================================================
   AkraMap Cookie Consent Bot — cookie-bot.css
   Matches the akra design system:
   Space Grotesk headings, Inter body, earthy greens.
   All variables fall back to hard-coded values for
   safety if :root isn't loaded yet.
   =================================================== */

/* ─── Bottom Banner (Layer 1) ──────────────────────────────────────────── */

.cb-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: var(--surface, #ffffff);
  border-top: 1px solid var(--border, rgba(43, 138, 85, 0.14));
  box-shadow: 0 -8px 32px -4px rgba(20, 36, 24, 0.13);
  border-radius: var(--radius, 16px) var(--radius, 16px) 0 0;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.34, 1.4, 0.64, 1);
  will-change: transform;
}

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

.cb-banner__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 28px 20px;
  max-width: 1040px;
  margin: 0 auto;
}

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

.cb-banner__title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 5px;
}

.cb-banner__icon {
  color: var(--accent, #2b8a55);
  flex-shrink: 0;
}

.cb-banner__title {
  font-family: var(--font-heading, 'Space Grotesk', sans-serif);
  font-size: 1.0rem;
  font-weight: 600;
  color: var(--primary, #142418);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.cb-banner__desc {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.83rem;
  color: var(--muted, #5c7563);
  line-height: 1.5;
}

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

/* ─── Shared Button Styles ─────────────────────────────────────────────── */

.cb-btn {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.845rem;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: var(--radius-sm, 10px);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.cb-btn:focus-visible {
  outline: 2px solid var(--accent, #2b8a55);
  outline-offset: 2px;
}

/* Primary — green fill */
.cb-btn--primary {
  background: #1f6b40;
  color: #ffffff;
}
.cb-btn--primary:hover {
  background: #185534;
  box-shadow: 0 2px 8px rgba(31, 107, 64, 0.28);
}

/* Secondary — soft green background */
.cb-btn--secondary {
  background: var(--bg-alt, #e6efe8);
  color: var(--primary, #142418);
}
.cb-btn--secondary:hover { background: #d5e6d9; }

/* Reject — equal prominence to the primary "accept" button.
   Outlined green: same size and visual weight, no dark-pattern bias. */
.cb-btn--reject {
  background: #ffffff;
  color: #1f6b40;
  border-color: #1f6b40;
}
.cb-btn--reject:hover {
  background: #f0f6f1;
  box-shadow: 0 2px 8px rgba(31, 107, 64, 0.18);
}

/* Ghost — transparent / text-only */
.cb-btn--ghost {
  background: transparent;
  color: var(--muted, #5c7563);
  padding: 9px 12px;
}
.cb-btn--ghost:hover {
  color: var(--primary, #142418);
  background: var(--bg-alt, #e6efe8);
}

/* ─── Settings Modal Overlay (Layer 2) ─────────────────────────────────── */

.cb-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: transparent;
  pointer-events: none;
  transition: background 0.25s ease;
}

.cb-modal-overlay.cb-visible {
  background: rgba(20, 36, 24, 0.45);
  pointer-events: all;
}

.cb-modal {
  background: var(--surface, #ffffff);
  border-radius: var(--radius, 16px);
  box-shadow: 0 24px 56px -8px rgba(20, 36, 24, 0.24);
  width: 520px;
  max-width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  transform: translateY(18px) scale(0.97);
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1),
    opacity   0.22s ease;
  overflow: hidden;
}

.cb-modal-overlay.cb-visible .cb-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ─── Modal Header ─────────────────────────────────────────────────────── */

.cb-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border, rgba(43, 138, 85, 0.12));
  flex-shrink: 0;
}

.cb-modal__title {
  font-family: var(--font-heading, 'Space Grotesk', sans-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary, #142418);
  letter-spacing: -0.025em;
}

.cb-modal__close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--muted, #5c7563);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.cb-modal__close:hover {
  background: var(--bg-alt, #e6efe8);
  color: var(--primary, #142418);
}
.cb-modal__close:focus-visible {
  outline: 2px solid var(--accent, #2b8a55);
  outline-offset: 2px;
}

/* ─── Modal Body ───────────────────────────────────────────────────────── */

.cb-modal__body {
  padding: 22px 24px 12px;
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
}

.cb-modal__intro {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.845rem;
  color: var(--muted, #5c7563);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ─── Consent Categories ───────────────────────────────────────────────── */

.cb-categories {
  display: flex;
  flex-direction: column;
}

.cb-category {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border, rgba(43, 138, 85, 0.1));
}
.cb-category:last-child { border-bottom: none; }

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

.cb-category__name {
  display: block;
  font-family: var(--font-heading, 'Space Grotesk', sans-serif);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary, #142418);
  margin-bottom: 3px;
}

.cb-category__desc {
  display: block;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.78rem;
  color: var(--muted, #5c7563);
  line-height: 1.45;
}

.cb-modal__legal {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border, rgba(43, 138, 85, 0.1));
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.79rem;
  color: var(--muted, #5c7563);
}

.cb-legal-link {
  color: var(--accent, #2b8a55);
  text-decoration: none;
  font-weight: 500;
}
.cb-legal-link:hover { text-decoration: underline; }

/* ─── Toggle Switch ────────────────────────────────────────────────────── */

.cb-toggle {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}

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

.cb-toggle__slider {
  position: absolute;
  inset: 0;
  background: #c8d5ca;
  border-radius: 13px;
  transition: background 0.2s ease;
}

.cb-toggle__slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(20, 36, 24, 0.22);
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.cb-toggle__input:checked + .cb-toggle__slider {
  background: var(--accent, #2b8a55);
}

.cb-toggle__input:checked + .cb-toggle__slider::before {
  transform: translateX(20px);
}

.cb-toggle__input:disabled + .cb-toggle__slider {
  opacity: 0.45;
  cursor: not-allowed;
}

.cb-toggle:has(.cb-toggle__input:disabled) {
  cursor: not-allowed;
}

.cb-toggle__input:focus-visible + .cb-toggle__slider {
  outline: 2px solid var(--accent, #2b8a55);
  outline-offset: 2px;
  border-radius: 13px;
}

/* ─── Modal Footer ─────────────────────────────────────────────────────── */

.cb-modal__footer {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border, rgba(43, 138, 85, 0.12));
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ─── Floating Cookie Settings Button ──────────────────────────────────── */

.cb-fab {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 8990;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface, #ffffff);
  border: 1.5px solid var(--border, rgba(43, 138, 85, 0.2));
  box-shadow: 0 2px 12px rgba(20, 36, 24, 0.11);
  color: var(--muted, #5c7563);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.75);
  transition:
    opacity   0.28s ease,
    transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1),
    background 0.15s ease,
    color      0.15s ease;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.cb-fab.cb-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.cb-fab:hover {
  background: var(--bg-alt, #e6efe8);
  color: var(--accent, #2b8a55);
}

.cb-fab:focus-visible {
  outline: 2px solid var(--accent, #2b8a55);
  outline-offset: 2px;
}

/* ─── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 700px) {
  .cb-banner__inner {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 18px 18px;
    gap: 14px;
  }

  .cb-banner__actions {
    width: 100%;
    gap: 8px;
  }

  .cb-banner__actions .cb-btn {
    flex: 1;
    text-align: center;
    justify-content: center;
    padding: 10px 6px;
  }

  .cb-btn--ghost {
    flex: 0 0 auto;
    font-size: 0.8rem;
    padding: 10px 10px;
  }

  .cb-modal__footer {
    flex-direction: column-reverse;
  }

  .cb-modal__footer .cb-btn {
    width: 100%;
    text-align: center;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .cb-modal__header { padding: 18px 18px 14px; }
  .cb-modal__body   { padding: 18px 18px 10px; }
  .cb-modal__footer { padding: 14px 18px; }
}
