/* stylelint-disable color-named */

.cookiebanner {
  position: relative;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 500ms ease-in-out;
  z-index: 10001;
  font-size: 18px;
  line-height: 24px;
       
  &.is-open {
    grid-template-rows: 1fr;
  }
}

.cookiebanner .sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.cookiebanner__wrapper {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  hyphens: auto;
  background-color: #e6e8e9;
}

.cookiebanner__inner {
  width: 90%;
  max-width: 1240px;
  margin: 60px 0;
  padding: 40px;
  background-color: white;
}

.cookiebanner ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.cookiebanner__heading {
  display: block;
  margin-top: unset;
  margin-bottom: 20px;
}

.cookiebanner--tablist .cookiebanner__tablist {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5em;
  margin: 30px 0;
}

.cookiebanner--tablist .cookiebanner__tablist-item {
  display: flex;
  gap: 0.5em;
  align-items: center;
}

.cookiebanner--tablist .cookiebanner__tabpanel {
  display: none;

  &[aria-hidden='false'] {
    display: block;
  }
}

.cookiebanner input[type='checkbox'] {
  ~ label {
    cursor: pointer;
    position: relative;
    display: inline-block;
    margin: 0;
  }

  &:checked {
    ~ label .cookiebanner__checkmark {
      background-color: black;
      border-color: black;
    }

    ~ label .cookiebanner__checkmark:before {
      transform: scale(1);
    }
  }

  &:disabled {
    ~ label .cookiebanner__checkmark {
      cursor: not-allowed;
      background-color: grey;
      border-color: grey;
    }
  }

  &:hover:not(:disabled),
  &.focus-visible:not(:disabled) {
    ~ label .cookiebanner__checkmark {
      color: black;
    }
  }

  &:focus-visible:not(:disabled) {
    ~ label .cookiebanner__checkmark {
      @include transition;

      outline: 0.1em dashed black;
      outline-offset: 0.2em;
    }
  }

  &:checked:not(:disabled) {
    ~ label .cookiebanner__checkmark {
      background-color: black;
      border-color: black;
    }
  }
}

.cookiebanner__checkmark {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: 1.1em;
  height: 1.1em;
  background-color: white;
  border: 2px solid black;
}

.cookiebanner__checkmark::before {
  content: "";
  transform-origin: bottom left;
  transform: scale(0);
  display: block;
  width: 100%;
  height: 100%;
  clip-path: polygon(10% 48%, 39% 79%, 90% 19%, 95% 24%, 39% 90%, 5% 53%);
  box-shadow: inset 1em 1em white;
  transition: 120ms transform ease-in-out;
}

.cookiebanner__cookie-label {
  display: flex;
  gap: 0.5em;
  align-items: center;
  font-weight: bold;
  white-space: nowrap;
  font-size: 18px;
  line-height: 24px;
  background: none;
  cursor: pointer !important;

  &:hover,
  &[aria-selected="true"] {
    color: black;
  }

  &[aria-selected="true"] {
    text-decoration: underline;
  }

  span {
    text-align: left;
  }

  &:after {
    content: 'i';
    display: block;
    flex-shrink: 0;
    width: 1.2em;
    height: 1.2em;
    color: white;
    background-color: black;
    border-radius: 50%;
  }
}

.cookiebanner__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
}

.cookiebanner__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;

  .button {
    position: relative;
    background: #0778a5;
    font-size: 24px;
    color: #fff;
    text-align: left;
    line-height: 32px;
    padding: 14px 45px 14px 25px;
    display: block;
    font-weight: bold;
    cursor: pointer;
    
    &:after {
      font-size: 22px;
      position: absolute;
      right: 13px;
      top: 18px;
      content: 'c';
      font-family: 'Icons';
    }
  }
}

.cookiebanner__links a {
  text-decoration: underline;
  font-weight: bold;
}

.cookiebanner-open-button {
  background: none;
  color: white;
  cursor: pointer !important;
  font-size: 16px;
}
