/* Футер сайта (макет A3). Токены совпадают с Figma «ArtDveri / Color» и шапкой (header.css). */

.ad-footer {
  --ad-primary: #FBB917;
  --ad-primary-hover: #EDB021;
  --ad-ink: #1C222A;
  --ad-dark: #393939;
  --ad-bar: #494D4E;
  --ad-subtle: #959EA9;
  --ad-border: #E6E6E6;
  --ad-white: #FFFFFF;
  --ad-radius-sm: 6px;
  --ad-radius-md: 10px;
  --ad-radius-lg: 16px;
  --ad-focus: 0 0 0 3px rgba(251, 185, 23, .55);
  margin-top: auto;
  background: var(--ad-bar);
  color: var(--ad-border);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  line-height: 20px;
}
.ad-footer *, .ad-footer *::before, .ad-footer *::after { box-sizing: border-box; }
:where(.ad-footer) ul { list-style: none; margin: 0; padding: 0; }
:where(.ad-footer) p, :where(.ad-footer) h2 { margin: 0; }
:where(.ad-footer) a { color: inherit; text-decoration: none; }
:where(.ad-footer) button { font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer; }
.ad-footer :focus-visible { outline: none; box-shadow: var(--ad-focus); border-radius: var(--ad-radius-sm); }
.ad-footer .ad-icon { flex-shrink: 0; display: block; }

.ad-footer__container { max-width: 1440px; margin: 0 auto; padding: 0 40px; }

/* ---------- CTA ---------- */
.ad-footer__cta {
  display: flex; align-items: center; gap: 24px; margin-top: 48px; padding: 24px 32px;
  border-radius: var(--ad-radius-lg); background: var(--ad-primary); color: var(--ad-ink);
}
.ad-footer__cta-icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 56px; height: 56px; border-radius: var(--ad-radius-md); background: var(--ad-ink); color: var(--ad-primary);
}
.ad-footer__cta-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ad-footer__cta-title { font-size: 24px; line-height: 32px; font-weight: 700; color: var(--ad-ink); }
.ad-footer__cta-sub { max-width: 680px; }
.ad-footer__cta-actions { display: flex; gap: 12px; flex-shrink: 0; }

.ad-footer__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  border-radius: var(--ad-radius-md); font-weight: 600 !important; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.ad-footer__btn--dark { background: var(--ad-dark) !important; color: var(--ad-white) !important; }
.ad-footer__btn--dark .ad-icon { color: var(--ad-primary); }
.ad-footer__btn--dark:hover { background: var(--ad-ink) !important; }
.ad-footer__btn--light { background: var(--ad-white) !important; color: var(--ad-ink) !important; border: 1px solid var(--ad-border) !important; }
.ad-footer__btn--light:hover { border-color: var(--ad-ink) !important; }

/* ---------- основная сетка ---------- */
.ad-footer__main {
  display: grid; gap: 20px 48px; padding: 48px 0;
  grid-template-columns: 340px minmax(0, 1fr) minmax(0, 1fr) 320px;
  grid-template-areas:
    "brand   catalog info contacts"
    "socials catalog info contacts";
  grid-template-rows: auto 1fr;
}
.ad-footer__brand { grid-area: brand; display: flex; flex-direction: column; gap: 20px; }
.ad-footer__socials { grid-area: socials; }
.ad-footer__group--catalog { grid-area: catalog; }
.ad-footer__group--info { grid-area: info; }
.ad-footer__contacts { grid-area: contacts; display: flex; flex-direction: column; gap: 16px; }

.ad-footer__logo { display: inline-flex; align-self: flex-start; }
.ad-footer__logo img { display: block; height: 42px; width: auto; max-width: 180px; object-fit: contain; }
.ad-footer__logo-text { font-size: 22px; font-weight: 800; color: var(--ad-primary); }

.ad-footer__heading {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 18px; line-height: 24px; font-weight: 600; color: var(--ad-white);
}
.ad-footer__group > summary { list-style: none; cursor: default; }
.ad-footer__group > summary::-webkit-details-marker { display: none; }
.ad-footer__group > summary .ad-icon { display: none; }
.ad-footer__links { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.ad-footer__links a { transition: color .15s ease; }
.ad-footer__links a:hover { color: var(--ad-white); }
.ad-footer__links a.is-accent { color: var(--ad-primary); font-weight: 600; }
.ad-footer__links a.is-accent:hover { color: var(--ad-primary-hover); }

.ad-footer__phones { display: flex; flex-direction: column; gap: 8px; }
.ad-footer__phone {
  display: inline-flex; align-items: center; gap: 12px; font-size: 18px; line-height: 24px; font-weight: 700;
  color: var(--ad-white) !important; transition: color .15s ease;
}
.ad-footer__phone .ad-icon { color: var(--ad-primary); }
.ad-footer__phone:hover { color: var(--ad-primary) !important; }
.ad-footer__details { display: flex; flex-direction: column; gap: 12px; }
.ad-footer__detail { display: flex; align-items: flex-start; gap: 12px; }
.ad-footer__detail .ad-icon { color: var(--ad-primary); }
.ad-footer__detail a { overflow-wrap: anywhere; transition: color .15s ease; }
.ad-footer__detail a:hover { color: var(--ad-white); }
.ad-footer__link-btn {
  align-self: flex-start; font-weight: 600 !important; color: var(--ad-primary) !important; transition: color .15s ease;
}
.ad-footer__link-btn:hover { color: var(--ad-primary-hover) !important; }

.ad-footer__socials-title { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ad-subtle); }
.ad-footer__socials-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ad-footer__social {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: var(--ad-radius-md); background: var(--ad-dark); color: var(--ad-white);
  transition: background-color .15s ease, color .15s ease;
}
.ad-footer__social svg { max-width: 20px; max-height: 20px; }
.ad-footer__social svg:not(.ad-icon) path { fill: currentColor; }
.ad-footer__social:hover { background: var(--ad-primary); color: var(--ad-ink); }

/* ---------- нижняя полоса ---------- */
.ad-footer__bottom { background: var(--ad-dark); font-size: 12px; line-height: 16px; }
.ad-footer__bottom-row { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; padding-top: 16px; padding-bottom: 16px; }
.ad-footer__legal { display: flex; flex-direction: column; gap: 2px; }
.ad-footer__muted { color: var(--ad-subtle); }
.ad-footer__payments { display: flex; align-items: center; gap: 12px; }
.ad-footer__payments-logos { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--ad-radius-sm); background: var(--ad-white); }
.ad-footer__payments-logos img { display: block; height: 20px; width: auto; }
.ad-footer__end { display: flex; align-items: center; gap: 24px; }
.ad-footer__top {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 12px; border-radius: var(--ad-radius-md);
  background: var(--ad-bar); color: var(--ad-white) !important; font-weight: 600; transition: background-color .15s ease;
}
.ad-footer__top .ad-icon { color: var(--ad-primary); }
.ad-footer__top:hover { background: var(--ad-ink); }

/* ---------- планшет ---------- */
@media (max-width: 1279.98px) {
  .ad-footer__main {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "brand   brand   contacts"
      "socials socials contacts"
      "catalog info    contacts";
    grid-template-rows: auto auto 1fr;
  }
  .ad-footer__about { max-width: 520px; }
}
@media (max-width: 1023.98px) {
  .ad-footer__container { padding: 0 24px; }
  .ad-footer__cta { flex-wrap: wrap; }
  .ad-footer__cta-text { flex-basis: calc(100% - 80px); }
  .ad-footer__cta-actions { width: 100%; }
  .ad-footer__cta-actions .ad-footer__btn { flex: 1 1 0; }
  .ad-footer__bottom-row { flex-wrap: wrap; }
  .ad-footer__end { width: 100%; justify-content: space-between; }
}

/* ---------- мобильный (макет A3.1) ---------- */
@media (max-width: 767.98px) {
  .ad-footer__container { padding: 0 16px; }
  .ad-footer__cta { margin-top: 32px; padding: 20px; gap: 16px 12px; }
  .ad-footer__cta-icon { width: 44px; height: 44px; }
  .ad-footer__cta-text { display: contents; }
  .ad-footer__cta-title { flex: 1 1 0; font-size: 18px; line-height: 24px; font-weight: 600; }
  .ad-footer__cta-sub { width: 100%; }
  .ad-footer__cta-actions { flex-direction: column; }
  .ad-footer__cta-actions .ad-footer__btn { flex: none; width: 100%; }

  .ad-footer__main {
    display: flex; flex-direction: column; gap: 0; padding: 32px 0 24px;
  }
  .ad-footer__about { display: none; }
  .ad-footer__contacts { margin-top: 16px; }
  .ad-footer__heading--static { display: none; }
  .ad-footer__socials { margin-top: 20px; margin-bottom: 20px; }
  .ad-footer__socials-title { display: none; }
  .ad-footer__social { width: 44px; height: 44px; }

  .ad-footer__group { border-bottom: 1px solid var(--ad-dark); }
  .ad-footer__group > summary { cursor: pointer; padding: 16px 0; font-size: 14px; line-height: 20px; }
  .ad-footer__group > summary .ad-icon { display: block; color: var(--ad-subtle); transition: transform .2s ease; }
  .ad-footer__group[open] > summary .ad-icon { transform: rotate(180deg); color: var(--ad-primary); }
  .ad-footer__links { gap: 16px; margin-top: 0; padding: 4px 0 20px; }

  .ad-footer__bottom-row { flex-direction: column; align-items: flex-start; padding-top: 20px; padding-bottom: 24px; }
  .ad-footer__payments { order: -1; }
  .ad-footer__payments .ad-footer__muted { display: none; }
  .ad-footer__end { flex-direction: column-reverse; align-items: flex-start; gap: 16px; }
  .ad-footer__top { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ad-footer *, .ad-footer *::before, .ad-footer *::after { transition: none !important; }
}
