.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  padding: 0 clamp(0.5rem, 2vw, 0.75rem) clamp(0.5rem, 2vw, 0.75rem);
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.35s ease,
    opacity 0.35s ease;
}

.cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  /* Let visitors use the page; only the dialog captures clicks. */
  pointer-events: none;
}

.cookie-banner__dialog {
  position: relative;
  max-width: var(--max, 1180px);
  margin: 0 auto;
  padding: clamp(0.75rem, 2vw, 1rem) clamp(0.9rem, 2.5vw, 1.25rem);
  border-radius: 14px;
  background: rgba(14, 16, 25, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.cookie-banner__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.65rem, 2vw, 1rem);
}

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

.cookie-banner__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  line-height: 1.45;
}

.cookie-banner__text a {
  color: #a66cff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner__text a:hover {
  color: #c49aff;
}

.cookie-banner__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-banner__btn {
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.cookie-banner__btn:hover {
  transform: translateY(-1px);
}

.cookie-banner__btn--settings {
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.cookie-banner__btn--settings:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cookie-banner__btn--reject {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.cookie-banner__btn--reject:hover {
  background: rgba(255, 255, 255, 0.12);
}

.cookie-banner__btn--accept {
  color: #fff;
  background: linear-gradient(135deg, #7c3cff, #a66cff 55%, #e052ff);
  box-shadow: 0 10px 28px rgba(123, 60, 255, 0.28);
}

.cookie-banner__btn--accept:hover {
  box-shadow: 0 14px 34px rgba(123, 60, 255, 0.38);
}

.cookie-banner__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.18s ease;
}

.cookie-banner__close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.cookie-banner__close svg {
  width: 14px;
  height: 14px;
}

.cookie-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(5, 7, 13, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.cookie-settings-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.cookie-settings {
  width: min(100%, 520px);
  max-height: min(88vh, 640px);
  overflow: auto;
  padding: 1.5rem;
  border-radius: 20px;
  background: rgba(14, 16, 25, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.55);
}

.cookie-settings__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cookie-settings__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.cookie-settings__desc {
  margin: 0 0 1.25rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
  font-size: 0.94rem;
}

.cookie-settings__group {
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-settings__group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.cookie-settings__group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-settings__group-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.cookie-settings__group-desc {
  margin: 0.45rem 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.88rem;
  line-height: 1.5;
}

.cookie-settings__toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.cookie-settings__toggle-track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.cookie-settings__toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.cookie-settings__toggle input:checked + .cookie-settings__toggle-track {
  background: linear-gradient(135deg, #7c3cff, #a66cff);
}

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

.cookie-settings__toggle input:disabled + .cookie-settings__toggle-track {
  opacity: 0.55;
  cursor: not-allowed;
}

.cookie-settings__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-settings__footer .cookie-banner__btn {
  flex: 1 1 auto;
}

body.cookie-banner-open .sample-audio-fab {
  bottom: calc(clamp(6.5rem, 16vh, 8.5rem) + env(safe-area-inset-bottom, 0px));
}

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

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

  .cookie-banner__btn {
    flex: 1 1 calc(50% - 0.35rem);
    text-align: center;
  }

  .cookie-banner__btn--accept {
    flex-basis: 100%;
  }
}

@media (max-width: 520px) {
  .cookie-banner__actions {
    flex-direction: column;
  }

  .cookie-banner__btn {
    width: 100%;
  }
}
