/* Cookie consent banner and preferences modal — OurTab theme tokens */

.cookie-consent-modal.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 29, 46, 0.35);
  z-index: 1090;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

html[data-theme="dark"] .cookie-consent-modal.modal-backdrop {
  background: rgba(6, 14, 32, 0.62);
}

.cookie-consent-modal.modal-backdrop.open {
  display: flex;
}

.cookie-consent-modal__dialog.modal {
  background: var(--surface, #ffffff);
  border-radius: var(--radius, 12px);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  color: var(--text, #1a1d2e);
}

.cookie-consent-modal__dialog .modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.cookie-consent-modal__dialog .modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  flex: 1;
}

.cookie-consent-modal__dialog .modal-close-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--surface-alt, #f0f2f7);
  color: var(--muted, #7a7f99);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.cookie-consent-modal__dialog .modal-close-btn:hover {
  background: var(--surface-hover, #e8eaef);
  color: var(--text, #1a1d2e);
}

.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1080;
  background: var(--surface, #ffffff);
  border-top: 1px solid var(--border, rgba(26, 29, 46, 0.1));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
  padding: 1rem var(--page-inline, 20px);
}

.cookie-consent-banner[hidden] {
  display: none;
}

.cookie-consent-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.cookie-consent-banner__text {
  flex: 1 1 320px;
  color: var(--text, #1a1d2e);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.cookie-consent-banner__text a {
  color: var(--accent, #5b6af0);
  text-decoration: underline;
}

.cookie-consent-banner__text a:hover {
  opacity: 0.85;
}

.cookie-consent-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 0 1 auto;
}

.cookie-consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s;
}

.cookie-consent-btn:active {
  transform: scale(0.98);
}

.cookie-consent-btn--primary {
  border: none;
  background: linear-gradient(135deg, var(--primary, #4f5dde) 0%, var(--primary-container, #4a57d4) 100%);
  color: var(--on-primary, #ffffff);
}

.cookie-consent-btn--primary:hover {
  opacity: 0.92;
}

.cookie-consent-btn--outline {
  border: 1.5px solid var(--border, rgba(26, 29, 46, 0.1));
  background: var(--surface-alt, #f0f2f7);
  color: var(--text, #1a1d2e);
}

.cookie-consent-btn--outline:hover {
  background: var(--surface-hover, #e8eaef);
}

.cookie-consent-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border, rgba(26, 29, 46, 0.1));
}

.cookie-consent-category:last-of-type {
  border-bottom: none;
}

.cookie-consent-category__info {
  flex: 1;
}

.cookie-consent-category__title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text, #1a1d2e);
}

.cookie-consent-category__description {
  color: var(--muted, #7a7f99);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.45;
}

.cookie-consent-category__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted, #7a7f99);
  margin-bottom: 0.35rem;
}

.cookie-consent-category__toggle {
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.cookie-consent-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

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

.cookie-consent-switch__track {
  position: relative;
  display: block;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--surface-container-low, #ebecef);
  border: 1px solid var(--border, rgba(26, 29, 46, 0.1));
  transition: background 0.2s;
}

.cookie-consent-switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface, #ffffff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.cookie-consent-switch input:checked + .cookie-consent-switch__track {
  background: var(--primary, #4f5dde);
  border-color: var(--primary, #4f5dde);
}

.cookie-consent-switch input:checked + .cookie-consent-switch__track::after {
  transform: translateX(18px);
}

.cookie-consent-switch input:focus-visible + .cookie-consent-switch__track {
  outline: 2px solid var(--accent, #5b6af0);
  outline-offset: 2px;
}

.cookie-consent-modal {
  z-index: 1090;
}

.cookie-consent-modal__dialog {
  max-width: 480px;
  width: 100%;
}

.cookie-consent-modal__intro {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted, #7a7f99);
  margin: 0 0 0.5rem;
}

.cookie-consent-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, rgba(26, 29, 46, 0.1));
}

.cookie-preferences-link {
  cursor: pointer;
}

.cookie-preferences-trigger {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 1070;
  border: 1px solid var(--border, rgba(26, 29, 46, 0.1));
  background: var(--surface, #ffffff);
  color: var(--text, #1a1d2e);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  line-height: 1.2;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow, 0 4px 24px rgba(26, 29, 46, 0.08));
}

.cookie-preferences-trigger:hover {
  background: var(--surface-hover, #e8eaef);
}

.cookie-preferences-trigger[hidden] {
  display: none;
}

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

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

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

  .cookie-consent-modal__actions {
    flex-direction: column-reverse;
  }

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