/* Cookie banner + settings dialog. */

.cookie {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  max-width: 560px;
  background: var(--bg-light);
  border: 1px solid var(--accent-lo);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 30px 60px -20px color-mix(in srgb, black 80%, transparent);

  &[hidden] {
    display: none;
  }

  & p {
    font-size: 0.88rem;
    color: var(--text-soft);
  }
}

.cookie__acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;

  & .btn {
    padding: 0.7em 1em;
    font-size: 0.86rem;
  }
}

.cookie .cookie__acts {
  margin-top: 0;
}

dialog.cset {
  background: var(--bg-light);
  color: var(--text-color);
  border: 1px solid var(--accent-lo);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 32px);
  width: min(560px, calc(100vw - 32px));

  &::backdrop {
    background: color-mix(in srgb, var(--bg-color) 70%, transparent);
  }
}

.opt {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);

  & p {
    margin: 4px 0 0;
    font-size: 0.84rem;
    color: var(--muted-hi);
  }
}

.sw {
  appearance: none;
  -webkit-appearance: none;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--border-color);
  position: relative;
  cursor: pointer;
  flex: none;
  transition: background 0.2s;

  &::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-color);
    transition: transform 0.25s var(--ease);
  }

  &:checked {
    background: var(--accent);
  }

  &:checked::after {
    transform: translateX(20px);
  }

  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
}

.gpc {
  font-size: 0.84rem;
  color: var(--accent-hi);
  margin-top: 12px;
}
