:root {
  --nav-bg: rgb(7, 28, 74);
  --nav-text: #ffffff;
  --accent: #f4b748;
  --accent-hover: #f2c46a;
  --link-underline: var(--accent);
    --nav-height: 80px;
}


/* base */
.main-navbar {
  background-color: var(--nav-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== Desktop-only layout & sizing ===== */
@media (min-width: 992px) {
  .desktop-navbar {
    min-height: var(--nav-height);
  }

  .desktop-navbar .container-fluid {
    display: flex;
    align-items: center;
  }

  /* =========================================
     🔽 RTL Dropdown — 3x3 Grid Layout (mega menu)
     ========================================= */
  .desktop-navbar .hover-dropdown .dropdown-menu-rtl {
    position: absolute;
    left: -500% !important;
    transform: translateX(50%);
    top: 3rem;

    /* ⬇️ Size tuning (requested) */
    width: 36rem !important;            /* narrower box */
    min-width: 40rem !important;        /* lock same width */
    max-width: 40rem !important;
    min-height: 10rem !important;       /* taller box */
    padding-block: 1.25rem !important;  /* more vertical breathing */
    padding-inline: 1.25rem !important; /* slightly tighter horizontally */
    row-gap: 0.9rem !important;         /* taller feel via rows */
    column-gap: 4rem !important;        /* reduce width footprint */

    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: auto;

    border: none;
    border-radius: 0.6rem !important;
    text-align: right;
    box-shadow: 0 12px 26px rgba(0,0,0,0.22), 0 6px 14px rgba(0,0,0,0.10) !important;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform-origin: top center;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  /* Base dropdown (small menus if any) */
  .desktop-navbar .dropdown-menu-rtl {
    top: 3.4rem !important;
    inset-inline-end: 0 !important;
    border: none !important;
    border-radius: 0.5rem !important;
    padding: 0.8rem 1rem !important;
    text-align: right !important;
    direction: rtl !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(0);
    transition: opacity 0.15s ease-in-out;
  }

  /* Open the menu when hovering trigger OR the menu itself */
  .desktop-navbar .hover-dropdown:hover .dropdown-menu-rtl,
  .desktop-navbar .hover-dropdown .dropdown-menu-rtl:hover {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: grid !important;
  }

  .nav_item_pad{
    padding: 15px !important;
  }

  /* ✅ Keep hover alive while moving from button to menu (hover bridge) */
  .desktop-navbar .hover-dropdown {
    position: relative;
  }
  .desktop-navbar .hover-dropdown::after {
    content: "";
    position: absolute;
    inset-inline-end: 0;
    top: 100%;
    width: 100%;
    height: 16px; /* a bit bigger bridge */
    pointer-events: auto;
  }

  /* ✅ Dropdown items: text-sized pills (hug text only) */
  .desktop-navbar .dropdown-menu-rtl .dropdown-item {
    color: #132449;
    font-weight: 700;                    /* bolder for prominence */
    font-size: var(--dd-text-size) !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    direction: rtl !important;
    text-align: right !important;

    display: inline-block !important;    /* stop stretching to full cell */
    width: auto !important;              /* hug content width */
    /*padding: 0.3rem 0.6rem !important;   !* compact pill padding *!*/
    margin-inline: 0;
    border-radius: 0.5rem !important;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  }

  /* 🔥 More prominent hover */
  .desktop-navbar .dropdown-menu-rtl .dropdown-item:hover {
    background-color: #0c1f45 !important; /* deeper than #132449 */
    color: #fff !important;
    box-shadow:
      0 0 0 2px rgba(12, 31, 69, 0.85) inset,   /* inner ring/pill edge */
      0 4px 10px rgba(12, 31, 69, 0.25);        /* soft glow */
  }

  /* Optional: keep icons same size even when text shrinks */
  .desktop-navbar .dropdown-menu-rtl .dropdown-item i,
  .desktop-navbar .dropdown-menu-rtl .dropdown-item svg {
    font-size: 1rem !important;
  }

  /* ordering / layout */
  .desktop-navbar .nav-cta { order: 1; }
  .desktop-navbar #mainNav { order: 2; flex: 1 1 auto; }
  .desktop-navbar .logo-desktop { order: 3; }

  .desktop-navbar #mainNav.navbar-collapse {
    display: flex !important;
    justify-content: center !important;
  }

  .desktop-navbar .brand-logo {
    height: 84px;
    width: auto;
    object-fit: contain;
  }

  .desktop-navbar .main-menu {
    display: flex;
    gap: 2.5rem;
  }

  .desktop-navbar .main-menu .nav-link {
    color: var(--nav-text);
    font-size: 1.125rem;
    padding-inline: 1.25rem;
    position: relative;
    opacity: 0.9;
    transition: opacity 0.2s ease, color 0.2s ease;
  }

  .desktop-navbar .main-menu .nav-link:hover {
    opacity: 1;
    color: var(--accent);
  }

  /* remove underline */
  .desktop-navbar .main-menu .nav-link::after,
  .desktop-navbar .active-link::after,
  .desktop-navbar .hover-dropdown > .nav-link::after {
    content: none;
  }

  .desktop-navbar .cta-btn {
    background-color: var(--accent);
    color: #1e1e1e;
    border: none;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.05s ease;
    /*margin-inline-end: 2rem;*/
  }

  .desktop-navbar .cta-btn:hover {
    background-color: var(--accent-hover);
  }
}

/* ---------------------------------
   📱 Mobile-only styles
   ---------------------------------*/
@media (max-width: 991.98px) {
  .desktop-navbar { display: none !important; }

  .mobile-navbar {
    display: block !important;
    background-color: rgb(7, 28, 74) !important;
  }

  .mobile-navbar .navbar-toggler { border: none; box-shadow: none; }

  .mobile-navbar .navbar-toggler-icon {
    background-image: none;
    width: 22px;
    height: 2px;
    background-color: white;
    position: relative;
    display: inline-block;
  }

  .mobile-navbar .navbar-toggler-icon::before,
  .mobile-navbar .navbar-toggler-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background-color: white;
  }

  .mobile-navbar .navbar-toggler-icon::before { top: -6px; }
  .mobile-navbar .navbar-toggler-icon::after { top: 6px; }

  .mobile-navbar .brand-logoo { height: 55px; object-fit: contain; }

  .offcanvas.text-bg-dark { background-color: rgb(7, 28, 74); }
  .offcanvas-header { border-bottom: 1px solid rgb(7, 28, 74); }

  .offcanvas-body {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .offcanvas-body .navbar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
  }

  [dir="rtl"] .offcanvas-body .nav-link {
    color: #fff;
    text-align: right !important;
    position: relative;
    margin-inline-start: 9rem;
    padding-inline: 1rem !important;
    display: block;
  }

  .offcanvas-body .nav-link:hover { color: var(--accent); }

  [dir="rtl"] .offcanvas-body .mobile-accordion-toggle {
    background: transparent;
    border: 0;
    color: #fff;
    width: 100%;
    display: flex;
    justify-content: space-between;
    text-align: right !important;
    padding-block: 0.5rem;
    padding-inline: 1rem !important;
    margin-inline-start: 1rem;
  }

  [dir="rtl"] .offcanvas-body .mobile-accordion-toggle span {
    direction: rtl;
    display: inline-block;
  }

  .offcanvas-body .mobile-accordion-toggle .bi {
    margin-inline-start: 0.5rem;
    transition: transform 0.2s ease;
  }

  .mobile-accordion-toggle.collapsed .bi { transform: rotate(0deg); }
  .mobile-accordion-toggle:not(.collapsed) .bi { transform: rotate(180deg); }

  .offcanvas-body .collapse .dropdown-item,
  .offcanvas-body .mobile-scroll .dropdown-item {
    text-align: right !important;
    padding-inline: 1rem !important;
    color: #e5e7eb;
    padding-block: 0.5rem;
    border-radius: 0.35rem;
  }

  .offcanvas-body .mobile-scroll .dropdown-item:hover,
  .offcanvas-body .collapse .dropdown-item:hover {
    background: #f2c46a;
    color: #fff;
  }

  .mobile-scroll { max-height: 14rem; overflow-y: auto; width: 100%; }

  .cta-btnn {
    background-color: var(--accent);
    color: #1e1e1e;
    border: none;
    font-weight: 600;
    display: block;
    width: 100% !important;
    border-radius: 0 !important;
    margin: 0;
    transition: background-color 0.2s ease, transform 0.05s ease;
  }

  .cta-btnn:hover { background-color: var(--accent-hover); }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .main-navbar { min-height: 78px; }
  .brand-logo { height: 52px; }
}

/* ==== Desktop swap: put LOGO where button was, and BUTTON where logo was ==== */
@media (min-width: 992px) {
  .desktop-navbar .logo-desktop { order: 1; margin-inline-end: 2rem; }
  .desktop-navbar #mainNav { order: 2; }
  .desktop-navbar .nav-cta { order: 3; margin-inline-start: 2rem; }
}
