.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(241, 242, 237, 0.14);
  background: rgba(12, 14, 16, 0.9);
  color: #f3f5ec;
  backdrop-filter: blur(10px);
}

.topbar__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  max-width: 1540px;
  margin: 0 auto;
  padding: 0.72rem 1.25rem;
}

.topbar__group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.brand {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 0.55rem;
  background: #c1ca8a;
  color: #0f1113;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand__copy {
  display: grid;
  gap: 0.1rem;
}

.brand__copy strong,
.brand__copy span,
.topbar__toggle-label,
.topbar__link,
.btn {
  font-family: "IBM Plex Mono", monospace;
}

.brand__copy strong {
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand__copy span {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 245, 236, 0.62);
}

.topbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.topbar__actions--contacts {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.topbar-contact-menu {
  position: relative;
}

.topbar-contact-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.45rem;
  padding: 0.36rem 0.92rem;
  border: 1px solid rgba(241, 242, 237, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #f3f5ec;
  text-decoration: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.topbar-contact-trigger:hover,
.topbar-contact-trigger:focus-visible,
.topbar__actions--contacts.is-open .topbar-contact-trigger {
  transform: translateY(-1px);
  border-color: rgba(241, 242, 237, 0.24);
  background: rgba(255, 255, 255, 0.07);
}

.topbar-contact-popover {
  position: absolute;
  top: calc(100% + 0.7rem);
  right: 0;
  z-index: 25;
  display: grid;
  gap: 0.5rem;
  min-width: min(18rem, calc(100vw - 2rem));
  padding: 0.85rem;
  border: 1px solid rgba(241, 242, 237, 0.14);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, rgba(39, 42, 36, 0.98), rgba(26, 29, 33, 0.98));
  box-shadow: 0 24px 60px rgba(8, 10, 13, 0.32);
}

.topbar-contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.45rem;
  padding: 0.36rem 0.68rem 0.36rem 0.36rem;
  border: 1px solid rgba(241, 242, 237, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #f3f5ec;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.topbar-contact-chip:hover,
.topbar-contact-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(241, 242, 237, 0.24);
  background: rgba(255, 255, 255, 0.07);
}

.topbar-contact-chip__icon {
  position: relative;
  display: inline-grid;
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 auto;
  place-items: center;
}

.topbar-contact-chip__icon svg {
  width: 100%;
  height: 100%;
}

.topbar-contact-chip__brand-icon {
  position: absolute;
  inset: 0.26rem;
  width: calc(100% - 0.52rem);
  height: calc(100% - 0.52rem);
  object-fit: contain;
}

.topbar-contact-chip--vk .topbar-contact-chip__brand-icon,
.topbar-contact-chip--telegram .topbar-contact-chip__brand-icon,
.topbar-contact-chip--whatsapp .topbar-contact-chip__brand-icon {
  filter: brightness(0) invert(1);
}

.topbar-contact-chip__icon rect {
  fill: rgba(241, 242, 237, 0.12);
  stroke: rgba(241, 242, 237, 0.16);
  stroke-width: 1.4;
}

.topbar-contact-chip--phone .topbar-contact-chip__icon rect {
  fill: rgba(193, 202, 138, 0.16);
  stroke: rgba(193, 202, 138, 0.34);
}

.topbar-contact-chip--vk .topbar-contact-chip__icon rect {
  fill: #2787f5;
  stroke: rgba(140, 190, 255, 0.7);
}

.topbar-contact-chip--max .topbar-contact-chip__icon rect {
  fill: rgba(255, 255, 255, 0.92);
  stroke: rgba(214, 219, 229, 0.68);
}

.topbar-contact-chip--telegram .topbar-contact-chip__icon rect {
  fill: #27a7e7;
  stroke: rgba(157, 220, 255, 0.64);
}

.topbar-contact-chip--whatsapp .topbar-contact-chip__icon rect {
  fill: #25d366;
  stroke: rgba(164, 255, 196, 0.62);
}

.topbar-contact-chip.is-revealed {
  border-color: rgba(193, 202, 138, 0.36);
  background: rgba(193, 202, 138, 0.1);
}

.topbar-contact-chip__icon text {
  fill: #f1f2ed;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-anchor: middle;
}

.topbar-contact-chip__label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(241, 242, 237, 0.76);
}

.topbar__toggle {
  display: none;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
  padding: 0.6rem 0.88rem;
  border: 1px solid rgba(241, 242, 237, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.topbar__toggle:hover,
.topbar__toggle:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(241, 242, 237, 0.28);
  background: rgba(255, 255, 255, 0.05);
}

.topbar__toggle-icon {
  display: grid;
  gap: 0.22rem;
}

.topbar__toggle-icon span {
  display: block;
  width: 0.92rem;
  height: 1px;
  border-radius: 999px;
  background: currentColor;
}

.topbar__toggle-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.topbar__panel {
  display: contents;
}

.topbar__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.topbar__link {
  padding: 0.7rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(243, 245, 236, 0.68);
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.topbar__link:hover,
.topbar__link:focus-visible {
  transform: translateY(-1px);
  color: #f3f5ec;
  border-color: rgba(241, 242, 237, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.topbar__link.is-active {
  color: #0f1113;
  border-color: #c1ca8a;
  background: #c1ca8a;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.7rem;
  padding: 0.78rem 1.08rem;
  border: 1px solid rgba(241, 242, 237, 0.14);
  border-radius: 999px;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn--sm {
  min-height: 2.4rem;
  padding: 0.62rem 0.92rem;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.02);
  color: #f3f5ec;
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: rgba(241, 242, 237, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.btn--solid {
  border-color: #c1ca8a;
  background: #c1ca8a;
  color: #0f1113;
}

.btn--solid:hover,
.btn--solid:focus-visible {
  border-color: #d9e2a0;
  background: #d9e2a0;
}

@media (max-width: 980px) {
  .topbar__inner {
    align-items: flex-start;
  }

  .topbar__group {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  .topbar__toggle {
    display: inline-flex;
  }

  .topbar__panel {
    display: none;
    position: absolute;
    top: calc(100% + 0.55rem);
    left: 1rem;
    right: 1rem;
    width: auto;
    padding: 0.9rem;
    border: 1px solid rgba(241, 242, 237, 0.14);
    border-radius: 1.1rem;
    background: rgba(22, 25, 28, 0.98);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(12px);
  }

  .topbar.is-expanded .topbar__panel {
    display: grid;
    gap: 0.75rem;
  }

  .topbar__nav,
  .topbar__actions {
    justify-content: flex-start;
  }

  .topbar__nav {
    display: grid;
    width: 100%;
    gap: 0.35rem;
  }

  .topbar__actions {
    width: 100%;
    gap: 0.6rem;
    padding-top: 0.2rem;
    border-top: 1px solid rgba(241, 242, 237, 0.08);
  }

  .topbar__actions > * {
    width: 100%;
  }

  .topbar__actions--contacts {
    display: flex;
    width: 100%;
  }

  .topbar-contact-menu,
  .topbar-contact-trigger,
  .topbar-contact-popover,
  .topbar-contact-chip {
    width: 100%;
  }

  .topbar-contact-popover {
    position: static;
    min-width: 0;
    margin-top: 0.55rem;
  }

  .topbar-contact-chip {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .topbar__inner {
    padding-inline: 1rem;
  }

  .brand__copy span {
    display: none;
  }

  .brand__copy strong {
    font-size: 0.84rem;
  }

  .topbar__link {
    width: 100%;
    text-align: center;
  }

  .topbar__toggle {
    gap: 0.55rem;
    padding: 0.56rem 0.8rem;
  }

  .topbar__panel {
    left: 0.75rem;
    right: 0.75rem;
    padding: 0.8rem;
    gap: 0.65rem;
    max-height: calc(100dvh - 5.5rem);
    overflow: auto;
  }

  .topbar__nav {
    gap: 0.35rem;
  }

  .topbar__link {
    padding: 0.82rem 0.95rem;
  }
}
