/* ============ Footer ============ */
.footer{
  border-top:1px solid #CBD3E3;
  margin-top:120px;
  padding: 60px 0;
}
body.dark .footer{
  border-color:rgba(44, 48, 56, 1);
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr);
  grid-template-areas:
    "about home business aside"
    "about actions company aside";
  gap: 56px 80px;
}

/* ---------- О компании ---------- */
.footer__about { grid-area: about; }

.footer__logo { display: inline-block; }
.footer__logo img { width: auto; height: 30px; }

.footer__about-text {
  margin-top: 20px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-gray);
}

.footer__subtitle {
  margin-top: 48px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
}

.footer__thanks {
  margin-top: 14px;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.45;
}

.footer__stores {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}
.footer__stores img { width: auto; height: 40px; }

/* ---------- Колонки меню ---------- */
.footer__group--home { grid-area: home; }
.footer__group--business { grid-area: business; }
.footer__group--company { grid-area: company; }
.footer__actions { grid-area: actions; }
.footer__aside { grid-area: aside; }

.footer__title { font-size: 24px; font-weight: 500; }

.footer__acc-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  cursor: default;
}

.footer__acc-arrow {
  display: none;
  width: 10px;
  height: 6px;
  fill: currentColor;
  transition: transform 0.25s;
}

.footer__list {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  font-size: 16px;
}
.footer__list a { transition: color 0.2s; }
.footer__list a:hover { color: var(--color-accent); }

/* ---------- Кнопки ---------- */
.footer__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.btn--ghost {
  border: 1px solid #c7ccd2;
  color: var(--color-dark);
}
.btn--ghost:hover {
  border-color: var(--color-dark);
  background-color: rgba(255, 255, 255, 0.5);
}
body.dark .btn--ghost{
  color: var(--color-white);
}
body.dark .btn--ghost:hover{
  color: var(--color-accent);
  border-color: var(--color-accent);
  background-color: transparent;
}
/* ---------- Карточки ---------- */
.footer__aside {
  display: grid;
  gap: 32px;
  align-content: start;
}

.footer-card {
  padding: 28px;
  background-color: var(--color-white);
  border-radius: 20px;
}
body.dark .footer-card{
  background-color: rgba(149, 181, 242, 0.1);
}
.footer-card__title { font-size: 18px; font-weight: 700; }

.footer-card__text {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-gray);
}

.socials {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.socials__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid #d3d8dd;
  border-radius: 50%;
  color: #22262a;
  transition: border-color 0.2s, color 0.2s;
}
body.dark .socials__link{
  color: var(--color-white);
  border-color:var(--color-white);
}
.socials__link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.socials__link svg { width: 20px; height: 20px; }

/* ---------- Контакты ---------- */
.footer-contacts { margin-top: 18px; }
.footer-contacts__label {
  display: block;
  font-size: 15px;
  color: var(--color-gray);
}
.footer-contacts__label + .footer-contacts__phone { margin-top: 4px; }
.footer-contacts__phone + .footer-contacts__label { margin-top: 18px; }
.footer-contacts__phone {
  font-size: 24px;
  font-weight: 500;
  white-space: nowrap;
}
.footer-contacts__phone:hover { color: var(--color-accent); }

/* ---------- Нижняя строка ---------- */
.footer__bottom {
  border-top: 1px solid #d9dde1;
  margin-top:60px;
}
body.dark .footer__bottom{
  border-color:rgba(255, 255, 255, 0.1);
}
.footer__bottom-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr) auto;
  gap: 24px 60px;
  align-items: start;
  padding: 28px 0 40px;
  font-size: 16px;
}

.footer__copy {
  display: grid;
  gap: 6px;
}
.footer__copy a:hover { color: var(--color-accent); }

.footer__cookies {
  max-width: 760px;
  line-height: 1.6;
  color: var(--color-gray);
}
.footer__cookies a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer__cookies a:hover { color: var(--color-accent); }

.footer__dev {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}
.footer__dev img { width: auto; height: 26px; }

/* ============ Адаптив ============ */
@media (max-width: 1280px) {
  .footer__grid { gap: 48px; }
}

/* ≤1024: мобильный шаблон — колонки в аккордеон */
@media (max-width: 1024px) {
  .footer{
    margin-top:60px;
    padding: 40px 0;
  }
  .footer__grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .footer__about { margin-bottom: 36px; }
  .footer__subtitle { margin-top: 36px; font-size: 26px; }

  /* порядок блоков по макету */
  .footer__group--home { order: 2; }
  .footer__group--business { order: 3; }
  .footer__group--company { order: 4; }
  .footer__actions { order: 5; }
  .footer__aside { order: 6; }

  /* аккордеон */
  .footer__group { border-bottom: 1px solid #d9dde1; }
  .footer__group--home { border-top: 1px solid #d9dde1; }

  .footer__acc-btn {
    padding: 18px 0;
    font-size: 18px;
    cursor: pointer;
  }
  .footer__acc-arrow { display: block; }
  .footer__group.is-open .footer__acc-arrow { transform: rotate(180deg); }

  /* плавное раскрытие через grid-template-rows */
  .footer__acc-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s ease;
  }
  .footer__group.is-open .footer__acc-body { grid-template-rows: 1fr; }

  .footer__acc-body > .footer__list {
    overflow: hidden;
    min-height: 0;
    margin-top: 0;
    gap: 14px;
  }

   .footer__group.is-open .footer__list {
        padding-bottom: 18px;
   }
  /* кнопки на всю ширину */
  .footer__actions {
    width: 100%;
    margin-top: 32px;
    gap: 12px;
  }
  .footer__actions .btn { width: 100%; }

  /* карточки */
  .footer__aside { margin-top: 32px; gap: 16px; }
  .footer-card { padding: 24px; }
  .footer-contacts__phone { font-size: 20px; }

  .footer__bottom{
    margin-top:40px;
  }
  .footer__bottom-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px 0 32px;
  }
}