*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.cookie-banner,
.cookie-settings {
  position: fixed;
  right: 34px;
  bottom: 34px;
  width: calc(100% - 68px);
}

.cookie-banner {
  z-index: 1000;
  max-width: 600px;
}

.cookie-settings {
  max-width: 400px;
}

.cookie-settings:not([hidden]) {
  z-index: 1001;
}

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

.cookie-banner__inner,
.cookie-settings__inner {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.cookie-banner__inner {
  padding: 17px 24px 20px 19px;
}

.cookie-banner__title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 5px;
}

.cookie-banner__text {
  font-size: 14px;
  line-height: 1.55;
}

.cookie-banner__link {
  color: rgb(72, 162, 22);
  text-decoration: none;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 30px;
  margin-top: 20px;
}

.cookie-banner__buttons {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.cookie-banner__buttons .btn--primary,
.cookie-settings__footer .btn--primary {
  min-height: 50px;
  padding: 14px 44px;
  font-size: 15px;
}

.cookie-banner__buttons .btn--outline {
  min-height: 35px;
  margin-left: 10px;
  padding: 7px 15px;
  font-size: 13px;
  border-radius: 0;
}

.cookie-banner__settings-link {
  background: none;
  border: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  padding: 12px 28px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn--primary {
  background: rgb(72, 162, 22);
  color: #fff;
}

.btn--outline {
  background: transparent;
  border: 1px solid #000;
}

.cookie-settings__inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 68px);
}

.cookie-settings__back {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 17px 21px;
  border: none;
  background: #fff;
  box-shadow: 0 4px 5px rgba(0, 0, 0, 0.04);
  font: inherit;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.35;
  color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  text-align: left;
}

.cookie-settings__back svg {
  flex-shrink: 0;
  opacity: 0.5;
}

.cookie-settings__body {
  padding: 0 20px;
  overflow-y: auto;
  flex: 1;
}

.cookie-settings__title {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.35;
  margin: 29px 0 16px;
}

.cookie-settings__desc {
  font-size: 16px;
  line-height: 1.55;
  margin-bottom: 30px;
}

.cookie-settings__list {
  list-style: none;
  padding: 0;
  margin-bottom: 31px;
}

.cookie-settings__list .cookie-item {
  list-style: none;
  padding-left: 0;
}

.cookie-settings__list .cookie-item::before {
  content: none !important;
  display: none !important;
}

.cookie-item {
  display: flex;
  flex-wrap: wrap;
  padding: 14px 0 16px;
  border-bottom: 1px solid rgba(157, 153, 153, 0.4);
}

.cookie-item:first-child {
  border-top: 1px solid rgba(157, 153, 153, 0.4);
}

.cookie-item__header {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  cursor: pointer;
  text-align: left;
}

.cookie-item__toggle-icon {
  position: relative;
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  font-size: 0;
}

.cookie-item__toggle-icon::before,
.cookie-item__toggle-icon::after {
  content: "";
  position: absolute;
  background: #000;
  transition: all 0.3s ease;
}

.cookie-item__toggle-icon::before {
  left: 5px;
  top: 0;
  width: 1px;
  height: 100%;
}

.cookie-item__toggle-icon::after {
  left: 0;
  top: 5px;
  width: 100%;
  height: 1px;
}

.cookie-item--open .cookie-item__toggle-icon::before {
  transform: rotate(90deg);
}

.cookie-item--open .cookie-item__toggle-icon::after {
  opacity: 0;
}

.cookie-item__name {
  flex: 1;
}

.cookie-item__status {
  font-size: 11px;
  line-height: 1.4;
  color: #a2a2a2;
  flex-shrink: 0;
}

.cookie-item__status--always,
.cookie-item__status--allowed {
  color: #2a3fcc;
}

.cookie-item__status--always {
  font-size: 11px;
}

.cookie-item__controls {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.cookie-item__content {
  display: grid;
  grid-template-rows: 0fr;
  flex-basis: 100%;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              margin 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-item--open .cookie-item__content {
  grid-template-rows: 1fr;
  margin-top: 16px;
}

.cookie-item__content p {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-item--open .cookie-item__content p {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.08s;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  margin-left: 14px;
  flex-shrink: 0;
}

.toggle__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__slider {
  position: absolute;
  inset: 0;
  background: #c6c5c5;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.toggle__slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: #f1f1f1;
  border-radius: 50%;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 2px rgba(0, 0, 0, 0.24);
  transition: transform 0.3s ease;
}

.toggle__input:checked + .toggle__slider {
  background: rgb(72, 162, 22);
}

.toggle__input:checked + .toggle__slider::before {
  transform: translateX(24px);
}

.cookie-settings__footer {
  padding: 16px 21px;
  box-shadow: 0 -4px 5px rgba(0, 0, 0, 0.04);
}

@media (max-width: 640px) {
  .cookie-banner,
  .cookie-settings {
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    max-width: none;
  }

  .cookie-banner__inner,
  .cookie-settings__inner {
    border-radius: 0;
    max-height: calc(100vh - 20px);
  }

  .cookie-banner__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner__buttons {
    display: block;
    width: 100%;
  }

  .cookie-banner__buttons .btn {
    width: 100%;
  }

  .cookie-banner__buttons .btn--outline {
    margin: 10px 0 0;
  }

  .cookie-banner__settings-link {
    margin: 10px 0 0;
    text-align: center;
  }

  .cookie-item {
    padding: 18px 0;
  }

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

  .cookie-item--open .cookie-item__content {
    margin-bottom: 19px;
  }
}
