/* Cookie consent — bottom-left on desktop */
.cookie-consent {
  position: fixed;
  z-index: 9999;
  left: 1.25rem;
  bottom: 1.25rem;
  width: min(100% - 2rem, 26.5rem);
  background: var(--white, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(15, 23, 42, 0.12));
  padding: 1.35rem 1.35rem 1.15rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  animation: cookie-consent-in 0.35s ease-out;
}

.cookie-consent[hidden] {
  display: none !important;
}

@keyframes cookie-consent-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cookie-consent-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy, #121e31);
  margin: 0 0 0.65rem;
  letter-spacing: -0.01em;
}

.cookie-consent-text {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted, #64748b);
  margin: 0 0 1rem;
}

.cookie-consent-text a {
  color: var(--blue, #0047bb);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent-text a:hover {
  color: var(--blue-dark, #003a99);
}

.cookie-consent-prefs {
  display: none;
  margin-bottom: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border, #e2e8f0);
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.cookie-consent.is-prefs-open .cookie-consent-prefs {
  display: block;
}

.cookie-consent-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
}

.cookie-consent-option + .cookie-consent-option {
  border-top: 1px solid #f1f5f9;
}

.cookie-consent-option-info strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text, #1e293b);
  margin-bottom: 0.2rem;
}

.cookie-consent-option-info span {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-muted, #64748b);
}

.cookie-consent-toggle {
  flex-shrink: 0;
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
}

.cookie-consent-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cookie-consent-toggle-track {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.cookie-consent-toggle-track::after {
  content: '';
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  left: 0.18rem;
  top: 0.18rem;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.cookie-consent-toggle input:checked + .cookie-consent-toggle-track {
  background: var(--green, #22c55e);
}

.cookie-consent-toggle input:checked + .cookie-consent-toggle-track::after {
  transform: translateX(1.25rem);
}

.cookie-consent-toggle input:disabled + .cookie-consent-toggle-track {
  background: #94a3b8;
  cursor: not-allowed;
  opacity: 0.85;
}

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cookie-consent-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.cookie-consent-btn:focus-visible {
  outline: 2px solid var(--blue, #0047bb);
  outline-offset: 2px;
}

.cookie-consent-btn-prefs {
  background: #fff;
  color: var(--text-muted, #64748b);
  border-color: var(--border, #e2e8f0);
}

.cookie-consent-btn-prefs:hover {
  border-color: var(--blue, #0047bb);
  color: var(--blue, #0047bb);
}

.cookie-consent-btn-essential {
  background: #f1f5f9;
  color: var(--text, #1e293b);
  border-color: #e2e8f0;
}

.cookie-consent-btn-essential:hover {
  background: #e2e8f0;
}

.cookie-consent-btn-accept {
  background: var(--green, #22c55e);
  color: #fff;
  border-color: var(--green, #22c55e);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.cookie-consent-btn-accept:hover {
  background: #16a34a;
  border-color: #16a34a;
}

.cookie-consent-btn-save {
  display: none;
  width: 100%;
  margin-top: 0.5rem;
  background: var(--blue, #0047bb);
  color: #fff;
  border-color: var(--blue, #0047bb);
}

.cookie-consent-btn-save:hover {
  background: var(--blue-dark, #003a99);
}

.cookie-consent.is-prefs-open .cookie-consent-btn-save {
  display: block;
}

.cookie-consent.is-prefs-open .cookie-consent-actions .cookie-consent-btn-accept {
  flex: 1 1 100%;
}

@media (max-width: 640px) {
  .cookie-consent {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: auto;
  }

  .cookie-consent-actions {
    flex-direction: column;
  }

  .cookie-consent-btn {
    width: 100%;
    flex: none;
  }
}

@media (min-width: 1024px) {
  .cookie-consent {
    left: 1.5rem;
    bottom: 1.5rem;
  }
}
