/* ===== ConTrend shared site navigation: clean version ===== */

.ct-site-nav-root {
  width: 100%;
  background: rgba(248, 250, 252, 0.96);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 9990;
}

.ct-site-nav {
  max-width: 1180px;
  min-height: 88px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.ct-site-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #0f172a;
  font-weight: 900;
  font-size: 18px;
  text-decoration: none;
  white-space: nowrap;
}

.ct-site-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #18c7cf 0%, #5b3ff1 100%);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: 0 18px 35px rgba(79, 70, 229, 0.24);
}

.ct-site-menu {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.ct-site-link,
.ct-site-drop-btn,
.ct-site-contact {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #334155;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
}

.ct-site-link.is-active,
.ct-site-drop-btn.is-active {
  background: #eef0ff;
  color: #3730a3;
}

.ct-site-drop-btn::after {
  content: "⌄";
  margin-left: 8px;
  font-size: 14px;
  opacity: 0.72;
}

.ct-site-contact {
  margin-left: auto;
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 18px 35px rgba(79, 70, 229, 0.25);
}

.ct-site-dropdown {
  position: relative;
}

.ct-site-drop-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  width: 292px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
  display: none;
}

.ct-site-dropdown:hover .ct-site-drop-panel,
.ct-site-dropdown.is-open .ct-site-drop-panel {
  display: grid;
  gap: 8px;
}

.ct-site-drop-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  color: #0f172a;
  text-decoration: none;
}

.ct-site-drop-item:hover {
  background: #f3f6fb;
}

.ct-site-drop-item strong {
  font-size: 15px;
  font-weight: 900;
}

.ct-site-drop-item span {
  color: #64748b;
  font-size: 13px;
  line-height: 1.25;
}

.ct-site-mobile-toggle {
  display: none;
}

/* Тестовая главная: убираем старые дубли */
body.ct-home-shared-nav .summary-grid,
body.ct-home-shared-nav .hero .hero-actions,
body.ct-home-shared-nav .hero .secondary-btn,
body.ct-home-shared-nav .hero .install-app-btn {
  display: none !important;
}

body.ct-home-shared-nav .hero {
  min-height: 0 !important;
  padding: 56px 32px 72px !important;
}

body.ct-home-shared-nav .page {
  padding-top: 56px !important;
}

body.ct-home-shared-nav .analytics-card {
  margin-top: 0 !important;
}

/* Mobile */
@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .ct-site-nav-root {
    position: sticky;
    top: 0;
    width: 100%;
    max-width: 100vw;
    background: rgba(248, 250, 252, 0.98);
  }

  .ct-site-nav {
    min-height: 68px;
    width: 100%;
    max-width: 100vw;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .ct-site-brand {
    gap: 10px;
    font-size: 14px;
  }

  .ct-site-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 13px;
  }

  .ct-site-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin-left: auto;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #eef0ff;
    color: #3730a3;
    font-weight: 900;
    cursor: pointer;
  }

  .ct-site-menu {
    display: none !important;
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% + 8px);
    width: auto;
    max-height: calc(100dvh - 128px);
    overflow-y: auto;
    padding: 10px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.18);
    z-index: 9999;
  }

  .ct-site-nav-root.is-menu-open .ct-site-menu,
  .ct-site-menu.is-open {
    display: grid !important;
    gap: 8px;
  }

  .ct-site-link,
  .ct-site-drop-btn,
  .ct-site-contact {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    padding: 0 16px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    color: #0f172a;
    box-shadow: none;
  }

  .ct-site-link.is-active,
  .ct-site-drop-btn.is-active {
    background: #eef0ff;
    color: #3730a3;
  }

  .ct-site-contact {
    background: #4f46e5;
    color: #ffffff;
    justify-content: center;
  }

  .ct-site-dropdown {
    width: 100%;
    position: static;
  }

  .ct-site-drop-panel {
    position: static;
    width: 100%;
    display: none;
    padding: 8px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .ct-site-dropdown:hover .ct-site-drop-panel {
    display: none;
  }

  .ct-site-dropdown.is-open .ct-site-drop-panel {
    display: grid;
    gap: 8px;
  }

  .ct-site-drop-item {
    padding: 12px 14px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
  }

  body.ct-home-shared-nav .hero {
    display: none !important;
  }

  body.ct-home-shared-nav .page {
    padding-top: 24px !important;
  }

  body.ct-home-shared-nav .mobile-bottom-nav {
    display: none !important;
  }
}

/* ===== fix: mobile menu final width and clean vertical layout ===== */
@media (max-width: 760px) {
  .ct-site-nav-root {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9990 !important;
  }

  .ct-site-nav {
    position: relative !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding: 10px 14px !important;
  }

  .ct-site-menu {
    left: 10px !important;
    right: 10px !important;
    top: calc(100% + 8px) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(100vw - 20px) !important;
    padding: 12px !important;
    border-radius: 22px !important;
    display: none !important;
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }

  .ct-site-nav-root.is-menu-open .ct-site-menu,
  .ct-site-menu.is-open {
    display: grid !important;
  }

  .ct-site-link,
  .ct-site-drop-btn,
  .ct-site-contact {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 46px !important;
    padding: 0 16px !important;
    justify-content: flex-start !important;
    text-align: left !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
  }

  .ct-site-contact {
    justify-content: center !important;
  }

  .ct-site-dropdown {
    width: 100% !important;
  }

  .ct-site-drop-panel {
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 0 0 !important;
    box-sizing: border-box !important;
  }

  .ct-site-drop-item {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 16px !important;
  }
}

/* ===== fix: desktop dropdown closes by JS, no hover lock ===== */
@media (min-width: 761px) {
  .ct-site-dropdown:hover .ct-site-drop-panel {
    display: none;
  }

  .ct-site-dropdown.is-open .ct-site-drop-panel {
    display: grid;
    gap: 8px;
  }
}

/* ===== Final nav fix: stable desktop dropdown + clean mobile menu ===== */

/* Десктоп: панель живёт только по JS-классу is-open, без hover-lock и без раннего закрытия */
@media (min-width: 761px) {
  .ct-site-dropdown .ct-site-drop-panel {
    display: none !important;
  }

  .ct-site-dropdown.is-open .ct-site-drop-panel {
    display: grid !important;
    gap: 8px !important;
  }
}

/* Мобильная версия: убираем лишнюю CTA-плашку и пустой нижний элемент */
@media (max-width: 760px) {
  .ct-site-menu .ct-site-contact {
    display: none !important;
  }

  .ct-site-menu > a:empty,
  .ct-site-menu > div:empty,
  .ct-site-menu > .ct-site-link:empty,
  .ct-site-menu > .ct-site-drop-item:empty {
    display: none !important;
  }

  .ct-site-menu {
    padding-bottom: 12px !important;
  }

  .ct-site-drop-panel:empty {
    display: none !important;
  }

  body.ct-home-shared-nav .summary-grid,
  body.ct-home-shared-nav .hero-stats,
  body.ct-home-shared-nav .stats-grid {
    display: none !important;
  }
}

/* ===== Final: remove old homepage hero under shared nav ===== */
body.ct-home-shared-nav .hero {
  display: none !important;
}

body.ct-home-shared-nav .page {
  padding-top: 32px !important;
}

@media (max-width: 760px) {
  body.ct-home-shared-nav .page {
    padding-top: 16px !important;
  }
}


/* ===== Production final: homepage shared nav rules ===== */
body.ct-home-shared-nav .hero {
  display: none !important;
}

body.ct-home-shared-nav .page {
  padding-top: 32px !important;
}

body.ct-site-nav-enabled .mobile-bottom-nav {
  display: none !important;
}

@media (max-width: 760px) {
  body.ct-home-shared-nav .page {
    padding-top: 16px !important;
  }

  body.ct-site-nav-enabled .mobile-bottom-nav {
    display: none !important;
  }
}


/* ===== Final shared nav: hide legacy page headers and duplicated mobile nav ===== */
body.ct-shared-nav-ready > header.topbar,
body.ct-shared-nav-ready > header.site-header,
body.ct-shared-nav-ready > header.markets-topbar {
  display: none !important;
}

body.ct-shared-nav-ready .mobile-bottom-nav {
  display: none !important;
}

/* home page: old hero is replaced by shared nav */
body.ct-shared-nav-ready.ct-home-page > header.hero {
  display: none !important;
}

body.ct-shared-nav-ready.ct-home-page .page {
  padding-top: 32px !important;
}

@media (max-width: 760px) {
  body.ct-shared-nav-ready.ct-home-page .page {
    padding-top: 16px !important;
  }
}

/* inner public pages need clean offset after old header is hidden */
body.ct-shared-nav-ready:not(.ct-home-page) main,
body.ct-shared-nav-ready:not(.ct-home-page) .page,
body.ct-shared-nav-ready:not(.ct-home-page) .container:first-of-type {
  scroll-margin-top: 110px;
}
