/* ===========================================================================
   ui.css — переиспользуемые элементы интерфейса из страницы UI в Figma.
   Пишем плоско: элементы БЭМ полными именами, без вложенности селекторов.
   Имена блоков соответствуют именам компонентов в макете.
   =========================================================================== */

@layer ui {

  /* === Шапка (Header) ==================================================== */

  /* Липкая: при прокрутке прилипает к верху окна */
  .header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    margin: 10px var(--page-gutter);
  }

  .header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    padding-inline: 16px;
    border-radius: var(--radius-block);
    background: var(--color-blue);
    transition: background-color 0.3s ease;
  }

  .header__logo { flex-shrink: 0; }

  .header__logo-img {
    width: 88px;
    height: 36px;
  }

  .header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .header__lang {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-control);
    color: var(--color-white);
    font-size: var(--fs-text);
    line-height: 1;
    text-decoration: none;
    transition: background-color var(--transition);
  }

  /* «Меню пункты с иконками»: вход и корзина. Текст входа прячем на узких
     экранах — остаётся иконка, подпись уходит в aria-label */
  .header__action {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 50px;
    padding-inline: 10px;
    border-radius: var(--radius-control);
    color: var(--color-white);
    font-size: var(--fs-text);
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color var(--transition);
  }

  .header__action:hover,
  .header__lang:hover { background: var(--color-blue-hover); }

  .header__action-icon {
    width: 24px;
    height: 24px;
  }

  .header__action-text { display: none; }

  /* Управление меню: Open и Close — два состояния одного компонента */
  .header__burger {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: url(../img/menu-open.svg) no-repeat center / 40px 40px;
    cursor: pointer;
  }

  .header__burger[aria-expanded="true"] {
    background-image: url(../img/menu-close.svg);
  }

  /* Тёмная тема: шапка на первом экране главной */
  .header--dark .header__bar { background: var(--color-gray-900); }

  .header--dark .nav__link:hover,
  .header--dark .nav__link[aria-current="page"],
  .header--dark .header__action:hover,
  .header--dark .header__lang:hover { background: var(--color-gray-800); }

  @media (width >= 768px) {
    .header__bar { padding-inline: 40px; }
    .header__actions { gap: 12px; }
    .header__lang { width: 51px; height: 51px; }
    .header__action { padding-inline: 12px; }
  }

  @media (width >= 1280px) {
    .header__action-text { display: inline; }
  }

  @media (width >= 1280px) {
    .header__bar { padding-inline: 60px; }
  }

  @media (width >= 1536px) {
    .header__bar { padding-left: 100px; }
  }

  /* === Навигация ========================================================= */

  .nav {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    align-items: center;
    gap: 5px;
    transform: translate(-50%, -50%);
  }

  .nav__link {
    display: flex;
    align-items: center;
    height: 50px;
    padding-inline: 12px;
    border-radius: var(--radius-control);
    color: var(--color-white);
    font-size: var(--fs-text);
    line-height: 1;
    text-decoration: none;
    transition: background-color var(--transition);
  }

  /* Текущий раздел — как при наведении (Active = Hover в макете) */
  .nav__link:hover,
  .nav__link[aria-current="page"] { background: var(--color-blue-hover); }

  .nav__link--disabled {
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
  }

  /* Тёмная тема шапки: наведение другим цветом */
  .nav__link--dark:hover,
  .nav__link--dark[aria-current="page"] { background: var(--color-gray-800); }

  @media (width >= 1024px) {
    .nav { display: flex; }
  }

  /* === Большое меню ====================================================== */
  /* Открывается бургером поверх страницы на любой ширине. Внутри — та же
     карта сайта, что в подвале, и крупное слово «СкайВеб24» на волне.
     Размеры из макета 1840×900. Открытое меню — часть страницы, а не окно
     поверх неё: остальная страница скрыта (.has-mega-menu ниже), меню
     растёт на всю высоту содержимого без своей прокрутки, на невысоких
     экранах листается обычной прокруткой страницы. */

  .mega-menu {
    position: relative;
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 20px);
    margin: 10px;
    padding: 0 20px 24px;
    border-radius: var(--radius-block);
    /* волна снизу — 430 из 900px макета */
    background: url(../img/mega-wave.svg) no-repeat center bottom / 100% min(47.7%, 60cqi)
                var(--color-gray-800);
    color: var(--color-white);
    container-type: inline-size;
    isolation: isolate;
  }

  .mega-menu:not(.is-open) { display: none; }

  .mega-menu__bar {
    position: relative;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
  }

  .mega-menu__tagline {
    display: none;
    position: absolute;
    margin: 0;
    top: 50%;
    left: 50%;
    color: var(--color-text-subtle);
    font-size: var(--fs-text);
    line-height: 1;
    white-space: nowrap;
    transform: translate(-50%, -50%);
  }

  .mega-menu__close {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: url(../img/menu-close.svg) no-repeat center / 40px 40px;
    cursor: pointer;
  }

  .mega-menu .sitemap { margin-top: 32px; }

  /* Крупное слово на волне. В макете оно занимает 1648 из 1840px ширины
     меню (доля 0.896 — в data-fit-text). Ширина надписи зависит от шрифта,
     поэтому точный кегль подбирает ui.js; здесь — стартовое значение. */
  .mega-menu__word {
    flex-shrink: 0;
    margin: auto -20px 0;
    padding-top: 48px;
    color: var(--color-gray-700);
    font-size: 16cqi;
    font-weight: var(--fw-light);
    line-height: 0.8;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
  }

  .mega-menu .sitemap__bottom { margin-top: 24px; }

  @media (width >= 768px) {
    .mega-menu {
      margin: 10px 40px;
      padding: 0 40px 30px;
      border-radius: var(--radius-large);
    }
    .mega-menu__tagline { display: block; }
    .mega-menu__word { margin-inline: -40px; }
  }

  @media (width >= 1280px) {
    .mega-menu {
      min-height: min(900px, calc(100dvh - 20px));
      padding: 0 80px 30px;
    }
    .mega-menu__bar { height: 130px; }
    .mega-menu .sitemap { margin-top: 25px; }
    .mega-menu__word { margin-inline: -80px; }
    .mega-menu .sitemap__bottom { margin-top: 60px; }
  }

  /* Пока меню открыто, на странице только оно: шапка, содержимое и подвал
     скрыты, прокрутка страницы листает меню. !important — блоки страницы
     (первый экран и т. п.) задают display в слоях позже ui */
  .has-mega-menu .page > :not(.mega-menu) { display: none !important; }

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

  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--control-h);
    padding-inline: 24px;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    background: none;
    color: inherit;
    font-family: var(--font-main);
    font-size: var(--fs-text);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition),
                border-color var(--transition);
  }

  .button:disabled {
    pointer-events: none;
    opacity: 0.5;
  }

  /* Кнопка 1 */
  .button--primary {
    border-color: var(--color-blue);
    background: var(--color-blue);
    color: var(--color-white);
  }

  .button--primary:hover {
    background: transparent;
    color: var(--color-blue);
  }

  /* Кнопка 2 — на синем фоне */
  .button--on-blue {
    border-color: var(--color-white);
    background: var(--color-white);
    color: var(--color-blue);
  }

  .button--on-blue:hover {
    background: var(--color-blue);
    color: var(--color-white);
  }

  .button--on-blue:disabled {
    background: var(--color-blue);
    color: var(--color-white);
  }

  /* Кнопка 3 — контурная */
  .button--outline {
    border-color: var(--color-blue);
    color: var(--color-blue);
  }

  .button--outline:hover {
    border-color: var(--color-gray-600);
    color: var(--color-gray-600);
  }

  /* Кнопка 5 — ссылка «Подробнее», стрелка отъезжает при наведении */
  .button--link {
    color: var(--color-blue);
    line-height: 20px;
  }

  /* Место под стрелку резервируется сразу по наведённому состоянию (14px),
     а сдвиг делает transform — он не участвует в раскладке, поэтому ширина
     ссылки постоянна и соседние элементы не разъезжаются. */
  .button__arrow {
    margin-left: 14px;
    transform: translateX(-8px);
    transition: transform var(--transition);
  }

  .button--link:hover .button__arrow { transform: translateX(0); }

  /* Кнопка 4 — добавление товара в корзину из карточки продукта */
  .button--icon {
    width: 50px;
    height: 50px;
    padding: 0;
    background: var(--color-blue) url(../img/cart-white.svg) no-repeat center / 20px 20px;
  }

  .button--icon:hover {
    border-color: var(--color-blue);
    background-color: var(--color-white);
    background-image: url(../img/cart-blue.svg);
  }

  /* Кнопки первого экрана главной — на тёмном фоне */
  .button--dark {
    background: var(--color-gray-800);
    color: var(--color-gray-500);
  }

  .button--dark:hover { background: var(--color-gray-700); }

  /* Кнопка-фильтр */
  .button--filter {
    height: var(--control-h-small);
    padding: 12px;
    border-color: var(--color-border);
    color: var(--color-text);
  }

  .button--filter:hover { border-color: var(--color-gray-500); }

  .button--filter[aria-pressed="true"] {
    border-color: transparent;
    background: var(--color-blue-50);
  }

  /* === Поле ввода ======================================================== */

  .field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  .field__label {
    color: var(--color-gray-700);
    font-size: var(--fs-text-xs);
    line-height: 1.25;
  }

  .field__input {
    width: 100%;
    height: var(--control-h);
    padding-inline: 19px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
    background: var(--color-white);
    color: var(--color-gray-800);
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.25;
    outline: none;
    transition: border-color var(--transition);
  }

  .field__input::placeholder { color: var(--color-text-subtle); }
  .field__input:hover { border-color: var(--color-gray-600); }
  .field__input:focus { border-color: var(--color-blue); }

  .field__note {
    padding: 4px 20px;
    border-radius: var(--radius-control);
    background: var(--color-blue-50);
    color: var(--color-text-subtle);
    font-size: var(--fs-text-xs);
    line-height: 1.25;
  }

  .field--error .field__input { border-color: var(--color-red-900); }
  .field--error .field__note {
    background: var(--color-red-50);
    color: var(--color-red-900);
  }

  .field--success .field__note {
    background: var(--color-green-50);
    color: var(--color-green);
  }

  /* На планшете и шире поле набирается 14px — из макета */
  @media (width >= 768px) {
    .field__input { font-size: 14px; }
  }

  /* === Чекбокс и радиокнопка ============================================= */

  .choice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--color-gray-800);
    font-size: var(--fs-text);
    line-height: 1.25;
    cursor: pointer;
  }

  .choice__input {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    appearance: none;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
  }

  .choice__input[type="checkbox"] {
    border: 1px solid var(--color-blue);
    border-radius: var(--radius-checkbox);
    background-color: var(--color-white);
  }

  .choice__input[type="checkbox"]:checked {
    border-color: transparent;
    background-image: url(../img/checkbox-checked.svg);
  }

  .choice__input[type="radio"] { background-image: url(../img/radio.svg); }
  .choice__input[type="radio"]:checked { background-image: url(../img/radio-active.svg); }

  /* === Хлебные крошки ==================================================== */
  /* Стили — в шаблоне компонента bitrix:breadcrumb (.default), здесь только
     полоса под шапкой, которую выводит header.php */

  /* Шапка внутренней страницы (header.php): крошки и заголовок h1 по
     центру, стилем «Н2 medium» макета. Отступ от крошек до заголовка 67px
     (макет 1920); отступ от заголовка до содержимого задаёт само содержимое */
  .page-head { padding-top: 20px; }

  .page-head > h1 {
    max-width: 1013px; /* длинные заголовки — в две строки, ширина как в макетах (Figma 1332:17524) */
    margin: 40px auto 0;
    text-wrap: balance;
    /* длинное слово («конфиденциальности») на телефоне шире экрана —
       переносим по слогам (lang у <html> задан) */
    hyphens: auto;
    overflow-wrap: break-word;
    font-size: var(--fs-h2);
    font-weight: var(--fw-medium);
    line-height: 1;
    text-align: center;
  }

  @media (width >= 768px) {
    .page-head { padding-top: 30px; }
    .page-head > h1 { margin-top: 67px; }
  }

  /* === Переключатель-вкладки ============================================ */
  /* Компонент «Переключение тарифа» макета: пилюля с синей рамкой, выбранный
     пункт — синий. Пункты — <button aria-pressed> или ссылки с aria-current.
     На узком экране не помещаются — прокручиваются внутри себя */

  .pill-tabs {
    display: flex;
    gap: 2px;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    padding: 7px;
    overflow-x: auto;
    border: 1px solid var(--color-blue);
    border-radius: 500px;
    scrollbar-width: none;
  }

  .pill-tabs__item {
    flex: none;
    height: 44px;
    padding: 12px;
    border: 0;
    border-radius: 500px;
    background: none;
    color: var(--color-gray-800);
    font: inherit;
    font-size: var(--fs-text-m);
    line-height: 20px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition);
  }

  .pill-tabs__item:hover { color: var(--color-blue); }

  .pill-tabs__item:focus-visible {
    outline: 2px solid var(--color-blue);
    outline-offset: -2px;
  }

  .pill-tabs__item[aria-pressed="true"],
  .pill-tabs__item[aria-current="true"] {
    background: var(--color-blue);
    color: var(--color-white);
    cursor: default;
  }

  /* === Страница ошибки (404) ============================================= */
  /* Заголовок, пояснение и кнопка на главную по центру, отступы — как у
     заголовков разделов каталога */

  .error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding-top: 40px;
    padding-bottom: 64px;
    text-align: center;
  }

  @media (width >= 768px) {
    .error-page { padding-top: 67px; padding-bottom: 120px; }
  }

  /* === Ссылка ============================================================ */
  /* Компонент «Ссылка»: пункты подвала и ссылки в тексте.
     Набрана стилем P2 · 18/125%, линия вырастает от центра к краям */

  .link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--color-blue);
    font-size: var(--fs-text-m);
    line-height: var(--lh-text-m);
    text-decoration: none;
    /* длинный URL в тексте переносится, а не распирает страницу */
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .link::after {
    content: "";
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width var(--transition);
  }

  .link:hover::after { width: 100%; }

  /* На цветном фоне — в подвале и на баннерах */
  .link--white { color: var(--color-white); }

  /* === Теги категорий ==================================================== */
  /* Блок «О компании» на главной */

  .tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--control-h);
    padding-inline: 22px;
    border: 1px solid var(--color-chartreuse);
    border-radius: 100px;
    background: none;
    color: var(--color-gray-800);
    font-family: var(--font-main);
    font-size: var(--fs-text);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition);
  }

  .tag:hover { background: var(--color-chartreuse); }

  /* === Тонкая полоса прокрутки =========================================== */
  /* Класс на прокручиваемый блок (окно согласия, списки умного фильтра):
     узкая серая полоса на прозрачной дорожке. Chrome, Edge и Firefox берут
     scrollbar-width/scrollbar-color, Safari — ::-webkit-scrollbar */

  .scroll-thin {
    scrollbar-width: thin;
    scrollbar-color: var(--color-gray-200) transparent;
  }

  .scroll-thin::-webkit-scrollbar { width: 10px; }
  .scroll-thin::-webkit-scrollbar-track { background: transparent; }
  .scroll-thin::-webkit-scrollbar-thumb {
    border-radius: var(--radius-pill);
    background: var(--color-gray-200);
  }

  /* === Лейблы ============================================================ */
  /* Одно правило на все варианты: цвет приходит через переменную */

  .label {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding-inline: 8px;
    border-radius: var(--radius-pill);
    background: var(--label-bg, var(--color-blue));
    color: var(--color-white);
    font-size: var(--fs-text);
    line-height: 1;
  }

  .label--pro   { --label-bg: linear-gradient(270deg, #03C1F4 0%, #7368D4 100%); }
  .label--new   { --label-bg: var(--color-lime); }
  .label--rec   { --label-bg: var(--color-violet); }
  .label--stage { --label-bg: var(--color-blue); }

  /* Время в таблице: голубой фон, синий текст */
  .label--time {
    --label-bg: var(--color-blue-25);
    color: var(--color-blue);
  }

  /* === Таблицы ========================================================== */
  /* Компонент «Строка таблицы» (UI 771:12884, 234:5453), страница
     «Типографика». Таблица в обёртке .table-wrap: рамка и скругление,
     на узком экране — прокрутка вбок. Строки — через одну белая и
     голубая, при наведении — синяя рамка строки.
     .table — с шапкой (журнал работ): шапка gray-500, текст 16/135%.
     .table--props — без шапки, «название — значение»: название 20 medium,
     значение 18/125%, между колонками линия. */

  .table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-quote);
    background: var(--color-white);
  }

  /* separate, а не collapse: иначе ячейкам нельзя скруглить углы */
  .table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--color-text);
    font-size: var(--fs-text-p3);
    line-height: var(--lh-text-p3);
    text-align: left;
  }

  .table th,
  .table td {
    height: 50px;
    padding: 4px 12px;
    vertical-align: middle;
  }

  .table thead th {
    background: var(--color-gray-500);
    color: var(--color-white);
    font-size: var(--fs-h6);
    font-weight: var(--fw-medium);
    line-height: 1;
    white-space: nowrap;
  }

  .table tbody tr:nth-child(even) { background: var(--color-blue-50); }

  /* Рамка строки при наведении — тенью на ячейках (outline у строки
     всегда прямоугольный). Угловые ячейки таблицы скруглены по внутреннему
     радиусу рамки, поэтому и синяя рамка в углах повторяет скругление */
  .table tbody tr:hover > * {
    box-shadow: inset 0 1px var(--color-blue), inset 0 -1px var(--color-blue);
  }

  .table tbody tr:hover > :first-child {
    box-shadow: inset 1px 0 var(--color-blue), inset 0 1px var(--color-blue), inset 0 -1px var(--color-blue);
  }

  .table tbody tr:hover > :last-child {
    box-shadow: inset -1px 0 var(--color-blue), inset 0 1px var(--color-blue), inset 0 -1px var(--color-blue);
  }

  .table tbody tr:hover > :only-child {
    box-shadow: inset 0 0 0 1px var(--color-blue);
  }

  .table > :first-child > tr:first-child > :first-child { border-top-left-radius: calc(var(--radius-quote) - 1px); }
  .table > :first-child > tr:first-child > :last-child  { border-top-right-radius: calc(var(--radius-quote) - 1px); }
  .table > :last-child > tr:last-child > :first-child   { border-bottom-left-radius: calc(var(--radius-quote) - 1px); }
  .table > :last-child > tr:last-child > :last-child    { border-bottom-right-radius: calc(var(--radius-quote) - 1px); }

  /* Узкие колонки: номер, время, дата — по содержимому, без переносов */
  .table__cell--fit {
    width: 1%;
    white-space: nowrap;
  }

  .table__cell--center { text-align: center; }

  .table--props th,
  .table--props td {
    height: 60px;
    padding: 8px 20px;
  }

  .table--props tbody th {
    width: 32.5%;
    border-right: 1px solid var(--color-border);
    font-size: var(--fs-h6);
    font-weight: var(--fw-medium);
    line-height: 1;
  }

  .table--props td {
    font-size: var(--fs-text-m);
    line-height: var(--lh-text-m);
  }

  .table--props a { color: var(--color-blue); text-decoration: none; }

  /* Журнал работ на узком экране не сжимается, а прокручивается */
  @media (width < 768px) {
    .table:not(.table--props) { min-width: 720px; }
  }

  /* === Карта сайта ======================================================= */
  /* Колонки ссылок, контакты и нижняя строка. Одна разметка на подвал
     и «Большое меню». Десктоп из макета: четыре колонки по 460px.
     Раскладки для планшета и телефона в макете нет — принял две колонки
     с 768px и одну ниже. Требует утверждения дизайнером. */

  .sitemap__cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .sitemap__col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
  }

  .sitemap__title {
    margin: 0 0 6px;
    font-size: var(--fs-h5);
    font-weight: var(--fw-medium);
    line-height: 1.2;
  }

  .sitemap__list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .sitemap__address {
    max-width: 320px;
    margin: 0;
    font-size: var(--fs-text-m);
    line-height: var(--lh-text-m);
  }

  .sitemap__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 40px;
    margin-top: 40px;
  }

  .sitemap__legal {
    color: var(--color-blue-100);
    font-size: var(--fs-text);
    font-weight: var(--fw-light);
    line-height: 18px;
    text-decoration: none;
  }


  .sitemap__engine {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-control);
    color: var(--color-white);
    font-size: var(--fs-text-s);
    line-height: 1.25;
    text-decoration: none;
  }

  .sitemap__engine-icon {
    width: 20px;
    height: 20px;
  }

  @media (width >= 768px) {
    .sitemap__cols {
      grid-template-columns: repeat(2, 1fr);
      gap: 40px;
    }
  }

  @media (width >= 1280px) {
    .sitemap__cols { grid-template-columns: repeat(4, 1fr); }
    .sitemap__engine { margin-left: auto; }
  }

  /* === Соцсети ============================================================ */
  /* Анимация из прототипа: при наведении Smart Animate, 0.3s, ease-out.
     Подложка из белой 20% становится белой, белый знак сжимается в точку
     в центре и гаснет, синий вырастает из этой точки. Уход курсора — то же
     в обратную сторону. Белый и синий знак — два файла на одном месте. */

  .social {
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .social__link {
    --social-ease: 0.3s ease-out;
    position: relative;
    display: block;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-control);
    background: rgba(255, 255, 255, 0.2);
    transition: background-color var(--social-ease);
  }

  .social__link::before,
  .social__link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: no-repeat center / 40px 40px;
    transition: transform var(--social-ease), opacity var(--social-ease);
  }

  /* Белый знак — виден в покое */
  .social__link::before { background-image: var(--icon); }

  /* Синий знак — ждёт в центре точкой */
  .social__link::after {
    background-image: var(--icon-hover);
    opacity: 0;
    transform: scale(0.1);
  }

  .social__link:hover,
  .social__link:focus-visible { background-color: var(--color-white); }

  .social__link:hover::before,
  .social__link:focus-visible::before {
    opacity: 0;
    transform: scale(0.1);
  }

  .social__link:hover::after,
  .social__link:focus-visible::after {
    opacity: 1;
    transform: none;
  }

  .social__link--max     { --icon: url(../img/soc-max.svg); --icon-hover: url(../img/soc-max-blue.svg); }
  .social__link--vk      { --icon: url(../img/soc-vk.svg); --icon-hover: url(../img/soc-vk-blue.svg); }
  .social__link--tg      { --icon: url(../img/soc-tg.svg); --icon-hover: url(../img/soc-tg-blue.svg); }
  .social__link--rutube  { --icon: url(../img/soc-rutube.svg); --icon-hover: url(../img/soc-rutube-blue.svg); }
  .social__link--youtube { --icon: url(../img/soc-youtube.svg); --icon-hover: url(../img/soc-youtube-blue.svg); }

  @media (prefers-reduced-motion: reduce) {
    .social__link { --social-ease: 0s; }
  }

  /* === Подвал ============================================================ */
  /* Высота на десктопе — 514px из макета, нижняя строка прижата к низу */

  .footer {
    display: flex;
    flex-direction: column;
    margin: 80px var(--page-gutter) var(--page-gutter);
    padding: 40px 20px;
    border-radius: var(--radius-block);
    background: var(--color-blue);
    color: var(--color-white);
  }

  @media (width >= 768px) {
    .footer {
      margin-top: 120px;
      padding: 60px 40px;
      border-radius: var(--radius-large);
    }
  }

  @media (width >= 1280px) {
    .footer {
      min-height: 514px;
      padding: 60px 80px;
    }

    .footer .sitemap__bottom { margin-top: auto; padding-top: 40px; }
  }
}
