/* ===== Footer wrap (для вынесенной жёлтой молекулы) ===== */
.footer-wrap{ 
  position: relative; 
  background: #fff;
  z-index: 1;
}

/* Верхняя молекула через before */
.footer-wrap::before{
  content: "";
  position: absolute;
  right: 24px;
  top: -28px;
  width: 130px;
  height: 94px;
  pointer-events: none;
  z-index: 3;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg width='115' height='83' viewBox='0 0 115 83' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M57.0002 43C60.9001 42.9968 64.7902 44.7669 68.0002 47L74.0002 39C70.2437 34.745 68.9252 29.6962 69.0002 24C69.0752 18.3038 71.133 12.1529 75.0002 8.00001C78.8674 3.84707 84.3669 1.43388 90.0002 1.00001C95.6335 0.566138 100.552 2.4875 105 6.00001C109.448 9.51252 113.068 14.3814 114 20C114.932 25.6186 113.072 31.2191 110 36C106.928 40.781 102.467 44.5616 97.0002 46C91.5336 47.4385 85.9974 46.6577 81.0002 44L73.0002 52C74.8628 55.054 76.0287 58.4149 76.0002 62C76.0188 65.0584 75.3585 68.2653 74.0002 71C72.6419 73.7347 70.4403 76.1832 68.0002 78C65.5601 79.8169 62.992 81.4957 60.0002 82C57.0084 82.5043 53.8937 81.9179 51.0002 81C48.1067 80.0821 45.1667 78.1406 43.0002 76C40.8337 73.8594 39.9691 71.8983 39.0002 69C38.0313 66.1017 37.561 63.0263 38.0002 60C38.4394 56.9737 39.2483 53.4968 41.0002 51L28.0002 37C24.9578 39.2809 20.7897 41.1136 17.0002 41C13.2106 40.8864 9.90282 39.4592 7.0002 37C4.09758 34.5408 1.76428 30.7443 1.0002 27C0.236115 23.2557 1.29627 19.4149 3.0002 16C4.70413 12.5851 7.56299 9.61299 11.0002 8.00001C14.4374 6.38703 18.3118 6.11556 22.0002 7.00001C25.6886 7.88446 28.6511 9.9995 31.0002 13C33.3493 16.0005 35.0033 20.1773 35.0002 24C34.9987 27.1943 33.6859 30.2955 32.0002 33L46.0002 47C49.298 44.5417 52.899 42.9857 57.0002 43Z' fill='%23EEC024'/%3E%3C/svg%3E");
}

/* Жёлтая молекула (скрываем) */
.footer__yellow{
  display: none;
}

/* ===== Footer ===== */
.footer{
  position: relative;
  background: #fff;
  padding: 56px 0 72px;
  border-top: none;
  overflow: hidden;
  min-height: 300px;
}

/* Убеждаемся, что кнопка cookie позиционируется относительно footer */
.footer .footer__cookie-btn{
  position: absolute;
}
.footer .container{ position: relative; z-index: 2; }

/* ===== Сетка: Лого + 3 столбца (2 ряда) ===== */
.footer__layout{
  --logo-col: 240px;
  display: grid;
  gap: 70px 48px;
  grid-template-columns: var(--logo-col) 1fr 1fr 1fr;
  grid-auto-rows: auto;
  align-items: start;
}
.footer__logo{ grid-column: 1 / 2; grid-row: 1 / 3; }
.footer__top-addr  { grid-column: 2; grid-row: 1; }
.footer__top-mail  { grid-column: 3; grid-row: 1; }
.footer__top-phone { grid-column: 4; grid-row: 1; }
.footer__bot-col1  { grid-column: 2; grid-row: 2; }
.footer__bot-col2  { grid-column: 3; grid-row: 2; }
.footer__bot-col3  { grid-column: 4; grid-row: 2; }

/* ===== Контурная молекула в колонке с пунктами ===== */
.footer-molecule{ position: relative; }
.footer-molecule::before{
  content:"";
  position:absolute; left:-39%; top:132%;
  transform: translate(-50%,-50%);
  width: min(500px, 200%);
  aspect-ratio: 519 / 380;
  pointer-events:none; z-index:0;
  background:no-repeat center/contain url("data:image/svg+xml,%3Csvg width='519' height='380' viewBox='0 0 519 380' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M405.776 0.791016C431.46 -1.22553 457.129 7.34321 477.424 23.6816C497.721 40.0218 511.992 63.2484 516.243 89.3721C520.495 115.497 514.334 142.783 500.314 165.025C486.302 187.258 464.543 203.121 439.607 209.81C414.679 216.497 388.77 213.212 365.976 200.853L365.629 200.664L365.365 200.958L330.365 239.958L330.119 240.232L330.308 240.549C338.797 254.739 343.367 271.627 343.237 288.288V288.295C343.322 302.517 340.476 316.371 334.287 329.073C328.102 341.769 318.568 352.443 307.435 360.894C296.296 369.348 284.266 375.461 270.652 377.8C257.021 380.142 243.077 379.081 229.891 374.816C216.702 370.551 203.964 362.883 194.092 352.939C184.217 342.993 176.629 330.605 172.212 317.137C167.8 303.682 167.228 289.444 169.232 275.362C171.235 261.294 176.165 248.174 184.148 236.575L184.376 236.246L184.104 235.953L123.104 169.953L122.795 169.618L122.434 169.895C108.572 180.489 91.9958 186.319 74.752 185.792C57.5098 185.265 41.2904 178.338 28.0635 166.914C14.8384 155.492 5.70658 140.574 2.22754 123.194C-1.25593 105.792 0.430946 87.3572 8.18652 71.5117C15.9424 55.6659 29.2908 43.236 44.9531 35.7432C60.6188 28.2488 77.8408 25.6769 94.6182 29.7783C111.415 33.8844 126.644 43.668 137.341 57.5967C148.03 71.5161 153.252 89.5222 153.237 107.292C153.231 122.145 149.98 136.488 142.311 149.031L142.113 149.354L142.37 149.632L203.37 215.632L203.678 215.965L204.04 215.69C219.076 204.264 237.058 197.725 255.735 197.792H255.737C273.507 197.777 290.819 203.325 305.448 213.7L305.813 213.96L306.111 213.624L337.111 178.624L337.401 178.296L337.115 177.965C319.983 158.181 310.895 131.8 311.237 105.299C311.58 78.8054 321.464 53.9433 339.106 34.6289C356.757 15.3064 380.098 2.80722 405.776 0.791016Z' stroke='%23EEC024'/%3E%3C/svg%3E");
}

/* ===== Типографика ===== */
.footer__label{ font-size:14px; color:var(--_brand-gray); margin-bottom:8px; }
.footer__contact{
  font-size:24px; line-height:1.35;
  color: var(--_brand-gray);
}
.footer__contact a{ color:inherit; text-decoration:none; }
.footer__contact a:hover{ text-decoration:underline; }

/* ===== Ссылки: столбиком, подчёркивание только по тексту ===== */
.footer__links{
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:flex-start;      /* ключ для избежания растяжения ссылок */
}
.footer__links a{
  display:inline-block;        /* измерение по тексту */
  align-self:flex-start;       /* не тянуться на всю ширину */
  width:auto;
  color: var(--_brand-gray);
  text-decoration:none;
  border-bottom:1px dashed transparent;
  transition:border-color .15s ease;
}
.footer__links a:hover{ border-color: currentColor; }

/* ===== Кнопка отзыва согласия на cookie ===== */
.footer__cookie-btn{
  position:absolute;
  bottom:20px;
  right:20px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:12px 20px;
  background:var(--brand-yellow);
  color:var(--brand-gray);
  border:none;
  z-index:10; /* выше всех элементов футера */
  border-radius:999px;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  box-shadow:0 4px 12px rgba(0,0,0,.15);
  transition:transform .2s ease, box-shadow .2s ease;
}
.footer__cookie-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 6px 16px rgba(0,0,0,.2);
}
.footer__cookie-btn svg{
  width:20px;
  height:20px;
  flex-shrink:0;
}
@media (max-width:768px){
  /* Увеличиваем минимальную высоту футера на мобильной чтобы кнопка не обрезалась */
  .footer{
    min-height: 350px;
    padding-bottom: 80px; /* оставляем место для кнопки */
  }
  
  .footer__cookie-btn{
    bottom:16px;
    right:16px;
    left:auto;
    padding:10px 16px;
    font-size:13px;
    z-index:10; /* гарантируем высокий z-index на мобильной версии */
    pointer-events:auto; /* убеждаемся что клики работают */
    position: absolute !important; /* важно для мобильной */
  }
  .footer__cookie-btn svg{
    width:18px;
    height:18px;
  }
}

/* ===== Адаптив ===== */
@media (max-width:1280px) {.footer-molecule::before{left: -35%;top: 112%;}}
@media (max-width:1200px){ .footer__layout{ --logo-col:200px; } }
@media (max-width:992px){
  .footer__layout{
    --logo-col:180px;
    grid-template-columns: var(--logo-col) 1fr 1fr;
  }
  .footer__top-mail, .footer__bot-col2{ grid-column:2; }
  .footer__top-phone, .footer__bot-col3{ grid-column:3; }
}
@media (max-width:560px){
  .footer{ padding:32px 0 40px; }
  .footer__layout{ --logo-col:140px; grid-template-columns:1fr; gap:24px; }
  .footer__contact{ font-size:20px; }
}
/* ===== Адаптив: до 1280px ===== */
@media (max-width:1280px) {
  .footer__layout{
    --logo-col: 200px;
    grid-template-columns: var(--logo-col) 1fr 1fr;
    gap: 48px 40px;
  }

  /* центрируем адрес / почту / телефон столбцом */
  .footer__top-addr  { grid-column: 2; grid-row: 1; }
  .footer__top-mail  { grid-column: 2; grid-row: 2; }
  .footer__top-phone { grid-column: 2; grid-row: 3; }

  /* справа: правовые документы и согласия */
  .footer__bot-col2 { grid-column: 3; grid-row: 1; }
  .footer__bot-col3 { grid-column: 3; grid-row: 2; }

  /* ссылки (о нас, мероприятия, контакты) под логотипом */
  .footer__bot-col1 { grid-column: 1; grid-row: 2; }
}

/* ===== ≤1024px: логотип отдельной строкой, ниже 3 колонки ===== */
@media (max-width:1024px){

  /* сетка: [logo full-width] + 3 колонки ниже */
  .footer__layout{
    grid-template-columns: 1fr 1fr 1fr; /* три равных колонки */
    grid-template-rows: auto;           /* строка с логотипом */
    grid-auto-rows: auto;               /* последующие строки автоматически */
    gap: 40px 40px;
  }

  /* ЛОГО — на всю первую строку */
  .footer__logo{
    grid-column: 1 / -1;
    grid-row: 1;
  }

  /* 1-й столбец: меню (под логотипом одной колонкой) */
  .footer__bot-col1{
    grid-column: 1;
    grid-row: 2;          /* начинается со 2-й строки, ниже логотипа */
    align-self: start;
  }

  /* 2-й столбец: Адрес → E-mail → Телефон (одной колонкой) */
  .footer__top-addr  { grid-column: 2; grid-row: 2; }
  .footer__top-mail  { grid-column: 2; grid-row: 3; position: relative;top: -30%;}
  .footer__top-phone { grid-column: 2; grid-row: 4; }

  /* 3-й столбец: СОПД/СОПДР (верх) + Антикоррупция/ПК (низ) */
  .footer__bot-col3  { grid-column: 3; grid-row: 2; } /* СОПД / СОПДР */
  .footer__bot-col2  { grid-column: 3; grid-row: 3; } /* Антикоррупция / ПК */

  /* ритм: большой gap только у левого меню */
  .footer__bot-col1.footer__links{ gap: var(--gap-xxl); }

  /* у центра создаём «разрыв» между верхом и низом */
  .footer__top-addr{ margin-bottom: var(--gap-xxl); }
  .footer__top-mail{ margin-bottom: var(--gap-xxl); }

  /* базовый gap у правых списков */
  .footer__bot-col2.footer__links,
  .footer__bot-col3.footer__links{ gap: 10px;}

   .footer__bot-col2.footer__links {position: relative;top: 0%;}
  /* типографика: левый столбец — крупный акцент */
  .footer__bot-col1.footer__links a{
    color: var(--accent);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    border-bottom: none;
    text-decoration: none;
  }

  /* правый столбец — ссылки с подчёркиванием и акцентным цветом */
  .footer__bot-col2.footer__links a,
  .footer__bot-col3.footer__links a{
    color: var(--accent);
    border-bottom: none;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  /* Жёлтая (залитая) молекула в правом-нижнем углу футера */
  .footer__yellow{
    top: auto;
    bottom: 24px;
    right: 20%;
    width: 120px;
    height: 86px;
  }

  /* Контурная молекула — под список 1-го столбца, крупнее */
  .footer__bot-col1.footer-molecule{ position: relative; }
  .footer__bot-col1.footer-molecule::before{
    left: -30%;
    bottom: -180%;     /* подталкиваем под список */
    top: auto;
    transform: none;
    width: min(560px, 120%);  /* увеличили */
    aspect-ratio: 519 / 380;
    background-position: left bottom;
    z-index: 0;        /* под текстом */
    pointer-events: none;
  }
}



/* ===== Планшет ≤768px ===== */
@media (max-width:768px){
  .footer__layout{
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto;
    grid-auto-rows: auto;
    gap: 32px 24px;
  }

  /* Лого сверху на всю ширину */
  .footer__logo{
    grid-column: 1 / -1;
    grid-row: 1;
  }

  /* Левый столбец */
  .footer__bot-col1{
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    gap: var(--gap-xxl);
  }
  .footer__bot-col1.footer__links a{
    color: var(--accent);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    border: none;
    text-decoration: none;
  }

  /* Центральный столбец */
  .footer__top-addr { grid-column: 2; grid-row: 2; margin-bottom: var(--gap-xxl); }
  .footer__top-mail { grid-column: 2; grid-row: 3; margin-bottom: var(--gap-xxl); margin-top: var(--fs-xxl);}
  .footer__top-phone{ grid-column: 2; grid-row: 4; }

  /* Правый столбец */
  .footer__bot-col3{ grid-column: 3; grid-row: 2; }
  .footer__bot-col2{ grid-column: 3; grid-row: 3;margin-top: var(--fs-xxl);}
  .footer__bot-col2.footer__links,
  .footer__bot-col3.footer__links{
    gap: 10px;
  }
  .footer__bot-col2.footer__links a,
  .footer__bot-col3.footer__links a{
    color: var(--accent);
    border: none;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  /* Жёлтая молекула — переносим в левый нижний угол */
  .footer__yellow{
    top: auto;
    bottom: 16px;
    left: 16px;
    right: auto;
    width: 100px;
    height: 72px;
  }

  /* Контурную убираем */
  .footer-molecule::before{ display: none; }
}


/* ===== Мобильный ≤480px (финальные правки) ===== */
@media (max-width:480px){
  .footer{ padding:28px 0 36px; }

  /* Скрываем верхнюю молекулу на мобильных */
  .footer-wrap::before{
    display: none;
  }

  .footer__layout{
    position:relative;
    display:grid;
    grid-template-columns:1fr 1fr;   /* 2 колонки */
    grid-auto-rows:auto;
    gap:20px 24px;

    /* разделительная линия посередине между молекулой/телефоном и блоками согласия */
    background:
      linear-gradient(var(--brand-yellow),var(--brand-yellow))
      0 calc(100% - 40%) / 100% 6px no-repeat;
  }

  /* Кружки на концах линии (левый и правый) — точно по центру линии */
  .footer__layout::before,
  .footer__layout::after{
    content:"";
    position:absolute;
    bottom: calc(40% - 6px);  /* смещение для центрирования с линией 6px */
    width:12px; height:12px;
    border-radius:50%;
    background:var(--brand-yellow);
  }
  .footer__layout::before{ left:0; }
  .footer__layout::after { right:0; }

  /* ЛОГО */
  .footer__logo{ grid-column:1 / -1; grid-row:1; }

  /* Левый столбец (меню) — под логотипом */
  .footer__bot-col1{ grid-column:1; grid-row:2; gap:var(--gap-xxl); align-self:start; }
  .footer__bot-col1.footer__links a{
    color:var(--accent); font-size:20px; font-weight:700; line-height:1.2;
    border:none; text-decoration:none;
  }

  /* Молекула в левом столбце, под списком */
  .footer__bot-col1{ position:relative; padding-bottom:64px; }
  .footer__bot-col1::after{
    content:"";
    position:absolute; left:0; bottom: -100px;
    width:88px; height:64px;
    background:no-repeat center/contain
      url("data:image/svg+xml,%3Csvg width='115' height='83' viewBox='0 0 115 83' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M57.0002 43C60.9001 42.9968 64.7902 44.7669 68.0002 47L74.0002 39C70.2437 34.745 68.9252 29.6962 69.0002 24C69.0752 18.3038 71.133 12.1529 75.0002 8.00001C78.8674 3.84707 84.3669 1.43388 90.0002 1.00001C95.6335 0.566138 100.552 2.4875 105 6.00001C109.448 9.51252 113.068 14.3814 114 20C114.932 25.6186 113.072 31.2191 110 36C106.928 40.781 102.467 44.5616 97.0002 46C91.5336 47.4385 85.9974 46.6577 81.0002 44L73.0002 52C74.8628 55.054 76.0287 58.4149 76.0002 62C76.0188 65.0584 75.3585 68.2653 74.0002 71C72.6419 73.7347 70.4403 76.1832 68.0002 78C65.5601 79.8169 62.992 81.4957 60.0002 82C57.0084 82.5043 53.8937 81.9179 51.0002 81C48.1067 80.0821 45.1667 78.1406 43.0002 76C40.8337 73.8594 39.9691 71.8983 39.0002 69C38.0313 66.1017 37.561 63.0263 38.0002 60C38.4394 56.9737 39.2483 53.4968 41.0002 51L28.0002 37C24.9578 39.2809 20.7897 41.1136 17.0002 41C13.2106 40.8864 9.90282 39.4592 7.0002 37C4.09758 34.5408 1.76428 30.7443 1.0002 27C0.236115 23.2557 1.29627 19.4149 3.0002 16C4.70413 12.5851 7.56299 9.61299 11.0002 8.00001C14.4374 6.38703 18.3118 6.11556 22.0002 7.00001C25.6886 7.88446 28.6511 9.9995 31.0002 13C33.3493 16.0005 35.0033 20.1773 35.0002 24C34.9987 27.1943 33.6859 30.2955 32.0002 33L46.0002 47C49.298 44.5417 52.899 42.9857 57.0002 43Z' fill='%23EEC024'/%3E%3C/svg%3E");
  }

  /* Контакты (справа) */
  .footer__top-addr  { grid-column:2; grid-row:2; }
  .footer__top-mail  { grid-column:2; grid-row:3; position: relative;top: -100px;}
  .footer__top-phone { grid-column:2; grid-row:3; }
  .footer__contact{ font-size:18px; }

  /* Нижние два столбца — ПОМЕНЯНЫ МЕСТАМИ:
     col3 (cookie-согласия) слева, col2 (антикоррупция/политика) справа */
  .footer__bot-col3{ grid-column:1; grid-row:7; align-self:start; margin-top:32px; }
  .footer__bot-col2{ grid-column:2; grid-row:7; align-self:start; margin-top:32px; }
  .footer__bot-col2.footer__links,
  .footer__bot-col3.footer__links{ gap:10px; }
  .footer__bot-col2.footer__links a,
  .footer__bot-col3.footer__links a{
    color:var(--accent);
    text-decoration:underline;
    text-underline-offset:2px;
    border:none;
  }
/* Убираем дополнительный отступ для выравнивания блоков */

  /* скрыть контурную/вынесенную молекулу на мобилке */
  .footer-molecule::before{ display:none; }
  .footer__yellow{ display:none; }
}

/* ===== Специфичная корректировка для диапазона 423-480px ===== */
@media (min-width:423px) and (max-width:480px){
  .footer__layout{
    /* линия опущена ниже для этого диапазона */
    background:
      linear-gradient(var(--brand-yellow),var(--brand-yellow))
      0 calc(100% - 36%) / 100% 6px no-repeat;
  }
  
  /* точки для этого диапазона */
  .footer__layout::before,
  .footer__layout::after{
    bottom: calc(36% - 5px);
  }
}
