/*
 * Cookie Consent: neutral styles. A theme restyles the banner by setting these custom properties
 * on :root (or on .cookie-consent); the rules themselves need no overriding.
 */
.cookie-consent {
  --cookie-consent-background: #fff;
  --cookie-consent-text: #1f2328;
  --cookie-consent-muted: #59636e;
  --cookie-consent-border: #d1d9e0;
  --cookie-consent-accent: #1f6feb;
  --cookie-consent-accent-hover: #1158c7;
  --cookie-consent-accent-text: #fff;
  --cookie-consent-radius: 12px;
  --cookie-consent-button-radius: 999px;
  --cookie-consent-font: inherit;
  --cookie-consent-heading-font: inherit;
  --cookie-consent-z-index: 2147483000;

  /* Not modal: no backdrop, and only the card itself catches clicks; the page stays usable. */
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--cookie-consent-z-index);
  display: flex;
  justify-content: center;
  padding: 8px;
  pointer-events: none;
  font-family: var(--cookie-consent-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--cookie-consent-text);
}

.cookie-consent[hidden],
.cookie-consent [hidden] {
  display: none !important;
}

.cookie-consent__card {
  box-sizing: border-box;
  width: 100%;
  max-width: 28rem;
  max-height: 80dvh;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--cookie-consent-border);
  border-radius: var(--cookie-consent-radius);
  background: var(--cookie-consent-background);
  box-shadow: 0 10px 40px rgb(0 0 0 / 0.18);
  outline: none;
  pointer-events: auto;
  animation: cookie-consent-in 0.35s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent__card {
    animation: none;
  }
}

@keyframes cookie-consent-in {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
}

.cookie-consent__title {
  margin: 0;
  font-family: var(--cookie-consent-heading-font);
  font-size: 18px;
  line-height: 1.25;
  color: inherit;
}

.cookie-consent__body,
.cookie-consent__description,
.cookie-consent__partners {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--cookie-consent-muted);
}

.cookie-consent__details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.cookie-consent__category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cookie-consent__label {
  margin: 0;
  font-weight: 600;
}

.cookie-consent__description {
  margin-top: 2px;
}

.cookie-consent__always {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--cookie-consent-muted);
}

.cookie-consent__switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  cursor: pointer;
}

.cookie-consent__switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cookie-consent__switch span {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--cookie-consent-border);
  transition: background-color 0.15s;
}

.cookie-consent__switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform 0.15s;
}

.cookie-consent__switch input:checked + span {
  background: var(--cookie-consent-accent);
}

.cookie-consent__switch input:checked + span::after {
  transform: translateX(20px);
}

.cookie-consent__switch input:focus-visible + span {
  outline: 2px solid var(--cookie-consent-accent);
  outline-offset: 2px;
}

.cookie-consent__buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.cookie-consent__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid transparent;
  border-radius: var(--cookie-consent-button-radius);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.cookie-consent__button--primary {
  background: var(--cookie-consent-accent);
  color: var(--cookie-consent-accent-text);
}

.cookie-consent__button--primary:hover {
  background: var(--cookie-consent-accent-hover);
}

.cookie-consent__button--secondary {
  border-color: var(--cookie-consent-border);
  background: var(--cookie-consent-background);
  color: var(--cookie-consent-text);
}

.cookie-consent__button--secondary:hover {
  border-color: var(--cookie-consent-accent);
  color: var(--cookie-consent-accent);
}

.cookie-consent__save {
  grid-column: 1 / -1;
}

.cookie-consent__button:focus-visible,
.cookie-consent__link:focus-visible {
  outline: 2px solid var(--cookie-consent-accent);
  outline-offset: 2px;
}

.cookie-consent__links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 8px 0 0;
  font-size: 12px;
}

.cookie-consent__link {
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.cookie-consent__link:hover {
  color: var(--cookie-consent-accent);
}

/* From tablet width up: one strip across the foot of the screen, text left, buttons right. */
@media (min-width: 640px) {
  .cookie-consent {
    padding: 16px;
  }

  .cookie-consent__card {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    max-width: 64rem;
    padding: 20px;
  }

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

  .cookie-consent__body {
    font-size: 14px;
  }

  .cookie-consent__actions {
    flex-shrink: 0;
    width: 18rem;
  }
}

/* The plugin's own footer button, for themes that do not print it themselves. */
.cookie-consent-footer {
  margin: 16px;
  text-align: center;
  font-size: 13px;
}

.cookie-consent-settings-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
