.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.section {
  padding-block: var(--space-2xl);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.section__header {
  margin-bottom: var(--space-xl);
  max-width: 40rem;
}

.section__header--center {
  margin-inline: auto;
  text-align: center;
}

.section__title {
  margin-bottom: var(--space-md);
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.section__subtitle {
  color: var(--color-text-muted);
  margin-bottom: 0;
  max-width: 48rem;
}

.section__header--center .section__subtitle {
  margin-inline: auto;
}

/* Site header shell — на мобилке без sticky (не ломает fixed/тачи) */
.site-header {
  position: relative;
  z-index: var(--z-header);
}

@media (min-width: 1024px) {
  .site-header {
    position: sticky;
    top: 0;
  }
}

.header {
  position: relative;
  z-index: 2;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header__inner {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--header-height);
  padding-block: var(--space-sm);
}

.header__logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-text);
}

.header__logo-img {
  display: block;
  width: auto;
  height: 3.25rem;
}

@media (min-width: 768px) {
  .header__logo-img {
    height: 3.75rem;
  }
}

.header__logo-suffix {
  color: var(--color-primary);
}

.header__burger {
  position: relative;
  z-index: calc(var(--z-overlay) + 5);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.header__burger-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 1.25rem;
}

.header__burger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 1px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.header--menu-open .header__burger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header--menu-open .header__burger-bar:nth-child(2) {
  opacity: 0;
}

.header--menu-open .header__burger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.header__panel {
  position: fixed;
  z-index: var(--z-overlay);
  left: 0;
  right: 0;
  top: var(--site-header-height, 6.5rem);
  bottom: 0;
  display: none;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--container-padding);
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  pointer-events: none;
}

.header--menu-open .header__panel,
.body--menu-open .header__panel {
  display: flex;
  pointer-events: auto;
}

.header__nav {
  flex: 1;
}

.header__menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.header__link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-base), color var(--transition-base);
}

.header__link:hover {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.header__link--active {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

.header__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.header__phone {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  color: var(--color-primary);
}

.header__phone:hover {
  color: var(--color-primary-dark);
}

.header__phone-icon {
  flex-shrink: 0;
}

.header__messengers {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header__messenger {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  border-radius: 50%;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.header__messenger:hover {
  transform: scale(1.08);
  opacity: 0.88;
}

.header__messenger-icon {
  display: block;
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  border-radius: 50%;
}

.header__overlay {
  position: fixed;
  inset: 0;
  top: var(--site-header-height, 6.5rem);
  z-index: calc(var(--z-overlay) - 1);
  display: none;
  background-color: var(--color-overlay);
  border: none;
  padding: 0;
  pointer-events: none;
  cursor: pointer;
}

.header--menu-open .header__overlay,
.body--menu-open .header__overlay {
  display: block;
  pointer-events: auto;
}

@media (min-width: 1024px) {
  .header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo nav actions";
    gap: var(--space-xl);
  }

  .header__logo {
    grid-area: logo;
  }

  .header__burger {
    display: none;
  }

  .header__overlay {
    display: none;
  }

  .header__panel {
    position: static;
    display: flex;
    grid-area: nav;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    overflow: visible;
    pointer-events: auto;
    gap: var(--space-xl);
  }

  .header__nav {
    flex: initial;
  }

  .header__menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xs);
  }

  .header__link {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.9375rem;
  }

  .header__actions {
    grid-area: actions;
    flex-direction: row;
    align-items: center;
    padding-top: 0;
    border-top: none;
    gap: var(--space-md);
    flex-shrink: 0;
  }

  .header__phone-text {
    white-space: nowrap;
  }
}

@media (min-width: 1280px) {
  .header__link {
    padding: var(--space-xs) var(--space-md);
  }
}

/* Guarantee bar */
.guarantee-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  background-color: var(--color-primary);
  color: var(--color-text);
  text-align: center;
  padding: var(--space-sm) var(--container-padding);
  font-size: clamp(0.75rem, 2.5vw, 0.875rem);
  font-weight: 600;
  line-height: 1.3;
}

.guarantee-bar__icon {
  flex-shrink: 0;
  opacity: 0.9;
}

/* Footer */
.footer {
  background-color: var(--color-text);
  color: var(--color-bg);
  padding-block: var(--space-2xl);
}

.footer a {
  color: var(--color-bg);
  text-decoration: none;
  transition: opacity var(--transition-base);
}

.footer a:hover {
  opacity: 0.85;
  text-decoration: underline;
}

.footer__inner {
  display: grid;
  gap: var(--space-xl);
}

.footer__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer__brand {
  display: inline-block;
  margin-bottom: var(--space-md);
  text-decoration: none;
  opacity: 1;
}

.footer__brand:hover {
  opacity: 1;
  text-decoration: none;
}

.footer__logo {
  display: block;
  width: 5.5rem;
  height: auto;
}

.footer__menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-md);
  row-gap: var(--space-sm);
}

@media (min-width: 768px) {
  .footer__menu {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }
}

.footer__contacts {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__messengers {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.footer__entity {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: var(--space-sm);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.7);
}

.footer__entity-name,
.footer__entity-inn {
  margin: 0;
}

.footer__address {
  display: block;
  margin-top: var(--space-sm);
  max-width: 20rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
}

.footer__address:hover {
  color: var(--color-bg);
}

.footer__messenger-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
}

.footer__messenger-icon--max {
  border-radius: 50%;
}

.footer__about {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.footer__social {
  margin-top: var(--space-md);
}

.footer__social-title {
  margin: 0 0 var(--space-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.9);
}

.footer__social-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__social-link {
  display: block;
  overflow: hidden;
  border-radius: 50%;
  background-color: #000;
  line-height: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.footer__social-link:hover,
.footer__social-link:focus-visible {
  opacity: 0.88;
  transform: translateY(-1px);
}

.footer__social-icon {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  object-fit: cover;
}

/* OK: лёгкий inset, чтобы срезать residual halo у скругления */
.footer__social-link[aria-label="Одноклассники"] .footer__social-icon {
  transform: scale(1.12);
  transform-origin: center;
}

.footer__bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.footer__credits {
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
}

.footer__credits-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.footer__credits-link:hover {
  color: rgba(255, 255, 255, 0.72);
}

.footer__credits-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.footer__credits-icon {
  display: inline-flex;
  opacity: 0.65;
  line-height: 0;
  transition: opacity 0.15s ease;
}

.footer__credits-icon:hover {
  opacity: 1;
}

.footer__credits-icon img {
  display: block;
  width: 14px;
  height: 14px;
}

.footer__legal-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.footer__legal-link:hover {
  color: #fff;
}

@media (min-width: 768px) {
  .footer__inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer__inner {
    grid-template-columns: 1.2fr 1fr 1.2fr;
  }
}
