/* ===========================================================
   Header 2.0 — «пилюля»
   -----------------------------------------------------------
   Подключается ПОСЛЕ style.min.css и переопределяет старый
   хедер, не трогая логику app.js (.loaded / .sticky / .open)
   и reveal из hero-scroll.css. Разметка та же + .header__bar
   (мобильная капсула) и .header-cta (кнопка «заказать»).
   =========================================================== */

.header.loaded {
  padding: 1rem 0 0;
}

.header.sticky {
  padding: .625rem 0 0;
}

/* старый огромный логотип сверху больше не нужен */
.header__logo {
  display: none !important;
  height: 0 !important;
}

/* ---------- Десктоп: капсула по центру ---------- */
@media (min-width: 992px) {
  .header__bar {
    display: none;
  }

  /* сама пилюля */
  .header .header-body,
  .header.sticky .header-body {
    margin: 0 auto;
    width: -moz-fit-content;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 2.25rem;
    padding: .75rem .75rem .75rem 1.75rem;
    border-radius: 999px;
    background: rgba(18, 18, 20, .55);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    backdrop-filter: blur(18px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow:
      0 10px 40px rgba(0, 0, 0, .45),
      inset 0 1px 0 rgba(255, 255, 255, .07);
    transition: background .3s ease-out, box-shadow .3s ease-out;
  }

  /* при скролле капсула становится плотнее */
  .header.sticky .header-body {
    background: rgba(14, 14, 16, .78);
    box-shadow:
      0 10px 40px rgba(0, 0, 0, .55),
      0 0 24px rgba(56, 64, 255, .12),
      inset 0 1px 0 rgba(255, 255, 255, .07);
  }

  /* мини-логотип: виден всегда, с пульсирующей точкой-статусом */
  .header .header-body__logo,
  .header.sticky .header-body__logo {
    position: relative;
    width: 2.75rem;
    height: 2.75rem;
    opacity: 1;
    flex: 0 0 auto;
  }

  .header .header-body__logo::after {
    content: "";
    position: absolute;
    right: -.3125rem;
    top: -.125rem;
    width: .4375rem;
    height: .4375rem;
    border-radius: 50%;
    background: #38a9ff;
    box-shadow: 0 0 8px rgba(56, 169, 255, .9);
    animation: header-pulse 2.4s ease-in-out infinite;
  }

  /* навигация внутри пилюли */
  .header-nav,
  .header.sticky .header-nav {
    margin: 0;
  }

  .header-nav::before {
    display: none;
  }

  .header-nav ul {
    display: flex;
    gap: .25rem;
  }

  .header-nav li:first-child {
    margin: 0;
  }

  .header-nav li a {
    display: block;
    padding: .75rem 1.25rem;
    border-radius: 999px;
    font-size: 1.25rem;
    line-height: 1;
    color: rgba(255, 255, 255, .82);
    transition: color .25s ease-out, background .25s ease-out;
  }

  .header-nav li a:hover {
    color: #38a9ff;
    background: rgba(255, 255, 255, .07);
  }

  /* CTA: градиент бренда, скобки-«код» разъезжаются на ховере */
  .header-cta {
    position: relative;
    display: flex;
    align-items: center;
    gap: .375rem;
    padding: .875rem 1.875rem;
    border-radius: 999px;
    font-family: "Saar SP Demo", sans-serif;
    font-size: 1.25rem;
    line-height: 1;
    color: #0f0f0f;
    background: linear-gradient(224deg, #38a9ff -31.63%, #3840ff 154.58%);
    transition: box-shadow .25s ease-out, transform .25s ease-out;
  }

  .header-cta::before {
    content: "{";
  }

  .header-cta::after {
    content: "}";
  }

  .header-cta::before,
  .header-cta::after {
    font-family: monospace;
    font-size: 1rem;
    opacity: .55;
    transition: transform .25s ease-out, opacity .25s ease-out;
  }

  .header-cta:hover {
    box-shadow: 0 0 24px rgba(56, 169, 255, .35);
    transform: translateY(-1px);
  }

  .header-cta:hover::before {
    transform: translateX(-3px);
    opacity: 1;
  }

  .header-cta:hover::after {
    transform: translateX(3px);
    opacity: 1;
  }
}

/* ---------- Мобильные: компактная капсула + дропдаун ---------- */
@media (max-width: 991.98px) {
  .header.loaded,
  .header.sticky {
    padding: .75rem 0 0;
  }

  .header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .625rem .875rem .625rem 1.125rem;
    border-radius: 999px;
    background: rgba(18, 18, 20, .6);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    backdrop-filter: blur(18px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow:
      0 10px 40px rgba(0, 0, 0, .45),
      inset 0 1px 0 rgba(255, 255, 255, .07);
  }

  .header__brand {
    position: relative;
    display: block;
    width: 2.375rem;
    height: 2.375rem;
  }

  .header__brand img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .header__brand::after {
    content: "";
    position: absolute;
    right: -.25rem;
    top: -.125rem;
    width: .375rem;
    height: .375rem;
    border-radius: 50%;
    background: #38a9ff;
    box-shadow: 0 0 8px rgba(56, 169, 255, .9);
    animation: header-pulse 2.4s ease-in-out infinite;
  }

  .header__burger {
    margin: 0;
    border-radius: 50%;
    overflow: hidden;
  }

  /* дропдаун-карточка под капсулой */
  .header-body {
    top: 3.75rem;
    right: 1.25rem;
    padding: 1.5rem 1.25rem;
    border-radius: 1.5rem;
    background: rgba(18, 18, 20, .92);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    backdrop-filter: blur(18px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  }

  .header-cta {
    display: inline-flex;
    align-items: center;
    padding: .6875rem 1.5rem;
    border-radius: 999px;
    font-family: "Saar SP Demo", sans-serif;
    font-size: 1.0625rem;
    line-height: 1;
    color: #0f0f0f;
    background: linear-gradient(224deg, #38a9ff -31.63%, #3840ff 154.58%);
  }

  .header-body__logo--mobile {
    display: none;
  }
}

@keyframes header-pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(56, 169, 255, .9);
  }
  50% {
    opacity: .45;
    box-shadow: 0 0 2px rgba(56, 169, 255, .4);
  }
}
