:root {
  --cookie-accent: #5398ae;
  --cookie-accent-hover: #4789a0;
  --cookie-accent-soft: #f0f7f9;
  --cookie-accent-ring: rgba(83, 152, 174, 0.35);
}

.cookie-consent {
  --cookie-accent: var(--color-teal, #5398ae);
  --cookie-accent-hover: #4789a0;
  --cookie-accent-soft: #f0f7f9;
  --cookie-accent-ring: rgba(83, 152, 174, 0.35);
}

body.cookie-consent-open {
  overflow: hidden;
}

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

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

.cookie-fab:not([hidden]) {
  display: flex !important;
}

.cookie-consent__overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: rgba(0, 0, 0, 0.72);
}

.cookie-consent__dialog {
  position: fixed;
  z-index: 11001;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 2rem));
  max-height: min(90vh, 720px);
  overflow-y: auto;
  padding: 2rem 2rem 1.75rem;
  background: var(--color-white);
  border: 2px solid var(--cookie-accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(83, 152, 174, 0.2);
  text-align: center;
}

.cookie-consent__dialog--settings {
  width: min(480px, calc(100vw - 2rem));
  text-align: left;
  padding: 1.5rem 1.5rem 1.25rem;
}

.cookie-consent__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--cookie-accent-soft);
  border: 2px solid var(--cookie-accent);
  color: var(--cookie-accent);
}

.cookie-consent__icon {
  width: 2rem;
  height: 2rem;
  display: block;
}

.cookie-consent__title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.25;
}

.cookie-consent__title--left {
  text-align: left;
  margin-bottom: 1rem;
}

.cookie-consent__text {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.cookie-consent__text a {
  color: var(--cookie-accent);
  font-weight: 600;
}

.cookie-consent__text a:hover {
  color: var(--cookie-accent-hover);
}

.cookie-consent__actions {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
}

.cookie-consent__actions--intro {
  flex-wrap: wrap;
  justify-content: stretch;
}

.cookie-consent__actions--intro .cookie-consent__btn {
  flex: 1 1 0;
  min-width: min(100%, 8rem);
}

.cookie-consent__actions--stack {
  flex-direction: column;
  margin-top: 1.25rem;
}

.cookie-consent__actions--stack .cookie-consent__btn {
  width: 100%;
}

.cookie-consent__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease;
  text-align: center;
  line-height: 1.25;
}

.cookie-consent__btn--primary {
  background: var(--cookie-accent);
  color: var(--color-white);
  border-color: var(--cookie-accent);
}

.cookie-consent__btn--primary:hover {
  background: var(--cookie-accent-hover);
  border-color: var(--cookie-accent-hover);
}

.cookie-consent__btn--secondary {
  background: var(--cookie-accent);
  color: var(--color-white);
  border-color: var(--cookie-accent);
}

.cookie-consent__btn--secondary:hover {
  background: var(--cookie-accent-hover);
  border-color: var(--cookie-accent-hover);
}

.cookie-consent__categories {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.cookie-category {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  background: var(--cookie-accent-soft);
  transition: border-color 0.15s ease;
}

.cookie-category.is-expanded {
  border-color: var(--cookie-accent);
}

.cookie-category__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cookie-category__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
}

.cookie-category__chevron {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--cookie-accent);
  border-bottom: 2px solid var(--cookie-accent);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.cookie-category.is-expanded .cookie-category__chevron {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.cookie-category__desc {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.cookie-category__body {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(83, 152, 174, 0.25);
}

.cookie-category__empty,
.cookie-category__list {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.cookie-category__list {
  padding-left: 1.1rem;
}

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

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

.cookie-switch__track {
  display: block;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--color-border);
  transition: background 0.2s ease;
  position: relative;
}

.cookie-switch__track::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--color-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.cookie-switch input:checked + .cookie-switch__track {
  background: var(--cookie-accent);
}

.cookie-switch input:focus-visible + .cookie-switch__track {
  box-shadow: 0 0 0 2px var(--cookie-accent-ring);
}

.cookie-switch input:checked + .cookie-switch__track::after {
  transform: translateX(1.25rem);
}

.cookie-switch--readonly {
  cursor: not-allowed;
  opacity: 0.85;
}

.cookie-switch--readonly .cookie-switch__track {
  background: var(--cookie-accent);
}

.cookie-consent__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--cookie-accent-ring);
}

.cookie-fab {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  z-index: 10900;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background-color: #5398ae;
  background-color: var(--color-teal, #5398ae);
  color: #ffffff;
  box-shadow:
    0 4px 18px rgba(83, 152, 174, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.cookie-fab:hover {
  background-color: #4789a0;
  transform: scale(1.06);
  box-shadow:
    0 6px 22px rgba(83, 152, 174, 0.6),
    0 2px 10px rgba(0, 0, 0, 0.18);
}

.cookie-fab__icon {
  width: 1.55rem;
  height: 1.55rem;
  display: block;
  fill: #ffffff;
  color: #ffffff;
}

@media (min-width: 640px) {
  .cookie-consent__actions--intro {
    flex-wrap: nowrap;
  }
}

@media (max-width: 639px) {
  .cookie-consent__actions--intro {
    flex-direction: column;
  }

  .cookie-consent__actions--intro .cookie-consent__btn {
    width: 100%;
    min-width: 100%;
    flex: none;
  }

  .cookie-fab {
    left: 1rem;
    bottom: 1rem;
  }
}
