.nav-link {
  color: #2a3a52 !important;
  font-weight: bold;
}
.nav-link:hover {
  color: #1677ff !important;
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

.nav-item .btn {
  font-weight: bold;
}

@media screen and (min-width: 1200px) {
  .nav-item {
    margin: auto 2rem auto 0px;
  }
}

@media screen and (min-width: 910px) {
  .nav-item {
    margin: auto 0.875rem auto 0px;
  }
}
/* --- Megamenu Dropdown --- */

.dropdown-megamenu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  display: none;
  z-index: 999;
}

.dropdown:hover .dropdown-megamenu {
  display: flex;
}

.megamenu-col {
  flex: 1;
  padding: 0 1rem;
}

.megamenu-col h6 {
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.megamenu-col a {
  display: block;
  padding: 4px 0;
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
}

.megamenu-col a:hover {
  color: #0056b3;
}

/* Responsive overrides */

@media (max-width: 991.98px) {
  .dropdown-megamenu {
    position: static;
    display: none;
    flex-direction: column;
    box-shadow: none;
    border-radius: 0;
    padding: 1rem 1rem;
  }
}

@media (max-width: 991.98px) {
  .dropdown.show .dropdown-megamenu {
    display: flex;
  }
}

.btn-primary.rounded-pill {
  border-radius: 999px;
}

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100vw;
  background: #fff;
  display: none;
  padding: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.mega-menu ul {
  list-style: none;
  margin: 0;
  padding: 0 20px;
  float: left;
  width: 100%;
}

.menubar nav ul li:hover .mega-menu {
  display: block;
}

@media (max-width: 768px) {
  .mega-menu {
    position: static;
    width: 100%;
    display: block !important;
  }
}

@media (max-width: 768px) {
  .mega-menu ul {
    width: 100%;
    float: none;
    padding: 10px 0;
  }
}

@media (max-width: 768px) {
  .menubar nav ul {
    flex-direction: column;
    align-items: flex-start;
  }
}

.menubar {
  margin: 10px 0;
  float: right;
}

.menubar nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menubar nav ul li {
  display: inline-block;
  margin: 0 20px 0 0;
}

.menubar nav ul li a {
  display: block;
  font-size: 12px;
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  padding: 25px 0;
  letter-spacing: 0.5px;
  color: #000000;
  text-transform: uppercase;
  text-decoration: none;
  transition: 0.3s;
}

.menubar nav ul li:hover > a {
  text-decoration: none;
  color: #dd7e2e;
}

.menubar nav ul li .mega-menu {
  width: 100%;
  display: block;
  position: absolute;
  top: 100%;
  background: #ffffff;
  left: 0;
  transition: 0.3s;
  box-shadow: 0px 5px 8px rgba(106, 106, 106, 0.4);
  border: 1px solid #ebebeb;
  padding: 24px 30px;
  visibility: hidden;
  opacity: 0;
}

.menubar nav ul li:hover .mega-menu {
  visibility: visible;
  opacity: 1;
  z-index: 99;
}

.menubar nav ul li .mega-menu ul {
  width: 25%;
  float: left;
}

.menubar nav ul li .mega-menu ul li {
  display: block;
  margin: 0;
  padding: 6px 0px;
}

.menubar nav ul li .mega-menu ul li a {
  text-transform: none;
  font-size: 13px;
  padding: 0;
}

@media (max-width: 767.98px) {
  .menubar nav ul li .mega-menu ul {
    width: 100%;
    float: left;
    margin: 0 0 22px;
  }
}

@media (min-width: 768px) {
  .menubar nav ul li .mega-menu ul {
    width: 100%;
    float: left;
    margin: 0 0 22px;
  }
}

@media (min-width: 992px) {
  .menubar nav ul li .mega-menu ul {
    width: 25%;
  }
}

footer .container {
  padding: 64px 0 56px;
}

h6 {
  font-size: 18px;
}

small {
  font-size: 16px !important;
}

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background-color: #f8f9fa;
  overflow-y: auto;
  z-index: 1050;
  transition: right 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: normal;
}

/* When menu is open */
.mobile-menu.open {
  right: 0;
}

.mobile-menu-header img {
  max-height: 32px;
}

.close-btn {
  font-size: 2rem;
  background: none;
  border: none;
  color: #1677ff;
}

.menu-group {
  margin-top: 1rem;
}

.menu-link {
  display: block;
  padding: 8px 0;
  font-weight: 600;
  color: #2a3a52;
  text-decoration: none;
}

.menu-link:hover {
  color: #1677ff;
}

.section-title {
  font-size: 1rem;
  font-weight: bold;
  color: #2a3a52;
  margin-bottom: 0.5rem;
}

.mobile-menu-footer {
  background-color: #fff;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
}

.mobile-menu-footer a {
  font-weight: bold;
}

.dropdown-menu.dropdown-megamenu-modern {
  left: 50%;
  transform: translateX(-35%);
  top: 100%;
  margin-top: 2rem;
  background-color: rgb(255, 255, 255);
  box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px 0px;
  position: absolute;                
  border-radius: 0.5rem 1rem 2rem 0.5rem;
}

.dropdown-arrow {
  position: absolute;
  top: -10px; /* Adjust based on arrow size */
  left: 35%;
  transform: translateX(-35%);
  width: 20px;
  height: 10px;
  background: white;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 1001;
}

.dropdown-megamenu-modern {
  border-radius: 16px;
  background: white;
  min-width: 600px;
  max-width: 100%;
  padding: 2rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
  display: flex;
  z-index: 1000;
}

.dropdown-megamenu-modern .menu-item-link {
  display: block;
  padding: 10px 0;
  color: #2a3a52;
  text-decoration: none;
  transition: color 0.2s ease;
}

.dropdown-megamenu-modern .menu-item-link strong {
  font-size: 15px;
  color: #0f172a;
  display: block;
}

.dropdown-megamenu-modern .menu-item-desc {
  font-size: 13px;
  color: #6b7280;
  display: block;
  margin-top: 2px;
}

.dropdown-megamenu-modern .menu-item-link:hover strong {
  color: #1677ff;
}

.dropdown-megamenu-modern p {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.dropdown-megamenu-modern {
  display: none;
  opacity: 0;
}

.dropdown-megamenu-modern.show {
  display: block;
  opacity: 1;      
}

/* Hide Bootstrap's default caret */
.nav-link.dropdown-toggle::after { display: none; }

/* The inline arrow that sits right after the text */
.nav-link .arrow {
  display: inline-flex;
  align-items: center;
  margin-left: .35rem;
  transition: transform .2s ease;
}

/* Draw the Font Awesome down arrow */
.nav-link .arrow::before {
  content: "\f0d7";                 /* caret-down. Use "\f078" for chevron-down if you prefer */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;                  /* Solid */
  font-size: .9em;
  line-height: 1;
  color: rgba(0, 0, 0, .5);
}

/* Rotate when hovered or when the dropdown is open */
.nav-item.dropdown:hover .arrow,
.nav-item.dropdown.show .arrow {
  transform: rotate(180deg);
  color: #1677ff !important;
}
.arrow::before:hover {
  color: #1677ff !important;
}
/* Your link already turns blue on hover, so the arrow will follow */
.nav-link:hover { color: #1677ff !important; }

/* Also turn blue when the dropdown is open or the li is hovered */
.nav-item.dropdown:hover > .nav-link,
.nav-item.dropdown.show  > .nav-link {
  color: #1677ff !important;
}
.nav-link:hover .arrow::before,
.nav-item.dropdown:hover .nav-link .arrow::before,
.nav-item.dropdown.show  .nav-link .arrow::before {
  color: #1677ff;
}

.nav-link.dropdown-toggle::after {
  /* content: "▾"; */
  margin-left: 4px;
  transition: 0.2s;
  display: none;
}

.nav-item.dropdown:hover .dropdown-megamenu-modern {
  display: block;
  opacity: 1;
}

/* Mobile menu: full width, no blur, no outer gaps */
#mobileMenu.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100dvh;
  min-height: 100vh;
  /* animation: zoomFromTopRight .3s ease-out both; */
  background: #f5f5f5;                 /* solid white */
  padding: 0;                       /* remove side gutters */
  overflow: hidden;

  /* keep your open animation if you use it */
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform .24s ease, opacity .24s ease;

  /* remove any backdrop blur */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* reveal state */
#mobileMenu.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* kill the inset card if it was added earlier */
#mobileMenu.mobile-menu::before { content: none !important; }

/* Header and footer fixed inside the overlay */
#mobileMenu .mobile-menu-header {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #eef0f4;
  z-index: 1;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}
#mobileMenu .mobile-menu-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #eef0f4;
  z-index: 1;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

/* Scroll only the content */
#mobileMenu .mobile-menu-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Optional: tidy the close button color */
#mobileMenu .close-btn {
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: #1e3a8a;
}

/* Lock background page scroll when menu is open */
html.no-scroll, body.no-scroll { overflow: hidden; height: 100%; }


.nav-item.dropdown .dropdown-megamenu-modern.compact {
  left: 0;
  transform: none;
  /* top: calc(100% + 12px);   */
}

/* 2) Compact menus size to their content like the right screenshot */
.dropdown-megamenu-modern.compact {
  display: block;
  width: max-content;
  max-width: 520px;
  min-width: 260px;
  padding: 1rem 1.25rem;  
}

/* 3) Inside compact menus, prevent Bootstrap rows from forcing full width */
.dropdown-megamenu-modern.compact .row {
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
  margin: 0;
  width: auto;
}
.dropdown-megamenu-modern.compact .col-md-12,
.dropdown-megamenu-modern.compact .col-12 {
  flex: 0 0 auto;
  width: auto;
}

/* 4) Products megamenu stays wide and uses three equal columns */
#productsDropdown + .dropdown-megamenu-modern {
  display: block;
  width: 620px;                                   /* adjust if you prefer */
  max-width: calc(100vw - 48px);
  padding: 1.5rem 1.75rem;
}
#productsDropdown + .dropdown-megamenu-modern .row {
  margin: 0;
  --bs-gutter-x: 24px;
}
#productsDropdown + .dropdown-megamenu-modern .col-md-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}

/* 5) Font Awesome right chevron on every menu item, aligned at the far right */
.dropdown-megamenu-modern .menu-item-link {
  display: flex;           /* shrink to the text block */
  align-items: center;
  justify-content: initial;       /* cancel any space-between */
  gap: .5rem;
  padding: 8px 0;
  color: #2a3a52;
  text-decoration: none;
  white-space: nowrap;
}
.dropdown-megamenu-modern .menu-item-link::after {
  content: "\f054";
  font: var(--fa-font-solid, normal normal 900 0.9rem/1 "Font Awesome 6 Free");
  opacity: .55;
  position: static;               /* stop absolute positioning */
  color: #c5cdd8;
  transform: none;
  margin-left: .75rem;
  transition: transform .15s ease, opacity .15s ease, color .15s ease;
  flex: 0 0 auto;                 /* never wraps */
}
.dropdown-megamenu-modern .menu-item-link:hover {
  color: #1677ff;
}
.dropdown-megamenu-modern .menu-item-link:hover::after {
  transform: translateX(4px);
  opacity: 1;
  color: #1677ff;
}

/* Arrow nub: anchor it near the left edge so it points to the trigger */
.nav-item.dropdown .dropdown-arrow {
  left: 28px;
  transform: none;
  top: -10px;
}

/* 6) Mobile keeps your existing full width overlay */
@media (max-width: 991.98px) {
  .dropdown-megamenu-modern.compact {
    width: 100%;
    max-width: none;
    border-radius: 0;
  }
  #productsDropdown + .dropdown-megamenu-modern {
    width: 100%;
    max-width: none;
    border-radius: 0;
  }
}
