/* ==========================================================================
   Footer — site-wide footer component
   Four-column grid on desktop, 2-col at 768px, 1-col at ≤640px.
   All values come from tokens.css custom properties — no hardcoded values.
   ========================================================================== */

/* ---------- Site footer wrapper ---------- */
.site-footer {
  background-color: var(--bg-dark);
  color: var(--muted-light);
  /* var(--pad) scales: 16px mobile, 48px default, 96px wide — used as top padding to match section rhythm */
  padding: var(--pad) 0 24px;
  margin-top: auto;
}

/* ---------- Inner container — matches header container width ---------- */
.footer__inner {
  /* 1980px hard cap: tokens.css has --container:100% (no max token defined yet).
     Value mirrors the header__inner cap intentionally — update both if max-width changes. */
  max-width: 1980px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- Four-column grid ---------- */
.footer__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap); /* scales: 24px default → 32px at ≥1600px via tokens.css */
}

/* ---------- Column ---------- */
.footer__col {
  display: flex;
  flex-direction: column;
}

/* ---------- Column title ---------- */
.footer__title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink-light);
  margin: 0 0 16px;
  line-height: 1.4;
}

/* ---------- Column description paragraph (О компании) ---------- */
.footer__desc {
  margin: 0 0 20px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted-light);
}

/* ---------- List ---------- */
.footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Links ---------- */
.footer__link {
  color: var(--muted-light);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.5;
  transition: color 0.15s ease;
}

@media (hover: hover) {
  .footer__link:hover {
    color: var(--accent);
    text-decoration: underline;
  }
}

.footer__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ---------- Contacts list items (non-link) ---------- */
.footer__address,
.footer__hours {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted-light);
}

/* ---------- Social icons row ---------- */
.footer__socials {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  color: var(--muted-light);
  background-color: transparent;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.footer__social-link svg {
  width: 20px;
  height: 20px;
}

@media (hover: hover) {
  .footer__social-link:hover {
    background-color: var(--bg-dark-card);
    color: var(--ink-light);
  }
}

.footer__social-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Bottom strip ---------- */
.footer__bottom {
  border-top: 1px solid var(--line-dark);
  margin-top: 32px;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--muted-light);
}

/* ---------- Legal info (left side) ---------- */
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
}

.footer__legal span {
  white-space: nowrap;
}

/* ---------- Legal links + copyright (right side) ---------- */
.footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
}

.footer__copyright {
  white-space: nowrap;
  color: var(--muted-light);
}

/* ==========================================================================
   Responsive breakpoints
   ========================================================================== */

/* 2 columns at ~768px */
@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Single column stack at ≤640px */
@media (max-width: 640px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer__legal-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
