/* =============================================================================
   Адаптивные размеры img/logo.png и img/maxlogo.png
   ============================================================================= */
:root {
  /* Главный логотип — шапка */
  --size-logo-header: clamp(44px, 11vw, 72px);
  /* Главный логотип — подвал */
  --size-logo-footer: clamp(36px, 8vw, 56px);
  /* Max — обычный */
  --size-max: clamp(48px, 12vw, 64px);
  /* Max — на первом экране */
  --size-max-hero: clamp(52px, 14vw, 76px);
  /* Max — в контактах */
  --size-max-contacts: clamp(56px, 13vw, 80px);
  /* Max — плавающая кнопка */
  --size-max-float: clamp(50px, 11vw, 72px);
  /* Высота шапки под логотип */
  --header-height: calc(var(--size-logo-header) + 16px);
}

/* --- logo.png --- */
img.file-logo {
  width: var(--size-logo-header);
  height: auto;
  object-fit: contain;
}

.header img.file-logo {
  width: var(--size-logo-header);
  max-height: calc(var(--size-logo-header) * 1.05);
}

.footer img.file-logo {
  width: var(--size-logo-footer);
  max-height: var(--size-logo-footer);
}

/* --- maxlogo.png --- */
img.file-maxlogo {
  width: var(--size-max);
  height: auto;
  object-fit: contain;
}

.hero__cta img.file-maxlogo {
  width: var(--size-max-hero);
}

.contacts__buttons img.file-maxlogo {
  width: var(--size-max-contacts);
}

a.max-link--float img.file-maxlogo {
  width: var(--size-max-float);
}

/* --- ссылка Max (без фона, только картинка) --- */
a.max-link {
  display: inline-block;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  box-shadow: none;
  line-height: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

a.max-link:hover {
  opacity: 0.92;
  transform: scale(1.05);
}

a.max-link--float {
  position: fixed;
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  right: clamp(12px, 3vw, 24px);
  z-index: 998;
}

a.max-link--pulse {
  animation: maxPulse 2s ease-in-out infinite;
}

@keyframes maxPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* --- Планшет --- */
@media (min-width: 768px) {
  :root {
    --size-logo-header: clamp(52px, 8vw, 80px);
    --size-logo-footer: clamp(40px, 5vw, 60px);
    --size-max: clamp(56px, 7vw, 68px);
    --size-max-hero: clamp(60px, 8vw, 80px);
    --size-max-contacts: clamp(64px, 7vw, 84px);
    --size-max-float: clamp(56px, 6vw, 72px);
  }

  a.max-link--float {
    bottom: clamp(20px, 3vw, 28px);
  }

  a.max-link--float.max-link--pulse {
    animation: none;
  }
}

/* --- Десктоп --- */
@media (min-width: 1024px) {
  :root {
    --size-logo-header: clamp(60px, 6vw, 88px);
    --size-logo-footer: 56px;
    --size-max: 64px;
    --size-max-hero: 76px;
    --size-max-contacts: 80px;
    --size-max-float: 72px;
  }
}

/* --- Большие экраны --- */
@media (min-width: 1440px) {
  :root {
    --size-logo-header: 88px;
    --size-max-hero: 84px;
    --size-max-contacts: 88px;
    --size-max-float: 76px;
  }
}

/* Пульсация Max на мобильных */
@media (max-width: 767px) {
  a.max-link--pulse,
  .hero__cta a.max-link,
  .contacts__buttons a.max-link {
    animation: maxPulse 2s ease-in-out infinite;
  }

  a.max-link--pulse:hover,
  .hero__cta a.max-link:hover,
  .contacts__buttons a.max-link:hover {
    animation: none;
  }
}
