/* ==========================================================================
   Header — Ultra Modern Dark
   Header, sticky nav, top bar, mobile nav.
   Source: ultra modern dark design guide.md, section 7
   ========================================================================== */

/* ---------- Top bar ---------- */

.top-bar {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--text-small);
}

.top-bar a,
.top-contact li,
.top-contact a,
.top-bar .top-bar-left,
.top-bar .top-bar-right {
  color: var(--text-muted);
}

.top-bar a:hover,
.top-contact a:hover {
  color: var(--text-primary);
}

/* ---------- Main header ---------- */

.header-section,
.header-section-1,
.header-section-2,
.header-section-3,
.header-section-4,
.header-section-5,
.header-section-6,
#header-section {
  background: rgba(9, 9, 9, 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  transition: var(--transition);
}

/* Transparent variant over hero — no bg until scroll */
.RWS2018-header-transparent {
  background: transparent;
  border-bottom-color: transparent;
}

/* ---------- Sticky header ---------- */

.sticky_nav .header-section,
.sticky_nav .header-transparent,
.sticky_nav #header-section {
  background: rgba(9, 9, 9, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/*
 * Prevent the invisible sticky-nav clone from intercepting touches on iOS.
 * iOS Safari hit-tests position:fixed + transform elements at their
 * pre-transform bounds, so the hidden clone steals taps from the real header.
 */
.sticky_nav {
  pointer-events: none;
}

.sticky_nav.sticky-on {
  pointer-events: auto;
}

/*
 * Parent CSS targets .sticky_nav.houzez-header-mobile but the theme
 * renamed the class to RWS2018-header-mobile. Replicate the intended
 * show/hide rules with the correct class name.
 */
.sticky_nav.RWS2018-header-mobile {
  display: none;
}

@media only screen and (max-width: 991px) {
  .sticky_nav.RWS2018-header-mobile {
    display: block;
  }
}

/* ---------- Logo ---------- */

.logo img {
  max-height: 50px;
  width: auto;
}

/* ---------- Navigation links ---------- */

.navi a,
.navi > ul > li > a {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
  transition: var(--transition);
}

.navi > ul > li > a:hover,
.navi > ul > li.active > a,
.navi > ul > li.current-menu-item > a,
.navi > ul > li.current-menu-parent > a {
  color: var(--text-primary);
  text-decoration: none;
}

/* Subtle underline on hover */
.navi > ul > li > a::after {
  content: "";
  display: block;
  width: 0;
  height: 1px;
  background: var(--text-primary);
  transition: width 0.3s ease;
}

.navi > ul > li > a:hover::after,
.navi > ul > li.active > a::after,
.navi > ul > li.current-menu-item > a::after {
  width: 100%;
}

/* ---------- Dropdown menus ---------- */

.navi > ul ul,
.navi > ul .houzez-megamenu-inner,
.navi > ul .sub-menu {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-elevated);
}

.navi > ul .sub-menu li a,
.navi > ul ul li a {
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 400;
}

.navi > ul .sub-menu li a:hover,
.navi > ul ul li a:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.04);
}

/* ---------- Header right / user area ---------- */

.header-right a,
.header-right .user-name,
.account-action > li > a {
  color: var(--text-secondary);
}

.header-right a:hover,
.account-action > li > a:hover {
  color: var(--text-primary);
}

.account-dropdown {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-elevated);
}

.account-dropdown > ul > li a {
  color: var(--text-secondary);
}

.account-dropdown > ul > li a:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.04);
}

/* ---------- Mobile header ---------- */

.header-mobile {
  background: rgba(9, 9, 9, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  overflow: visible;
  position: relative;
  z-index: 3000;
}

.header-mobile > .container {
  overflow: visible;
}

.mobile-nav .nav-trigger {
  color: var(--text-primary);
}

.mobile-nav .nav-trigger,
.mobile-nav .nav-trigger i {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
}

.mobile-nav .nav-trigger span,
.mobile-nav .nav-trigger span::before,
.mobile-nav .nav-trigger span::after {
  background-color: var(--text-primary);
}

.mobile-nav .nav-dropdown.nav-open {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 1000 !important;
  pointer-events: auto !important;
}

.mobile-nav .nav-dropdown {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
}

.header-mobile .mobile-nav .nav-dropdown,
.header-mobile .mobile-nav .nav-dropdown > ul,
.header-mobile .mobile-nav .nav-dropdown.nav-open,
.header-mobile .mobile-nav .nav-dropdown.nav-open > ul {
  background: var(--surface-elevated) !important;
  border-color: var(--border-subtle) !important;
  box-shadow: var(--shadow-elevated) !important;
}

.header-mobile .mobile-nav .nav-dropdown li {
  background: transparent !important;
  border-bottom: 1px solid var(--border-subtle) !important;
}

.header-mobile .mobile-nav .nav-dropdown li:last-child {
  border-bottom: 0 !important;
}

.header-mobile .mobile-nav .nav-dropdown a {
  color: var(--text-secondary) !important;
  background: transparent !important;
  font-family: var(--font-body) !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  border-bottom: 0 !important;
}

.header-mobile .mobile-nav .nav-dropdown a:hover,
.header-mobile .mobile-nav .nav-dropdown li.current-menu-item > a,
.header-mobile .mobile-nav .nav-dropdown li.current_page_item > a,
.header-mobile .mobile-nav .nav-dropdown li.current-menu-parent > a {
  color: var(--text-primary) !important;
  background-color: rgba(255, 255, 255, 0.04) !important;
}

.mobile-nav .nav-dropdown a {
  color: var(--text-secondary);
  font-family: var(--font-body);
  border-bottom-color: var(--border-subtle);
}

.mobile-nav .nav-dropdown a:hover {
  color: var(--text-primary);
}

.mobile-nav .nav-dropdown li .expand-me {
  color: var(--text-muted);
  border-left-color: var(--border-subtle);
}

/* ---------- Login / user links in header ---------- */

.header-right > .user a.rws-user-links {
  font-size: 11px;
  color: var(--text-muted);
}

.header-right > .user a.rws-user-links:hover {
  color: var(--text-primary);
}
