/* header.css - Minimal, robust */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; }

/* ================= HEADER WRAPPER ================= */
.head-nav-r {
  background: #0d3b66;
  color: #fff;
  width: 100%;
  z-index: 999;
  position: relative;
  font-family: Arial, sans-serif;
  font-weight: normal;
}

:root { --nav-height: 56px; }

/* Inner container */
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--nav-height);
}

/* Logo */
.logo {
  font-weight: 400;
  font-size: 16px;
  color: #fff;
}

/* Mobile toggle */
.nav-toggle { display: none; background: transparent; border: 0; color: #fff; font-size: 20px; cursor: pointer; }


/* ================= MENU BASE ================= */
.items { display: block; }
.menu { list-style: none; display:flex; gap:18px; align-items:center; margin:0; padding:0; height: 100%; }
.menu li { height: 100%; display: flex; align-items: center; }

/* Base link style */
.menu a,
.custom-topnav a,
.topnav-submenu a {
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  font-size: 14px;
  white-space: nowrap;
  color: #f2f2f2; /* default */
}

/* Hover (mobile/general) */
.menu a:hover,
.custom-topnav a:hover,
.topnav-submenu a:hover {
  background-color: #006699;
  color: #1da1f2;
}

/* ================= DROPDOWNS ================= */
.topnav { position: relative; }
.custom-topnav, .topnav-submenu {
  display: none;
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  background: #0d3b66;
  min-width: 180px;
  border: 1px solid #00334d;
  z-index: 90;
}
.topnav-submenu {
  left: 100%;
  top: 0;
}
.custom-topnav > li,
.topnav-submenu > li {
  position: relative;
}
/* Default: hide it on desktop */
.caret-mobile {
  display: none;
}

/* ================= DESKTOP (≥901px) ================= */
@media (min-width: 901px) {
  .topnav:hover > .custom-topnav { display: block; }
  .topnav-sub:hover > .topnav-submenu { display: block; }

  /* base desktop links */
  .menu a,
  .custom-topnav a,
  .topnav-submenu a {
    position: relative;
    overflow: hidden;
    transition: color 0.3s ease;
    font-weight: 400;
    color: #fff; /* default white */
  }

  /* underline */
  .menu a::after,
  .custom-topnav a::after,
  .topnav-submenu a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 4px;
    width: 0;
    height: 2px;
    background-color: #1da1f2; /* blue underline */
    transition: width 0.3s ease;
  }

  /* hover always = blue text + underline */
  .menu a:hover,
  .menu a.active:hover,
  .custom-topnav a:hover,
  .topnav-submenu a:hover {
    background-color: transparent;
    color: #1da1f2 !important;
  }

  .menu a:hover::after,
  .custom-topnav a:hover::after,
  .topnav-submenu a:hover::after {
    width: 100%;
  }

  /* active link */
  .menu a.active {
   
    font-weight: 600;
  }

  /* visited fix */
  .menu a:visited {
    color: #fff;
  }
}

/* ================= MOBILE (≤900px) ================= */
@media (max-width: 900px) {
  .nav-toggle { display: block; }

  .items {
    position: fixed;
    top: 0;
    left: -260px;
    height: 100%;
    width: 260px;
    background: #0d3b66;
    padding-top: 60px;
    transition: left 0.28s ease;
    z-index: 1000;
    overflow-y: auto;
  }
  .items.open { left: 0; }

  .menu {
    flex-direction: column;
    gap: 0;
    padding: 12px 8px 24px;
  }

  .menu li {
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: block;
    height: auto !important; /* only mobile */
  }

  .menu a {
    padding: 12px 16px;
    width: 100%;
    justify-content: space-between;
    height: auto !important; /* only mobile */
    white-space: nowrap;
  }

  .custom-topnav,
  .topnav-submenu {
    position: static;
    display: none;
    background: transparent;
    border: none;
    padding-left: 12px;
    margin: 0;
  }

  /* reveal submenus on .open */
  .topnav.open > .custom-topnav,
  .topnav.open > .topnav-submenu,
  .topnav-sub.open > .custom-topnav,
  .topnav-sub.open > .topnav-submenu {
    display: block;
  }

  .topnav .custom-topnav li,
  .topnav .topnav-submenu li { border-bottom: none; }
  .topnav .custom-topnav a,
  .topnav .topnav-submenu a {
    display: block;
    padding: 10px 18px;
    width: 100%;
    white-space: normal;
    line-height: 1.2;
  }

  .menu li > a .caret { font-size: 14px; opacity: 0.9; margin-left: 6px; }

  /* optional submenu panel */
  .submenu-panel {
    position: fixed;
    top: 0;
    left: 260px;
    height: 100%;
    width: 260px;
    background: #0d3b66;
    z-index: 1010;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    padding-top: 60px;
  }
  .submenu-panel.open { transform: translateX(0); }
  .submenu-panel .panel-header {
    display:flex; align-items:center; gap:8px;
    padding:12px 16px;
    border-bottom:1px solid rgba(255,255,255,0.06);
  }
  .submenu-panel .panel-header .back-btn {
    background: transparent; border: 0; color: #fff; font-size:18px; cursor:pointer;
  }
  .submenu-panel ul { list-style:none; padding: 8px 0; margin: 0; }
  .submenu-panel li a { padding: 1px 1px; display:block; border-bottom:1px solid rgba(255,255,255,0.03); }

  /* overlay when menu open */
  .menu-overlay {
    display:none;
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.25);
    z-index: 1005;
  }
  .menu-overlay.show { display:block; }
}
/* Show it on mobile (e.g., below 768px width) */
@media (max-width: 768px) {
  .caret-mobile {
    display: inline;
  }
}