:root {
  --site-topbar-height: 44px;
  --site-logo-bar-height: 70px;
  --site-main-nav-height: 50px;
}

.site-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1045;
  color: #fff;
  background: linear-gradient(90deg, var(--bs-blue) 0%, #1a2f57 45%, var(--bs-yellow) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .2);
}

.site-topbar__inner {
  height: var(--site-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-topbar__contacts {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  opacity: .95;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .2s ease;
}

.site-topbar__item:hover {
  opacity: 1;
}

.site-topbar__icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.site-topbar__social {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-topbar__social-link {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .75);
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease;
}

.site-topbar__social-link svg {
  width: 16px;
  height: 16px;
}

.site-topbar__social-link:hover {
  background-color: rgba(255, 255, 255, .18);
  border-color: #fff;
}

/* ========================================
   Logo Bar (between topbar and nav)
   ======================================== */

.site-logo-bar {
  z-index: 1042;
  height: var(--site-logo-bar-height);
  background: var(--bs-yellow);
  display: flex;
  align-items: center;
}

.site-logo-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-logo-bar__brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-logo-bar__logo {
  height: 52px;
  width: auto;
}

.site-logo-bar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-logo-bar__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 0;
  color: var(--bs-blue);
  text-decoration: none;
  font-weight: 700;
  font-size: .85rem;
  border: 2px solid var(--bs-blue);
  transition: background-color .2s ease, color .2s ease;
}

.site-logo-bar__action svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.site-logo-bar__action:hover {
  background-color: var(--bs-blue);
  color: #fff;
}

.site-logo-bar__action-label {
  display: inline;
}

/* ========================================
   Main Nav
   ======================================== */

.site-main-nav {
  z-index: 1040;
  top: calc(var(--site-topbar-height) + var(--site-logo-bar-height)) !important;
  height: var(--site-main-nav-height) !important;
  background: linear-gradient(to bottom, var(--bs-yellow) 60%, rgba(241, 211, 72, 0.5) 85%, transparent 100%) !important;
}

.site-header-spacer {
  height: calc(var(--site-topbar-height) + var(--site-logo-bar-height) + var(--site-main-nav-height));
}

.bs-icon {
  --bs-icon-size: .75rem;
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: calc(var(--bs-icon-size) * 2);
  height: calc(var(--bs-icon-size) * 2);
  font-size: var(--bs-icon-size);
  color: var(--bs-primary);
}

.bs-icon-xs {
  --bs-icon-size: 1rem;
  width: calc(var(--bs-icon-size) * 1.5);
  height: calc(var(--bs-icon-size) * 1.5);
}

.bs-icon-sm {
  --bs-icon-size: 1rem;
}

.bs-icon-md {
  --bs-icon-size: 1.5rem;
}

.bs-icon-lg {
  --bs-icon-size: 2rem;
}

.bs-icon-xl {
  --bs-icon-size: 2.5rem;
}

.bs-icon.bs-icon-primary {
  color: var(--bs-white);
  background: var(--bs-primary);
}

.bs-icon.bs-icon-primary-light {
  color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), .2);
}

.bs-icon.bs-icon-semi-white {
  color: var(--bs-primary);
  background: rgba(255, 255, 255, .5);
}

.bs-icon.bs-icon-rounded {
  border-radius: 0;
}

.bs-icon.bs-icon-circle {
  border-radius: 50%;
}

/* Navigation */
.navbar {
  font-family: 'Nunito', sans-serif;
}

.navbar-container {
  padding: 10px 20px;
}

.navbar-nav .nav-link {
  color: var(--bs-blue);
  font-weight: 700;
  font-size: 1rem;
}

.navbar-nav .nav-item.active .nav-link {
  color: var(--bs-blue);
  background-color: #3564a0;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-item.dropdown:hover .nav-link {
  color: var(--bs-blue);
}

/* Legacy dropdown styles (non-mega) */
.dropdown-menu:not(.mega-menu) {
  margin: 0;
  padding: 15px;
  border-radius: 0;
  background-color: rgba(0, 0, 0, 0);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dropdown-item:not(.mega-menu .dropdown-item) {
  padding: 5px 20px;
  font-size: .9em;
  font-weight: 700;
  color: #fff;
  background-color: var(--bs-blue);
}

.dropdown-item:not(.mega-menu .dropdown-item):hover {
  position: relative;
  z-index: 1;
  color: var(--bs-blue);
  background-color: transparent;
}

.dropdown-item:not(.mega-menu .dropdown-item):first-child {
  padding-top: 15px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.dropdown-item:not(.mega-menu .dropdown-item):last-child {
  padding-bottom: 15px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* ========================================
   Mega Menu
   ======================================== */

@media (min-width: 992px) {
  .dropdown--mega {
    position: static;
  }
}

.mega-menu {
  width: 100%;
  left: 0;
  right: 0;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(24, 70, 138, 0.12);
  border-top: 3px solid var(--bs-yellow);
}

@media (min-width: 992px) {
  .mega-menu {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
    display: block !important;
  }

  .mega-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* Grid */
.mega-menu__grid {
  display: grid;
  gap: 16px;
  padding: 28px 0;
}

.mega-menu__grid--cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.mega-menu__grid--cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.mega-menu__grid--cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.mega-menu__grid--cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

/* Card */
.mega-menu__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  border: 2px solid rgba(24, 70, 138, 0.08);
  border-radius: 0;
  text-decoration: none;
  color: var(--bs-blue);
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.mega-menu__card:hover {
  border-color: var(--bs-yellow);
  box-shadow: 0 6px 24px rgba(24, 70, 138, 0.1);
  transform: translateY(-3px);
  text-decoration: none;
  color: var(--bs-blue);
}

/* Image / Icon wrapper */
.mega-menu__img-wrap {
  width: 56px;
  height: 56px;
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(24, 70, 138, 0.06), rgba(241, 211, 72, 0.15));
  border: 2px solid var(--bs-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mega-menu__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mega-menu__icon {
  width: 26px;
  height: 26px;
  color: var(--bs-blue);
}

/* Text */
.mega-menu__title {
  display: block;
  font-weight: 800;
  font-size: .95rem;
  margin-bottom: 6px;
  color: var(--bs-blue);
}

.mega-menu__desc {
  display: block;
  font-size: .82rem;
  font-weight: 400;
  color: #5a6a7e;
  line-height: 1.45;
}

/* ========================================
   Mega Menu – responsive (tablet / 5-col)
   ======================================== */

@media (min-width: 992px) and (max-width: 1199px) {
  .mega-menu__grid--cols-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   Mega Menu – Mobile
   ======================================== */

@media (max-width: 991px) {
  .dropdown--mega {
    position: relative;
  }

  .mega-menu {
    position: relative;
    width: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    border-top: none;
    border-radius: 0;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .mega-menu__grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 0;
  }

  .mega-menu__grid--cols-2,
  .mega-menu__grid--cols-3,
  .mega-menu__grid--cols-4,
  .mega-menu__grid--cols-5 {
    grid-template-columns: 1fr;
  }

  .mega-menu__card {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-color: rgba(24, 70, 138, 0.12);
    background: rgba(255, 255, 255, 0.6);
  }

  .mega-menu__img-wrap {
    width: 40px;
    height: 40px;
    margin-bottom: 0;
    border-radius: 0;
  }

  .mega-menu__icon {
    width: 20px;
    height: 20px;
  }

  .mega-menu__desc {
    display: none;
  }
}

/* Mobile navigation */
@media (max-width: 991px) {
  :root {
    --site-topbar-height: 40px;
    --site-logo-bar-height: 56px;
  }

  .site-logo-bar__logo {
    height: 40px;
  }

  .site-logo-bar__action-label {
    display: none;
  }

  .site-logo-bar__action {
    padding: 6px 8px;
    border-radius: 0;
  }

  .site-logo-bar__action svg {
    width: 20px;
    height: 20px;
  }

  .navbar-toggler {
    position: fixed;
    top: calc(var(--site-topbar-height) + 8px);
    right: 16px;
    z-index: 1043;
  }

  .site-topbar__contacts {
    gap: 14px;
  }

  .site-topbar__item {
    font-size: .78rem;
  }

  .site-topbar__item--address,
  .site-topbar__item--contact {
    display: none;
  }

  .site-topbar__social-link {
    width: 30px;
    height: 30px;
  }

  .navbar-collapse {
    margin-top: 5px;
  }

  #navigation {
    position: fixed;
    top: 0;
    right: -100%;
    width: 95%;
    min-height: 100vh;
    padding: 20px;
    overflow-y: auto;
    border-radius: 0;
    background-color: rgb(255, 246, 205);
    transition: transform .4s ease;
  }

  .navbar-collapse.show {
    transform: translateX(-100%);
  }

  .navbar-toggler {
    border: none;
  }

  .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.5%29' stroke-width='2' linecap='round' linejoin='round' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  }
}

@media (max-width: 767px) {
  .site-topbar__contacts {
    gap: 8px;
  }

  .site-topbar__item span {
    display: none;
  }

  .site-topbar__item {
    padding: 0 2px;
  }

  .site-topbar__icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
  }

  .site-topbar__social {
    gap: 6px;
  }

  .site-topbar__social-link {
    width: 28px;
    height: 28px;
  }

  .site-topbar__social-link svg {
    width: 14px;
    height: 14px;
  }
}

.navbar-toggler-icon {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 30px;
  background: none;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after,
.navbar-toggler-icon span {
  content: '';
  position: absolute;
  left: 0;
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--bs-blue);
  transition: all .3s ease;
}

.navbar-toggler-icon span {
  top: 50%;
  transform: translateY(-50%);
}

.navbar-toggler-icon::before {
  top: 8px;
}

.navbar-toggler-icon::after {
  bottom: 8px;
}
