.top-bar {
  width: 100%;
  background: linear-gradient(
    90deg,
    rgba(9, 58, 39, 0.98),
    rgba(15, 84, 56, 0.96)
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);

  .top-bar__inner {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }

  .top-bar__contacts {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }

  .top-bar__contact-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.94);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition:
      background 0.25s ease,
      border-color 0.25s ease,
      transform 0.25s ease;

    &:hover {
      color: #ffffff;
      background: rgba(255, 255, 255, 0.14);
      border-color: rgba(255, 255, 255, 0.24);
      transform: translateY(-1px);
    }
  }

  .top-bar__contact-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(204, 255, 160, 0.16);
    color: var(--secondary-lime);
    font-size: 12px;
    flex-shrink: 0;
  }

  .top-bar__cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: 999px;
    background: var(--secondary-lime);
    color: var(--dark-blue-gray);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 24px rgba(5, 26, 18, 0.18);
    transition:
      transform 0.25s ease,
      box-shadow 0.25s ease,
      background 0.25s ease;

    &:hover {
      color: var(--dark-blue-gray);
      background: #d6ff9a;
      transform: translateY(-1px);
      box-shadow: 0 14px 28px rgba(5, 26, 18, 0.22);
    }
  }
}

.custom-navbar {
  position: relative;
  z-index: 999;
  backdrop-filter: blur(10px);
  box-shadow: 0px 0px 4px 0px #00000040;
  background: rgba(255, 255, 255, 0.92);

  .navbar-brand {
    img {
      width: 140px;
      object-fit: contain;
    }
  }

  .navbar-nav {
    gap: 40px;

    .nav-link {
      color: var(--dark-blue-gray) !important;
      font-weight: 500;
      font-size: 14px;
      position: relative;
      padding: 28px 0;

      &.active::after {
        content: "";
        position: absolute;
        right: -14px;
        top: 50%;
        transform: translateY(-50%);
        width: 8px;
        height: 8px;
        background: var(--secondary-lime);
        border-radius: 50%;
      }
    }
  }
}

/* ================================
   GLOBAL REUSABLE MEGA MENU
================================ */

.has-mega-menu {
  position: static;

  &:hover,
  &:focus-within {
    .global-mega-menu {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
      transform: translateX(-50%) translateY(0);
    }
  }
}

.global-mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  width: min(92vw, 1380px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(18px);
  transition: all 0.28s ease;
  z-index: 9999;
  padding-top: 18px;
}

.mega-menu-box {
  width: 100%;
  max-height: 72vh;
  overflow-y: auto;
  padding: 46px 70px 56px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: linear-gradient(
    135deg,
    rgba(1, 20, 25, 0.96),
    rgba(10, 43, 36, 0.94)
  );
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);

  &::-webkit-scrollbar {
    width: 5px;
  }

  &::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 30px;
  }
}

.mega-menu-desc {
  margin: 0 0 34px;
  color: #ffffff;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.55;
}

.mega-menu-row {
  --bs-gutter-x: 34px;
  --bs-gutter-y: 28px;
}

.mega-menu-item {
  min-height: 64px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.095);
  transition: all 0.25s ease;

  &:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);

    .mega-arrow {
      transform: translateX(4px);
    }
  }
}

.mega-menu-icon,
.country-flag {
  width: 48px;
  min-width: 48px;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
}

.mega-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-green);
  color: #ffffff;
  font-size: 20px;
}

.country-flag {
  object-fit: cover;
}

.countries-mega-menu {
  border-color: rgba(193, 231, 205, 0.14);
  background: linear-gradient(
    135deg,
    rgba(11, 52, 36, 0.98),
    rgba(17, 70, 47, 0.97)
  );
  box-shadow: 0 28px 70px rgba(6, 24, 17, 0.34);

  .mega-menu-desc {
    color: rgba(227, 241, 232, 0.82);
    max-width: 760px;
  }

  .mega-menu-item {
    min-height: 78px;
    padding: 16px 18px;
    border: 1px solid rgba(214, 238, 221, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 12px 30px rgba(4, 17, 12, 0.16);

    &:hover {
      background: rgba(255, 255, 255, 0.1);
      border-color: rgba(214, 238, 221, 0.2);
      box-shadow: 0 18px 36px rgba(4, 17, 12, 0.22);
    }
  }

  .mega-menu-title {
    color: #f4fbf6;
    font-size: var(--fs-base);
    font-weight: 600;
  }

  .mega-arrow {
    color: #d8f0df;
  }

  .country-flag {
    width: 52px;
    min-width: 52px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(4, 17, 12, 0.18);
  }
}

.mega-menu-title {
  flex: 1;
  color: #ffffff;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
}

.mega-arrow {
  color: #ffffff;
  font-size: 28px;
  transition: all 0.25s ease;
}

/* ================================
   MOBILE RESPONSIVE
================================ */

@media (max-width: 991px) {
  .top-bar {
    .top-bar__inner {
      min-height: auto;
      padding-top: 10px;
      padding-bottom: 10px;
      flex-direction: column;
      align-items: stretch;
    }

    .top-bar__contacts {
      justify-content: center;
    }

    .top-bar__cta {
      justify-content: center;
      align-self: center;
    }
  }

  .custom-navbar {
    padding: 14px 0;

    .container {
      align-items: flex-start;
    }

    .navbar-toggler {
      padding: 8px 10px;
      border: 1px solid rgba(17, 37, 32, 0.14);
      border-radius: 12px;
      box-shadow: none;
    }

    .navbar-collapse {
      width: 100%;
      margin-top: 16px;
      padding: 18px 16px;
      border: 1px solid rgba(17, 37, 32, 0.08);
      border-radius: 20px;
      background: rgba(255, 255, 255, 0.98);
      box-shadow: 0 16px 40px rgba(16, 34, 28, 0.08);
    }

    .navbar-nav {
      gap: 0;
      padding: 0;
      width: 100%;
      align-items: stretch !important;

      .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(17, 37, 32, 0.08);

        &:last-child {
          border-bottom: 0;
        }
      }

      .nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 15px 0;
        font-size: 15px;

        &.active::after {
          right: 0;
          width: 7px;
          height: 7px;
        }
      }
    }
  }

  .has-mega-menu {
    position: relative;

    > .nav-link::before {
      content: "\F282";
      font-family: "bootstrap-icons";
      font-size: 14px;
      color: var(--primary-green);
      transition: transform 0.25s ease;
      order: 2;
    }
  }

  .global-mega-menu {
    position: static;
    width: 100%;
    padding-top: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    display: none;
  }

  .has-mega-menu:hover .global-mega-menu,
  .has-mega-menu:focus-within .global-mega-menu {
    display: block;
    transform: none;
  }

  .has-mega-menu:hover > .nav-link::before,
  .has-mega-menu:focus-within > .nav-link::before {
    transform: rotate(180deg);
  }

  .mega-menu-box {
    max-height: none;
    margin: 2px 0 16px;
    padding: 18px 14px;
    border-radius: 18px;
    box-shadow: none;
  }

  .mega-menu-row {
    --bs-gutter-x: 0;
    --bs-gutter-y: 10px;
  }

  .mega-menu-item {
    min-height: 56px;
    padding: 12px 14px;
    gap: 12px;
  }

  .mega-arrow {
    font-size: 18px;
  }

  .mega-menu-icon,
  .country-flag {
    width: 40px;
    min-width: 40px;
    height: 28px;
  }

  .countries-mega-menu {
    .mega-menu-desc {
      max-width: none;
    }

    .mega-menu-item {
      min-height: 60px;
      padding: 13px 14px;
      border-radius: 14px;
    }

    .country-flag {
      width: 42px;
      min-width: 42px;
      height: 30px;
    }
  }
}

@media (max-width: 767px) {
  .custom-navbar {
    .navbar-brand {
      img {
        width: 98px;
        object-fit: contain;
      }
    }
  }
}
@media (max-width: 575px) {
  .top-bar {
    .top-bar__contact-link,
    .top-bar__cta {
      width: 100%;
      justify-content: center;
    }
  }
  .custom-navbar {
    .navbar-brand {
      img {
        width: 90px;
        object-fit: contain;
      }
    }
  }
  .navbar-toggler-icon {
    width: 1.2rem;
    height: 1.2rem;
  }
}

@media (max-width: 575px) {
  .custom-navbar {
    .navbar-collapse {
      padding: 16px 12px;
      border-radius: 16px;
    }
  }

  .mega-menu-box {
    padding: 16px 12px;
  }

  .countries-mega-menu {
    .mega-menu-desc {
      font-size: var(--fs-xs);
    }
    .mega-menu-title {
      font-size: var(--fs-xs);
    }
    .mega-arrow {
      font-size: var(--fs-xs);
    }
  }
}
