/* Баннер согласия на cookie и окно настроек. Каркас окна (подложка, анимации, крестик, шторка) берётся из .contact-dialog в styles.css */

/* ---------- Баннер: компактная плашка внизу по центру ---------- */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 40;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  width: min(900px, calc(100vw - 40px));
  padding: 8px 8px 8px 28px;
  border: 1px solid rgb(var(--obsidian-rgb) / 0.08);
  border-radius: 999px;
  color: var(--obsidian-black);
  background: var(--pure-white);
  box-shadow: 0 12px 40px rgb(var(--obsidian-rgb) / 0.14);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.cookie-banner[hidden] {
  display: none;
}
.cookie-banner.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.cookie-banner__text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--graphite-grey);
}
.cookie-banner__text a {
  color: var(--obsidian-black);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-banner__text a:hover {
  color: var(--sunset-blaze);
}
.cookie-banner__actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}
.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.cookie-btn--primary {
  color: var(--pure-white);
  background: var(--sunset-blaze);
}
.cookie-btn--primary:hover {
  opacity: 0.9;
}
.cookie-btn--ghost {
  color: var(--obsidian-black);
  border-color: rgb(var(--obsidian-rgb) / 0.2);
  background: transparent;
}
.cookie-btn--ghost:hover {
  background: var(--mist-sand);
  border-color: rgb(var(--obsidian-rgb) / 0.35);
}
.cookie-btn--text {
  padding: 0 14px;
  color: var(--graphite-grey);
  background: transparent;
}
.cookie-btn--text:hover {
  color: var(--sunset-blaze);
}
.cookie-btn:focus-visible {
  outline: 2px solid var(--sunset-blaze);
  outline-offset: 2px;
}

/* ---------- Окно настроек ---------- */
.cookie-dialog {
  width: min(520px, calc(100vw - 32px));
}
.cookie-options {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}
.cookie-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-radius: var(--radius-card);
  background: var(--mist-sand);
}
.cookie-option__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}
.cookie-option__text {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--graphite-grey);
}
.cookie-dialog__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}

/* Переключатель */
.cookie-switch {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  margin-top: 2px;
  cursor: pointer;
}
.cookie-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}
.cookie-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgb(var(--obsidian-rgb) / 0.2);
  transition: background-color 0.25s ease;
}
.cookie-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pure-white);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.cookie-switch input:checked + span {
  background: var(--sunset-blaze);
}
.cookie-switch input:checked + span::after {
  transform: translateX(20px);
}
.cookie-switch input:disabled {
  cursor: not-allowed;
}
.cookie-switch input:disabled + span {
  opacity: 0.5;
}
.cookie-switch input:focus-visible + span {
  outline: 2px solid var(--sunset-blaze);
  outline-offset: 2px;
}

/* ---------- Ссылки в футере ---------- */
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 24px;
}
.footer__legal a:hover,
.nf__foot a:hover {
  opacity: 0.7;
}
.nf__foot .footer__legal {
  align-items: center;
}

@media (max-width: 1000px) {
  .footer__legal {
    justify-content: flex-start;
  }
}
@media (max-width: 900px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    border-radius: var(--radius-card);
    padding: 18px;
  }
  .cookie-banner__actions {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
  .cookie-btn--primary {
    grid-column: 1 / -1;
  }
}
@media (max-width: 600px) {
  /* шторка на всю ширину (общий стиль окна иначе перебивается шириной выше) */
  .cookie-dialog {
    width: 100%;
  }
  .cookie-banner {
    bottom: 12px;
    width: calc(100vw - 24px);
  }
  .cookie-btn {
    height: 48px;
    padding: 0 14px;
  }
  .cookie-dialog__actions {
    grid-template-columns: minmax(0, 1fr);
  }
  .cookie-option {
    padding: 16px;
  }
  .cookie-dialog__actions {
    grid-template-columns: minmax(0, 1fr);
  }
}
