/* Cookie consent banner and preferences modal */

.cookie-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  padding: 20px;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--line, #e2e8e5);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(12px);
  transform: translateY(110%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-consent-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.cookie-consent-banner__inner {
  width: min(100%, var(--max, 1280px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cookie-consent-banner__content {
  flex: 1;
  min-width: 0;
}

.cookie-consent-banner__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #1a1a1a);
}

.cookie-consent-banner__text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted, #5e6d68);
  line-height: 1.5;
}

.cookie-consent-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 20px;
  border-radius: 99px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cookie-consent-btn:focus-visible {
  outline: 2px solid var(--green, #0E7955);
  outline-offset: 2px;
}

.cookie-consent-btn--primary {
  background: var(--green, #0E7955);
  color: #fff;
}

.cookie-consent-btn--primary:hover {
  background: var(--green-hover, #0a5c40);
}

.cookie-consent-btn--secondary {
  background: var(--bg, #ffffff);
  color: var(--text, #1a1a1a);
  border-color: var(--line-strong, #c8d4ce);
}

.cookie-consent-btn--secondary:hover {
  border-color: var(--green, #0E7955);
  color: var(--green, #0E7955);
}

.cookie-consent-btn--ghost {
  background: transparent;
  color: var(--green-text, #0b6848);
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: auto;
  padding: 8px 12px;
}

.cookie-consent-btn--ghost:hover {
  color: var(--green-hover, #0a5c40);
}

.cookie-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(26, 26, 26, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cookie-consent-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.cookie-consent-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cookie-consent-modal.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cookie-consent-modal__dialog {
  width: min(100%, 560px);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--panel, #ffffff);
  border: 1px solid var(--line, #e2e8e5);
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow, 0 12px 32px rgba(0, 0, 0, 0.06));
}

.cookie-consent-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 0;
}

.cookie-consent-modal__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.cookie-consent-modal__intro {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--muted, #5e6d68);
}

.cookie-consent-modal__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-soft, #f9fafa);
  color: var(--text, #1a1a1a);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.cookie-consent-modal__close:hover {
  background: var(--green-light, rgba(14, 121, 85, 0.08));
  color: var(--green, #0E7955);
}

.cookie-consent-modal__close:focus-visible {
  outline: 2px solid var(--green, #0E7955);
  outline-offset: 2px;
}

.cookie-consent-modal__body {
  padding: 24px;
}

.cookie-consent-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line, #e2e8e5);
}

.cookie-consent-category:last-child {
  border-bottom: 0;
}

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

.cookie-consent-category__name {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
}

.cookie-consent-category__desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted, #5e6d68);
  line-height: 1.5;
}

.cookie-consent-toggle {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 28px;
}

.cookie-consent-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.cookie-consent-toggle input:disabled {
  cursor: not-allowed;
}

.cookie-consent-toggle__track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 99px;
  background: var(--line-strong, #c8d4ce);
  transition: background 0.2s ease;
}

.cookie-consent-toggle__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.cookie-consent-toggle input:checked + .cookie-consent-toggle__track {
  background: var(--green, #0E7955);
}

.cookie-consent-toggle input:checked + .cookie-consent-toggle__track::after {
  transform: translateX(20px);
}

.cookie-consent-toggle input:focus-visible + .cookie-consent-toggle__track {
  outline: 2px solid var(--green, #0E7955);
  outline-offset: 2px;
}

.cookie-consent-toggle input:disabled + .cookie-consent-toggle__track {
  opacity: 0.65;
}

.cookie-consent-modal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  padding: 0 24px 24px;
}

.cookie-settings-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--soft, #8a9994);
  cursor: pointer;
  text-decoration: none;
}

.footer-bottom-links .cookie-settings-link {
  font-size: 0.85rem;
}

.cookie-settings-link:hover {
  color: var(--green, #0E7955);
}

.cookie-settings-link:focus-visible {
  outline: 2px solid var(--green, #0E7955);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .cookie-consent-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-consent-banner__actions {
    flex-direction: column;
  }

  .cookie-consent-btn {
    width: 100%;
  }

  .cookie-consent-modal__footer {
    flex-direction: column;
  }

  .cookie-consent-modal__footer .cookie-consent-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent-banner,
  .cookie-consent-overlay,
  .cookie-consent-modal,
  .cookie-consent-toggle__track,
  .cookie-consent-toggle__track::after {
    transition: none;
  }
}
