/* Cookie Bar — BEM */

.cookie-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background-color: #1e1e2e;
  color: #f5f5f5;
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.4s ease;
  max-height: 85vh;
  overflow-y: auto;
}

.cookie-bar--visible {
  transform: translateY(0);
}

/* ---------- Panel: main ---------- */

.cookie-bar__panel {
  display: none;
  padding: 20px 24px;
}

.cookie-bar__panel--active {
  display: block;
}

.cookie-bar__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.cookie-bar__text {
  margin: 0 0 16px;
  max-width: 640px;
  color: #c5c5d0;
}

.cookie-bar__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Panel: preferences ---------- */

.cookie-bar__categories {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.cookie-bar__category {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #3a3a4e;
  border-radius: 8px;
  background-color: #262636;
}

.cookie-bar__category-info {
  flex: 1;
}

.cookie-bar__category-name {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 600;
}

.cookie-bar__category-desc {
  margin: 0;
  font-size: 13px;
  color: #a0a0b0;
}

/* ---------- Toggle switch ---------- */

.cookie-bar__toggle {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 26px;
  margin-top: 2px;
}

.cookie-bar__toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-bar__toggle-slider {
  position: absolute;
  inset: 0;
  background-color: #555;
  border-radius: 26px;
  cursor: pointer;
  transition: background-color 0.25s;
}

.cookie-bar__toggle-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
}

.cookie-bar__toggle input:checked + .cookie-bar__toggle-slider {
  background-color: #4c6ef5;
}

.cookie-bar__toggle input:checked + .cookie-bar__toggle-slider::before {
  transform: translateX(20px);
}

.cookie-bar__toggle input:disabled + .cookie-bar__toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Buttons ---------- */

.cookie-bar__button {
  padding: 9px 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.cookie-bar__button--accept {
  background-color: #4c6ef5;
  color: #ffffff;
}

.cookie-bar__button--accept:hover {
  background-color: #3b5bdb;
}

.cookie-bar__button--choose {
  background-color: transparent;
  border-color: #555;
  color: #ccc;
}

.cookie-bar__button--choose:hover {
  border-color: #888;
  color: #fff;
}

.cookie-bar__button--reject {
  background-color: transparent;
  border-color: #555;
  color: #ccc;
}

.cookie-bar__button--reject:hover {
  border-color: #888;
  color: #fff;
}

.cookie-bar__button--save {
  background-color: #4c6ef5;
  color: #ffffff;
}

.cookie-bar__button--save:hover {
  background-color: #3b5bdb;
}

.cookie-bar__button--back {
  background-color: transparent;
  border-color: #555;
  color: #ccc;
}

.cookie-bar__button--back:hover {
  border-color: #888;
  color: #fff;
}

/* ---------- Footer link ---------- */

.cookie-bar__footer-link {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9998;
  padding: 6px 14px;
  border: 1px solid #888;
  border-radius: 6px;
  background-color: rgba(30, 30, 46, 0.9);
  color: #f5f5f5;
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.cookie-bar__footer-link:hover {
  background-color: #1e1e2e;
  border-color: #4c6ef5;
  color: #fff;
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
  .cookie-bar__panel {
    padding: 16px;
  }

  .cookie-bar__actions {
    flex-direction: column;
  }

  .cookie-bar__button {
    width: 100%;
    text-align: center;
  }

  .cookie-bar__category {
    flex-direction: column;
    gap: 10px;
  }

  .cookie-bar__toggle {
    align-self: flex-end;
  }
}
