/*!
 * iComponents — баннер согласия на cookie. Редакция от 08.10.2026
 * Все классы с префиксом .icc- — не пересекаются с bootstrap и стилями шаблона.
 * Цвета вынесены в переменные: замените --icc-accent на фирменный цвет шаблона.
 */

:root {
  --icc-accent: #0a66d8;          /* фирменный цвет (кнопка «Принять все», переключатели) */
  --icc-accent-hover: #0853b0;
  --icc-accent-contrast: #ffffff;
  --icc-text: #1d2129;
  --icc-text-muted: #5b6270;
  --icc-bg: #ffffff;
  --icc-surface: #f5f7fa;
  --icc-border: #dfe3ea;
  --icc-shadow: 0 12px 40px rgba(16, 24, 40, 0.18), 0 2px 8px rgba(16, 24, 40, 0.08);
  --icc-radius: 14px;
  --icc-radius-btn: 10px;
  --icc-z-banner: 100000;         /* выше модалок bootstrap (1050) */
  --icc-z-modal: 100001;
  --icc-font: inherit;
}

/* ---------- Общие ---------- */

.icc-banner,
.icc-modal {
  font-family: var(--icc-font);
  color: var(--icc-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

.icc-banner *,
.icc-modal *,
.icc-banner *::before,
.icc-modal *::before,
.icc-banner *::after,
.icc-modal *::after {
  box-sizing: border-box;
}

.icc-banner[hidden],
.icc-modal[hidden] {
  display: none !important;
}

.icc-link {
  color: var(--icc-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.icc-link:hover,
.icc-link:focus {
  color: var(--icc-accent-hover);
}

/* ---------- Кнопки ---------- */

.icc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;               /* удобная зона нажатия на мобильных */
  padding: 10px 20px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--icc-radius-btn);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.icc-btn:focus {
  outline: none;
}

.icc-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(10, 102, 216, 0.35);
}

.icc-btn--primary {
  background: var(--icc-accent);
  color: var(--icc-accent-contrast);
}

.icc-btn--primary:hover {
  background: var(--icc-accent-hover);
}

/* «Только необходимые» — того же размера и заметности, что и «Принять все» */
.icc-btn--secondary {
  background: var(--icc-bg);
  color: var(--icc-text);
  border-color: var(--icc-text);
}

.icc-btn--secondary:hover {
  background: var(--icc-surface);
}

.icc-btn--ghost {
  background: transparent;
  color: var(--icc-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-left: 12px;
  padding-right: 12px;
}

.icc-btn--ghost:hover {
  color: var(--icc-text);
}

/* ---------- Баннер ---------- */

.icc-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: var(--icc-z-banner);
  max-width: 1120px;
  margin: 0 auto;
  background: var(--icc-bg);
  border: 1px solid var(--icc-border);
  border-radius: var(--icc-radius);
  box-shadow: var(--icc-shadow);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .25s ease, transform .25s ease;
}

.icc-banner.icc-is-visible {
  opacity: 1;
  transform: none;
}

.icc-banner__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
}

.icc-banner__text {
  flex: 1 1 auto;
  min-width: 0;
}

.icc-banner__title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.icc-banner__desc {
  margin: 0;
  color: var(--icc-text-muted);
}

.icc-banner__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* ---------- Модальное окно ---------- */

.icc-modal {
  position: fixed;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--icc-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.icc-modal__overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(16, 24, 40, 0.55);
  opacity: 0;
  transition: opacity .2s ease;
}

.icc-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  background: var(--icc-bg);
  border-radius: var(--icc-radius);
  box-shadow: var(--icc-shadow);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
  outline: none;
}

.icc-modal.icc-is-visible .icc-modal__overlay {
  opacity: 1;
}

.icc-modal.icc-is-visible .icc-modal__dialog {
  opacity: 1;
  transform: none;
}

.icc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 12px;
}

.icc-modal__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--icc-text);
}

.icc-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: -8px -8px -8px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--icc-text-muted);
  cursor: pointer;
}

.icc-modal__close:hover {
  background: var(--icc-surface);
  color: var(--icc-text);
}

.icc-modal__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 102, 216, 0.35);
}

.icc-modal__body {
  padding: 0 24px 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.icc-modal__desc {
  margin: 0 0 16px;
  color: var(--icc-text-muted);
}

.icc-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--icc-border);
}

/* Категории */

.icc-cat {
  margin: 0 0 12px;
  padding: 16px;
  background: var(--icc-surface);
  border-radius: 12px;
}

.icc-cat__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.icc-cat__info {
  min-width: 0;
}

.icc-cat__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--icc-text);
}

.icc-cat__text {
  margin: 0;
  font-size: 13px;
  color: var(--icc-text-muted);
}

/* Переключатель */

.icc-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin: 2px 0 0;
  cursor: pointer;
}

.icc-switch input {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 24px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.icc-switch__track {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #b9c0cc;
  transition: background-color .15s ease;
}

.icc-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .15s ease;
}

.icc-switch input:checked + .icc-switch__track {
  background: var(--icc-accent);
}

.icc-switch input:checked + .icc-switch__track::after {
  transform: translateX(20px);
}

.icc-switch input:focus-visible + .icc-switch__track {
  box-shadow: 0 0 0 3px rgba(10, 102, 216, 0.35);
}

.icc-switch--locked,
.icc-switch--locked input {
  cursor: not-allowed;
}

.icc-switch--locked .icc-switch__track {
  opacity: .55;
}

.icc-switch__state {
  font-size: 12px;
  color: var(--icc-text-muted);
  white-space: nowrap;
}

/* Блокировка прокрутки страницы при открытой модалке */
html.icc-lock,
html.icc-lock body {
  overflow: hidden !important;
}

/* ---------- Адаптив ---------- */

@media (max-width: 991px) {
  .icc-banner__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .icc-banner__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 575px) {
  .icc-banner {
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--icc-radius) var(--icc-radius) 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .icc-banner__inner {
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .icc-banner__desc {
    font-size: 13px;
  }

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

  .icc-banner__actions .icc-btn {
    width: 100%;
  }

  .icc-banner__actions .icc-btn--ghost {
    min-height: 36px;
  }

  /* Модалка — «шторка» снизу */
  .icc-modal {
    align-items: flex-end;
    padding: 0;
  }

  .icc-modal__dialog {
    max-width: none;
    max-height: 90vh;
    border-radius: var(--icc-radius) var(--icc-radius) 0 0;
    transform: translateY(24px);
  }

  .icc-modal__header {
    padding: 16px 16px 8px;
  }

  .icc-modal__body {
    padding: 0 16px 8px;
  }

  .icc-modal__footer {
    flex-direction: column-reverse;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .icc-modal__footer .icc-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .icc-banner,
  .icc-modal__overlay,
  .icc-modal__dialog,
  .icc-switch__track,
  .icc-switch__track::after,
  .icc-btn {
    transition: none !important;
  }
}

@media print {
  .icc-banner,
  .icc-modal {
    display: none !important;
  }
}
