/*
 * Кук-баннер и окно настроек (макет Figma «Фонд вызов», раздел «Coockies», 09.10.2026).
 * Размеры из макета: 1920 px — полоса внизу, текст слева, кнопки справа; 375 px — карточка, кнопки столбиком.
 * Шрифт Mulish обычных начертаний (400–700) лежит рядом в fonts/: в шаблонах сайта есть только Mulish Bold и Black.
 * Цвета — переменные ниже: по умолчанию коричневые старого оформления (на боевом пока оно),
 * в синей теме их переопределяет theme-blue.css (#378EFF, как иконки соцсетей).
 */

@font-face {
  font-family: "FV Mulish";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/mulish-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "FV Mulish";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/mulish-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.fv-cookie,
.fv-cookie-settings {
  position: fixed;
  z-index: 1000;
  box-sizing: border-box;
  pointer-events: none; /* страница под баннером остаётся кликабельной, клики ловят только сами карточки */
  font-family: "FV Mulish", "IBMPlexSans-Regular", Arial, sans-serif;
  color: #ffffff;
  text-align: left;
  --fv-cookie-accent: #a16540; /* фон баннера и окна, текст белых кнопок */
  --fv-cookie-dark: #3e2f26;   /* текст кнопок в окне настроек */
}

.fv-cookie *,
.fv-cookie-settings * {
  box-sizing: border-box;
}

.fv-cookie[hidden],
.fv-cookie-settings[hidden] {
  display: none;
}

/* ===== Баннер ===== */
.fv-cookie {
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px;
}

.fv-cookie__box {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 60px;
  /* текст и кнопки стоят по сетке сайта (контейнер 1440 px) */
  padding: 24px max(24px, calc((100% - 1440px) / 2));
  background: var(--fv-cookie-accent);
  border-radius: 20px;
}

.fv-cookie__info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fv-cookie__title {
  font-size: 14px;
  line-height: 18px;
  font-weight: 700;
}

.fv-cookie__text {
  font-size: 12px;
  line-height: 15px;
  font-weight: 500;
}

/* селекторы усилены: общие правила ссылок сайта (в том числе hover синей темы) не должны перекрашивать ссылку */
.fv-cookie .fv-cookie__text a:link,
.fv-cookie .fv-cookie__text a:visited {
  color: #ffffff;
  text-decoration: underline;
}

.fv-cookie .fv-cookie__text a:hover {
  color: #ffffff;
  text-decoration: none;
}

.fv-cookie__actions {
  flex: 0 0 414px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.fv-cookie__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 43px;
  margin: 0;
  padding: 10px 8px;
  border: 1.5px solid #ffffff;
  border-radius: 500px;
  background: #ffffff;
  color: var(--fv-cookie-accent);
  font-family: inherit;
  font-size: 12px;
  line-height: 15px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap; /* «Принять только необходимые» должна помещаться в одну строку, как в макете */
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

.fv-cookie__btn:hover {
  opacity: 0.88;
}

.fv-cookie__btn:focus-visible,
.fv-cookie-switch:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.fv-cookie__btn--dark {
  color: var(--fv-cookie-dark);
}

/* «Настроить»: контурная кнопка рядом с «Принять все» (на телефоне под ней), текст слева, стрелка справа */
.fv-cookie__btn--outline {
  justify-content: space-between;
  padding: 10px 14px;
  background: transparent;
  color: #ffffff;
}

.fv-cookie__btn--outline::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 3px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}

.fv-cookie__btn--outline:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

/* ===== Окно настроек ===== */
.fv-cookie-settings {
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.fv-cookie-settings__box {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 650px;
  max-width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 30px;
  background: var(--fv-cookie-accent);
  border-radius: 20px;
}

.fv-cookie-settings__group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fv-cookie-settings__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.fv-cookie-settings__title {
  font-size: 18px;
  line-height: 23px;
  font-weight: 700;
}

.fv-cookie-settings__text {
  font-size: 14px;
  line-height: 18px;
  font-weight: 400;
}

.fv-cookie-settings__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* Переключатель: включён — белая дорожка и кружок цвета баннера справа; выключен — контур и белый кружок слева */
.fv-cookie-switch {
  position: relative;
  flex: 0 0 68px;
  width: 68px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 1px solid #ffffff;
  border-radius: 500px;
  background: transparent;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.fv-cookie-switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 150ms ease, background-color 150ms ease;
}

.fv-cookie-switch[aria-checked="true"] {
  background: #ffffff;
}

.fv-cookie-switch[aria-checked="true"]::before {
  transform: translateX(30px);
  background: var(--fv-cookie-accent);
}

.fv-cookie-switch:disabled {
  cursor: default;
}

/* ===== Планшет и телефон: карточка, кнопки столбиком ===== */
@media screen and (max-width: 1024px) {
  .fv-cookie {
    padding: 10px;
  }

  .fv-cookie__box {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    max-width: 560px;
    margin: 0 auto;
    padding: 16px;
  }

  .fv-cookie__actions {
    flex: 0 0 auto;
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media screen and (max-width: 700px) {
  .fv-cookie-settings {
    align-items: flex-start;
    padding-top: 114px; /* в макете окно стоит сразу под шапкой */
  }

  .fv-cookie-settings__actions {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 700px) and (max-height: 640px) {
  .fv-cookie-settings {
    padding-top: 10px; /* на низком экране окно не помещается под шапкой — занимает весь экран и прокручивается */
  }
}
