/* =====================================================================
   R3 Life top navbar (layout_menu.blade.php) — redesign 2026-10-20
   ---------------------------------------------------------------------
   ≥1400px  : 3-column grid  [left menu | logo | right menu] — the logo
              is a real grid column (not absolutely positioned), so it is
              always centred and the menus can never slide under it.
   <1400px  : logo + burger bar; the menu opens as a floating white card
              (full width on phones, 380px right-aligned on tablets) with
              a dimmed backdrop behind it.
   Outer height is unchanged (nav min-height 80px + Bootstrap padding ≈ 98px)
   because every page offsets its content for the existing .fixed-top.
   ===================================================================== */

.r3-nav {
  --r3-navy: #0e4e91;
  --r3-ink: #23324d;
  --r3-tint: rgba(14, 78, 145, 0.07);
  --r3-grad: linear-gradient(72.47deg, #0e4e91 22.16%, #3680d0 76.47%);
  background-color: rgba(255, 255, 255, 0.97) !important;
  transition: box-shadow 0.25s ease;
}
.fixed-top.is-scrolled .r3-nav {
  box-shadow: 0 6px 24px rgba(14, 40, 80, 0.08);
}
.r3-nav-inner {
  position: relative;
  overflow: visible !important; /* style-release-2 sets overflow-x:hidden on every .container-* <768px, which clips the menu card */
}

/* ---------- shared link look ---------- */
.r3-nav .navbar-nav .nav-link {
  font-family: 'BRSonoma', sans-serif;
  font-weight: 500;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--r3-ink) !important; /* theme-default colours .navbar-nav > .nav-item > .nav-link grey */
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: 50rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.r3-nav .navbar-nav .nav-link:hover,
.r3-nav .navbar-nav .nav-link:focus-visible,
.r3-nav .navbar-nav .show > .nav-link {
  color: var(--r3-navy) !important;
  background-color: var(--r3-tint);
}
/* current page: soft navy pill (the solid gradient is reserved for CALL) */
.r3-nav .navbar-nav .nav-link.active {
  color: var(--r3-navy) !important;
  background: var(--r3-tint);
}
.r3-nav .nav-link .ti {
  font-size: 1.25rem;
  line-height: 1;
  margin: 0;
}
/* chevron of the SERVICE toggle: centred on the text, flips when open */
.r3-nav .dropdown-toggle::after {
  margin: 0 0 0 0.1rem;
  width: 0.4em;
  height: 0.4em;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-0.12em) rotate(45deg);
  transition: transform 0.2s ease;
}
.r3-nav .show > .dropdown-toggle::after {
  transform: translateY(0.12em) rotate(-135deg);
}

/* ---------- SERVICE dropdown ---------- */
.r3-nav .dropdown-menu {
  min-width: 240px;
  padding: 0.5rem;
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 16px 40px rgba(14, 40, 80, 0.14);
}
.r3-nav .dropdown-item {
  font-family: 'BRSonoma', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--r3-ink);
  padding: 0.65rem 0.9rem;
  border-radius: 0.6rem;
}
.r3-nav .dropdown-item:hover,
.r3-nav .dropdown-item:focus,
.r3-nav .dropdown-item.active,
.r3-nav .dropdown-item:active {
  color: var(--r3-navy) !important; /* theme paints .dropdown-item.active white text */
  background-color: var(--r3-tint) !important;
}
.r3-nav .dropdown-item.active {
  font-weight: 700;
}

/* ---------- CALL button ---------- */
.r3-nav-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 42px;
  padding: 0 1.1rem;
  border-radius: 50rem;
  background: var(--r3-grad);
  color: #fff !important;
  font-family: 'BRSonoma', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(14, 78, 145, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.r3-nav-call:hover,
.r3-nav-call:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(14, 78, 145, 0.32);
}
.r3-nav-call .ti {
  font-size: 1.05rem;
  line-height: 1;
}

.r3-nav-logo img,
.r3-nav-brand img {
  display: block;
  height: auto;
}

/* =====================================================================
   Desktop ≥1400px
   ===================================================================== */
@media (min-width: 1400px) {
  .r3-nav-inner {
    max-width: 1440px;
  }
  .r3-nav .r3-nav-collapse {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 0.75rem;
  }
  .r3-nav .navbar-nav {
    align-items: center;
    gap: 0.1rem;
    flex-wrap: nowrap;
  }
  .r3-nav .navbar-nav > * {
    flex-shrink: 0;
  }
  .r3-nav .r3-nav-left {
    justify-content: flex-start;
  }
  .r3-nav .r3-nav-right {
    justify-content: flex-end;
  }
  .r3-nav .navbar-nav .nav-link {
    height: 40px;
    padding: 0 0.6rem;
  }
  /* Home = round icon button, icon optically centred */
  .r3-nav .navbar-nav .nav-link.r3-nav-home {
    width: 40px;
    padding: 0;
    justify-content: center;
  }
  .r3-nav-logo img {
    width: 165px;
  }
  .r3-nav .r3-nav-call {
    margin-left: 0.3rem;
  }
  .r3-nav .dropdown-menu {
    margin-top: 0.6rem !important;
  }
}

/* 1400–1499px: the right menu is only a few px narrower than its column — tighten a little */
@media (min-width: 1400px) and (max-width: 1499.98px) {
  .r3-nav .navbar-nav .nav-link {
    font-size: 0.73rem;
    padding: 0 0.5rem;
  }
}

/* =====================================================================
   Collapsed <1400px
   ===================================================================== */
@media (max-width: 1399.98px) {
  .r3-nav-brand {
    padding: 0;
    margin: 0;
  }
  .r3-nav-brand img {
    width: 170px;
  }

  /* burger: 3 lines → X */
  .r3-nav .r3-nav-toggler {
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: var(--r3-tint);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
  }
  .r3-burger {
    position: relative;
    width: 20px;
    height: 14px;
  }
  .r3-burger span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--r3-navy);
    transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
  }
  .r3-burger span:nth-child(1) { top: 0; }
  .r3-burger span:nth-child(2) { top: 6px; }
  .r3-burger span:nth-child(3) { top: 12px; }
  .r3-nav-toggler:not(.collapsed) .r3-burger span:nth-child(1) { top: 6px; transform: rotate(45deg); }
  .r3-nav-toggler:not(.collapsed) .r3-burger span:nth-child(2) { opacity: 0; }
  .r3-nav-toggler:not(.collapsed) .r3-burger span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

  /* floating menu card */
  .r3-nav .r3-nav-collapse {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0.75rem;
    right: 0.75rem;
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 20px 50px rgba(14, 40, 80, 0.18);
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .r3-nav .r3-nav-collapse.show,
  .r3-nav .r3-nav-collapse.collapsing {
    padding: 0.6rem;
  }
  .r3-nav .navbar-nav .nav-link {
    display: flex;
    width: 100%;
    font-size: 0.92rem;
    padding: 0.85rem 1rem !important;
    border-radius: 0.8rem;
  }
  .r3-nav .navbar-nav .nav-link .ti {
    color: var(--r3-navy);
  }
  /* SERVICE: chevron pushed to the right edge of the row */
  .r3-nav .dropdown-toggle::after {
    margin-left: auto;
  }
  .r3-nav .r3-nav-right {
    border-top: 1px solid rgba(14, 78, 145, 0.08);
    margin-top: 0.35rem;
    padding-top: 0.35rem;
  }
  /* SERVICE submenu: inline list with a guide line */
  .r3-nav .r3-nav-collapse .dropdown-menu {
    position: static !important;
    transform: none !important;
    box-shadow: none;
    background: transparent;
    margin: 0 0 0.25rem 1.6rem;
    padding: 0 0 0 0.6rem;
    border-left: 2px solid rgba(14, 78, 145, 0.12);
    border-radius: 0;
  }
  .r3-nav .r3-nav-collapse .dropdown-item {
    font-size: 0.88rem;
    padding: 0.65rem 0.9rem;
  }
  .r3-nav .r3-nav-call {
    width: 100%;
    height: 50px;
    margin-top: 0.6rem;
    font-size: 0.9rem;
  }

  /* dimmed page behind the open menu (click closes it) */
  .r3-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(12, 30, 60, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
  .fixed-top.nav-open .r3-nav-backdrop {
    opacity: 1;
    visibility: visible;
  }
}
@media (min-width: 576px) and (max-width: 1399.98px) {
  .r3-nav .r3-nav-collapse {
    left: auto;
    width: 380px;
  }
}
@media (max-width: 1399.98px) {
  [dir="rtl"] .r3-nav .r3-nav-collapse { left: 0.75rem; right: 0.75rem; }
}
@media (min-width: 576px) and (max-width: 1399.98px) {
  [dir="rtl"] .r3-nav .r3-nav-collapse { right: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .r3-nav *, .r3-nav-backdrop { transition: none !important; }
}
