.footer { background: var(--color-primary); color: rgba(255,255,255,0.7); padding: 60px 0 20px; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
/* Головна має 5-ту колонку «Зв'язок» — розширюємо сітку до 5 доріжок, щоб вона не
   стрибала на новий рядок (порожнеча праворуч). Сторінки з 4 колонками :has() не чіпає.
   Лише десктоп: на мобільному нижче лишається 2-колонкова розкладка. */
@media (min-width: 769px) {
  /* остання колонка «Зв'язок» ширша — щоб телефон/email не ламались посеред рядка */
  .footer__grid:has(> div:nth-child(5)) { grid-template-columns: 2fr 1fr 1fr 1fr 1.35fr; }
  .footer__grid:has(> div:nth-child(5)) > div:nth-child(5) p:first-of-type { white-space: nowrap; }
}
.footer__title { color: var(--color-white); font-weight: 600; margin-bottom: 16px; }
.footer__links { display: flex; flex-direction: column; gap: 8px; }
.footer__links a:hover { color: var(--color-accent); }
.footer__bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; font-size: 0.85rem; }

@media (max-width: 768px) {
  .footer { padding: 32px 0 16px; }
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px 20px;
    margin-bottom: 24px;
  }
  .footer__grid > div:first-child {
    grid-column: 1 / -1;
    display: flex; align-items: center; gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .footer__grid > div:first-child p { margin: 0; font-size: 0.85rem; }
  .footer__title { margin-bottom: 10px; font-size: 0.85rem; }
  .footer__links { gap: 6px; font-size: 0.88rem; }
  .footer__bottom { padding-top: 16px; }
}

/* ── Акордеон груп посилань: <details class="footer__acc" open> ──────────────
   Десктоп/планшет — завжди розгорнуто, summary виглядає як звичайний заголовок
   і не клікабельний. Згортання — лише ≤600px (JS у main.js знімає open). */
.footer__acc > summary { list-style: none; cursor: default; pointer-events: none; }
.footer__acc > summary::-webkit-details-marker { display: none; }
.footer__acc > summary::marker { content: ''; }

/* ── Платіжний рядок + реквізити оператора (вставляє main.js, #footer-pay-row) ── */
.footer-pay { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; justify-content: space-between;
  padding: 16px 0; margin-top: 8px; border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.84rem; }
.footer-pay__methods { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.footer-pay__lbl { opacity: .75; }
.footer-pay__logo { display: inline-flex; align-items: center; background: #fff; border-radius: 6px; padding: 5px 9px; text-decoration: none; }
.footer-pay__logo img { display: block; height: 20px; width: auto; }
.footer-pay__cards { opacity: .65; }
.footer-pay__operator { opacity: .75; line-height: 1.5; }
.footer-pay__note { opacity: .6; font-size: 0.85em; margin-top: 3px; line-height: 1.4; max-width: 520px; }
.footer-pay__policy { flex-basis: 100%; display: flex; gap: 14px; flex-wrap: wrap; opacity: .75; font-size: 0.9em; }
.footer-pay__policy a { color: inherit; }

/* ═══ 📱 Компактний футер (≤600px) ═══════════════════════════════════════════
   Правила з !important / подвійним класом — щоб перебити responsive.css (≤768/≤480),
   який підключається ПІСЛЯ цього файлу. */
@media (max-width: 600px) {
  .footer.footer { padding: 24px 0 calc(76px + env(safe-area-inset-bottom, 0px)); }  /* під «Помічника» над нижньою навігацією */
  .footer .footer__grid { grid-template-columns: 1fr !important; gap: 0 !important; margin-bottom: 8px; }
  .footer .footer__grid > div { padding: 0 !important; border-bottom: 1px solid rgba(255,255,255,0.08); }

  /* Бренд: лого + слоган в один рядок; котика ховаємо */
  .footer .footer__grid > div:first-child { display: flex !important; flex-direction: column; align-items: center; gap: 4px;
    padding: 0 0 16px !important; text-align: center; }
  .footer .footer__grid > div:first-child > div:first-child { margin-bottom: 0 !important; font-size: 1.5rem !important; justify-content: center; }
  .footer .footer__grid > div:first-child p { margin: 0; font-size: 0.82rem; line-height: 1.4 !important; opacity: .85; }
  .footer .footer__grid > div:first-child p br { display: none; }
  .footer .footer-mascot { display: none; }

  /* Акордеон: 44px зона дотику, шеврон */
  .footer .footer__acc > summary { pointer-events: auto; cursor: pointer; display: flex; align-items: center;
    justify-content: space-between; min-height: 48px; -webkit-tap-highlight-color: transparent; }
  .footer .footer__acc > summary::after { content: ''; width: 8px; height: 8px; margin-right: 4px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px);
    transition: transform .2s ease; opacity: .7; }
  .footer .footer__acc[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
  .footer .footer__acc > summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 4px; }
  .footer .footer__acc .footer__title { margin: 0; font-size: 0.95rem; }
  .footer .footer__acc .footer__links { flex-direction: column !important; gap: 0 !important; padding: 0 0 10px; }
  .footer .footer__acc .footer__links a { display: flex; align-items: center; min-height: 44px; font-size: 0.92rem; }
  .footer .footer__acc .footer__links a:hover { transform: none; }

  /* Зв'язок: ряд круглих іконок + «Написати нам» на всю ширину */
  .footer .footer__contact { display: flex !important; flex-wrap: wrap; justify-content: center; gap: 10px;
    padding: 16px 0 !important; border-bottom: 0 !important; }
  .footer .footer__contact .footer__title { flex-basis: 100%; margin: 0 0 2px; font-size: 0.95rem; text-align: center; }
  .footer .footer__contact > p:not(.footer__cta) { position: relative; margin: 0 !important; width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); font-size: 1.1rem !important; line-height: 1; }
  .footer .footer__contact > p:not(.footer__cta) > a { position: absolute; inset: 0; border-radius: 50%;
    font-size: 0; color: transparent !important; overflow: hidden; }
  .footer .footer__contact > p:not(.footer__cta) > a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
  .footer .footer__contact > p:not(.footer__cta):active { transform: scale(0.94); }
  .footer .footer__cta { flex-basis: 100%; margin: 6px 0 0 !important; }
  .footer .footer__cta > a { display: flex !important; align-items: center; justify-content: center; gap: 6px;
    width: 100%; min-height: 46px; padding: 10px 16px !important; font-size: 0.95rem !important; }

  /* Оплата — один рядок; реквізити оператора — видимі, але дрібніше й щільніше */
  .footer .footer-pay { flex-direction: column; align-items: center; gap: 10px; padding: 14px 0 10px; margin-top: 0; text-align: center; font-size: 0.8rem; }
  .footer .footer-pay__methods { flex-wrap: nowrap; justify-content: center; gap: 8px; }
  .footer .footer-pay__lbl { white-space: nowrap; }
  .footer .footer-pay__logo { padding: 4px 7px; }
  .footer .footer-pay__logo img { height: 16px; }
  .footer .footer-pay__cards { white-space: nowrap; }
  .footer .footer-pay__operator { font-size: 0.72rem; line-height: 1.35; opacity: .62; }
  .footer .footer-pay__note { font-size: 0.7rem; line-height: 1.35; margin: 0 auto; opacity: .55; }
  .footer .footer-pay__policy { justify-content: center; gap: 4px 14px; font-size: 0.8rem; }
  .footer .footer-pay__policy a { display: inline-flex; align-items: center; min-height: 32px; }
  .footer .footer__bottom { padding: 12px 0 0; font-size: 0.74rem; opacity: .8; }
}
@media (max-width: 360px) {
  .footer .footer-pay__lbl { display: none; }   /* дуже вузько: лише лого + Visa · Mastercard */
}
