/* BNRE header layer: desktop, tablet, and mobile header refinements. */

/* ==========================================================
   BNRE Header Alignment Refresh (Desktop Only - Header v4)
   Scope: alignment/spacing/active-chip only, no mobile edits
   ========================================================== */
@media (min-width: 1200px) {
	/* Add balanced left/right breathing space */
	.header-main-wrap .header-v4 > .container,
	.header-main-wrap .header-v4 > .container-fluid {
		padding-left: clamp(24px, 2.2vw, 44px);
		padding-right: clamp(24px, 2.2vw, 44px);
	}

	/* Refined desktop header background (same BNRE palette, richer depth) */
	.header-main-wrap .header-v4 {
		position: relative;
		overflow: visible;
		background: linear-gradient(
			100deg,
			rgba(0, 29, 57, 0.97) 0%,
			rgba(0, 43, 86, 0.95) 52%,
			rgba(0, 29, 57, 0.97) 100%
		);
		box-shadow:
			0 10px 28px rgba(0, 0, 0, 0.2),
			inset 0 -1px 0 rgba(255, 255, 255, 0.14);
	}

	.header-main-wrap .header-v4::before {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 0;
		pointer-events: none;
		background: radial-gradient(
			950px 220px at 50% -130px,
			rgba(255, 255, 255, 0.17) 0%,
			rgba(255, 255, 255, 0) 65%
		);
	}

	.header-main-wrap .header-v4 .header-inner-wrap {
		position: relative;
		z-index: 2;
		min-height: 92px;
	}

	.header-main-wrap .header-v4 .main-nav .dropdown-menu {
		z-index: 999;
		background: linear-gradient(
			120deg,
			rgba(0, 29, 57, 0.98) 0%,
			rgba(0, 43, 86, 0.96) 100%
		);
		border: 1px solid rgba(255, 255, 255, 0.16);
		border-radius: 14px;
		padding: 8px;
		box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
	}

	.header-main-wrap .header-v4 .main-nav .dropdown-menu .dropdown-item {
		color: rgba(255, 255, 255, 0.9);
		border-radius: 10px;
		padding: 10px 14px;
		background: transparent;
	}

	.header-main-wrap .header-v4 .main-nav .dropdown-menu .dropdown-item:hover,
	.header-main-wrap .header-v4 .main-nav .dropdown-menu .dropdown-item:focus,
	.header-main-wrap .header-v4 .main-nav .dropdown-menu .dropdown-item.active {
		background: rgba(255, 255, 255, 0.12);
		color: #ffffff;
	}

	.header-main-wrap .header-v4 .navbar {
		display: flex !important;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: space-between;
		gap: 20px;
		min-height: 92px;
	}

	/* Left anchor: logo block stays stable */
	.header-main-wrap .header-v4 .logo.logo-desktop {
		flex: 0 0 340px;
		width: 340px;
		display: flex;
		align-items: center;
	}

	.header-main-wrap .header-v4 .logo.logo-desktop a {
		display: flex;
		align-items: center;
	}

	/* Center cluster: menu centered with controlled rhythm */
	.header-main-wrap .header-v4 .main-nav {
		flex: 1 1 auto;
		min-width: 0;
		display: flex;
		justify-content: center;
	}

	.header-main-wrap .header-v4 .main-nav .navbar-nav {
		justify-content: center !important;
		align-items: center;
		flex-wrap: nowrap;
		column-gap: 6px;
	}

	.header-main-wrap .header-v4 .main-nav .nav-item {
		display: inline-flex;
		align-items: center;
	}

	.header-main-wrap .header-v4 .main-nav:not(.houzez-nav-menu-main) .nav-link {
		display: inline-flex;
		align-items: center;
		padding: 10px 16px !important;
		border-radius: 999px;
		line-height: 1.15;
		white-space: nowrap;
	}

	.header-main-wrap .header-v4 .main-nav .dropdown-toggle::after {
		float: none;
		margin-left: 8px;
		margin-top: 0;
		vertical-align: middle;
	}

	/* Active-item chip like reference, using existing BNRE palette */
	.header-main-wrap .header-v4 .main-nav .current-menu-item > a,
	.header-main-wrap .header-v4 .main-nav .current-menu-ancestor > a {
		background: rgba(255, 255, 255, 0.14);
	}

	.header-main-wrap .header-v4 .main-nav .nav-link:hover {
		background: rgba(255, 255, 255, 0.09);
	}

	.header-main-wrap .header-v4 .main-nav .nav-link:focus-visible {
		outline: 2px solid rgba(255, 255, 255, 0.42);
		outline-offset: 2px;
	}

	/* Right anchor: phone sits cleanly on baseline */
	.header-main-wrap .header-v4 .login-register {
		flex: 0 0 340px;
		width: 340px;
		display: flex;
		justify-content: flex-end;
	}

	.header-main-wrap .header-v4 .login-register-nav {
		display: inline-flex;
		align-items: center;
	}

	.header-main-wrap .header-v4 .login-register-nav .btn-phone-number a {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		padding: 10px 0;
		line-height: 1.1;
	}

	.header-main-wrap .header-v4 .login-register-nav .btn-phone-number .icon-phone-actions-ring {
		top: 0;
	}
}

/* ==========================================================
   BNRE Header Alignment Refresh (Tablet + Mobile)
   Scope: carry desktop visual system to tablet/mobile safely
   ========================================================== */
@media (min-width: 992px) and (max-width: 1199.98px) {
	.header-main-wrap .header-v4 > .container,
	.header-main-wrap .header-v4 > .container-fluid {
		padding-left: clamp(18px, 2vw, 30px);
		padding-right: clamp(18px, 2vw, 30px);
	}

	.header-main-wrap .header-v4 {
		position: relative;
		overflow: visible;
		background: linear-gradient(
			100deg,
			rgba(0, 29, 57, 0.97) 0%,
			rgba(0, 43, 86, 0.95) 52%,
			rgba(0, 29, 57, 0.97) 100%
		);
		box-shadow:
			0 10px 24px rgba(0, 0, 0, 0.2),
			inset 0 -1px 0 rgba(255, 255, 255, 0.14);
	}

	.header-main-wrap .header-v4::before {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 0;
		pointer-events: none;
		background: radial-gradient(
			760px 190px at 50% -115px,
			rgba(255, 255, 255, 0.16) 0%,
			rgba(255, 255, 255, 0) 68%
		);
	}

	.header-main-wrap .header-v4 .header-inner-wrap {
		position: relative;
		z-index: 2;
		min-height: 84px;
	}

	.header-main-wrap .header-v4 .navbar {
		display: flex !important;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		min-height: 84px;
	}

	.header-main-wrap .header-v4 .logo.logo-desktop {
		flex: 0 0 280px;
		width: 280px;
		display: flex;
		align-items: center;
	}

	.header-main-wrap .header-v4 .logo.logo-desktop a {
		display: flex;
		align-items: center;
	}

	.header-main-wrap .header-v4 .logo.logo-desktop img {
		max-height: 62px;
		width: auto;
	}

	.header-main-wrap .header-v4 .main-nav {
		flex: 1 1 auto;
		min-width: 0;
		display: flex;
		justify-content: center;
	}

	.header-main-wrap .header-v4 .main-nav .navbar-nav {
		justify-content: center !important;
		align-items: center;
		flex-wrap: nowrap;
		column-gap: 2px;
	}

	.header-main-wrap .header-v4 .main-nav:not(.houzez-nav-menu-main) .nav-link {
		display: inline-flex;
		align-items: center;
		padding: 8px 11px !important;
		border-radius: 999px;
		line-height: 1.15;
		white-space: nowrap;
		font-size: 15px;
	}

	.header-main-wrap .header-v4 .main-nav .dropdown-toggle::after {
		float: none;
		margin-left: 7px;
		margin-top: 0;
		vertical-align: middle;
	}

	.header-main-wrap .header-v4 .main-nav .current-menu-item > a,
	.header-main-wrap .header-v4 .main-nav .current-menu-ancestor > a {
		background: rgba(255, 255, 255, 0.14);
	}

	.header-main-wrap .header-v4 .main-nav .nav-link:hover {
		background: rgba(255, 255, 255, 0.09);
	}

	.header-main-wrap .header-v4 .main-nav .nav-link:focus-visible {
		outline: 2px solid rgba(255, 255, 255, 0.42);
		outline-offset: 2px;
	}

	.header-main-wrap .header-v4 .main-nav .dropdown-menu {
		z-index: 999;
		background: linear-gradient(
			120deg,
			rgba(0, 29, 57, 0.98) 0%,
			rgba(0, 43, 86, 0.96) 100%
		);
		border: 1px solid rgba(255, 255, 255, 0.16);
		border-radius: 12px;
		padding: 7px;
		box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
	}

	.header-main-wrap .header-v4 .main-nav .dropdown-menu .dropdown-item {
		color: rgba(255, 255, 255, 0.9);
		border-radius: 9px;
		padding: 9px 12px;
		background: transparent;
	}

	.header-main-wrap .header-v4 .main-nav .dropdown-menu .dropdown-item:hover,
	.header-main-wrap .header-v4 .main-nav .dropdown-menu .dropdown-item:focus,
	.header-main-wrap .header-v4 .main-nav .dropdown-menu .dropdown-item.active {
		background: rgba(255, 255, 255, 0.12);
		color: #ffffff;
	}

	.header-main-wrap .header-v4 .login-register {
		flex: 0 0 220px;
		width: 220px;
		display: flex;
		justify-content: flex-end;
	}

	.header-main-wrap .header-v4 .login-register-nav {
		display: inline-flex;
		align-items: center;
	}

	.header-main-wrap .header-v4 .login-register-nav .btn-phone-number a {
		display: inline-flex;
		align-items: center;
		gap: 7px;
		padding: 8px 0;
		line-height: 1.1;
		font-size: 14px;
	}

	.header-main-wrap .header-v4 .login-register-nav .btn-phone-number .icon-phone-actions-ring {
		top: 0;
	}
}

@media (max-width: 991.98px) {
	#header-mobile.header-mobile {
		position: relative;
		overflow: hidden;
		height: 66px;
		padding: 0 14px;
		background: linear-gradient(
			100deg,
			rgba(0, 29, 57, 0.98) 0%,
			rgba(0, 43, 86, 0.96) 54%,
			rgba(0, 29, 57, 0.98) 100%
		);
		box-shadow:
			0 8px 20px rgba(0, 0, 0, 0.18),
			inset 0 -1px 0 rgba(255, 255, 255, 0.14);
	}

	#header-mobile.header-mobile::before {
		content: "";
		position: absolute;
		inset: 0;
		pointer-events: none;
		background: radial-gradient(
			620px 170px at 50% -105px,
			rgba(255, 255, 255, 0.18) 0%,
			rgba(255, 255, 255, 0) 70%
		);
	}

	#header-mobile .header-mobile-left,
	#header-mobile .header-mobile-right {
		position: relative;
		z-index: 1;
		min-width: 54px;
	}

	#header-mobile .header-mobile-center {
		position: relative;
		z-index: 1;
		display: flex;
		align-items: center;
		justify-content: center;
		min-width: 0;
	}

	#header-mobile .logo {
		margin: 0 auto;
	}

	#header-mobile .logo img {
		max-height: 42px;
		width: auto;
	}

	#header-mobile .toggle-button-left,
	#header-mobile .toggle-button-right {
		color: #ffffff;
		font-size: 20px;
		width: 42px;
		height: 42px;
		border-radius: 50%;
		background: rgba(255, 255, 255, 0.1);
		display: inline-flex;
		align-items: center;
		justify-content: center;
		transition: background-color 0.2s ease, color 0.2s ease;
	}

	#header-mobile .toggle-button-left:hover,
	#header-mobile .toggle-button-left:focus,
	#header-mobile .toggle-button-right:hover,
	#header-mobile .toggle-button-right:focus {
		color: #ffffff;
		background: rgba(255, 255, 255, 0.18);
	}

	#header-mobile .toggle-button-left:focus-visible,
	#header-mobile .toggle-button-right:focus-visible {
		outline: 2px solid rgba(255, 255, 255, 0.44);
		outline-offset: 2px;
	}

	.offcanvas-mobile-menu,
	.offcanvas-login-register {
		background: linear-gradient(
			155deg,
			rgba(0, 29, 57, 0.99) 0%,
			rgba(0, 43, 86, 0.97) 55%,
			rgba(0, 29, 57, 0.99) 100%
		);
		color: rgba(255, 255, 255, 0.92);
		border-left: 1px solid rgba(255, 255, 255, 0.14);
	}

	.offcanvas-mobile-menu .offcanvas-header,
	.offcanvas-login-register .offcanvas-header {
		border-bottom: 1px solid rgba(255, 255, 255, 0.14);
		padding: 14px 16px;
	}

	.offcanvas-mobile-menu .offcanvas-title,
	.offcanvas-login-register .offcanvas-title {
		color: #ffffff;
		font-size: 16px;
		font-weight: 600;
	}

	.offcanvas-mobile-menu .btn-close,
	.offcanvas-login-register .btn-close {
		color: rgba(255, 255, 255, 0.92);
		opacity: 1;
		width: 36px;
		height: 36px;
		border-radius: 50%;
		background: rgba(255, 255, 255, 0.1);
		padding: 0;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.offcanvas-mobile-menu .btn-close:hover,
	.offcanvas-mobile-menu .btn-close:focus,
	.offcanvas-login-register .btn-close:hover,
	.offcanvas-login-register .btn-close:focus {
		background: rgba(255, 255, 255, 0.18);
		color: #ffffff;
	}

	.nav-mobile .main-nav,
	.nav-mobile .navi-login-register {
		background: transparent;
	}

	.nav-mobile .main-nav .navbar-nav {
		padding: 10px 0;
	}

	.nav-mobile .main-nav .nav-item a,
	.navi-login-register .main-nav .nav-item a {
		background: rgba(255, 255, 255, 0.03);
		color: rgba(255, 255, 255, 0.93);
		border-bottom-color: rgba(255, 255, 255, 0.15);
		padding: 14px 16px;
	}

	.nav-mobile .main-nav .nav-item .dropdown-menu .nav-item a {
		background: rgba(255, 255, 255, 0.04);
		padding-left: 24px;
	}

	.nav-mobile .main-nav .nav-item .dropdown-menu .dropdown-menu .nav-item a {
		padding-left: 32px;
	}

	.nav-mobile .main-nav .nav-item .nav-mobile-trigger {
		color: rgba(255, 255, 255, 0.92);
	}

	.nav-mobile .main-nav .nav-item .dropdown-menu {
		background: rgba(0, 17, 33, 0.45);
	}

	.nav-mobile .main-nav .current-menu-item > a,
	.nav-mobile .main-nav .current-menu-ancestor > a {
		background: rgba(255, 255, 255, 0.14);
		color: #ffffff;
	}

	.nav-mobile .main-nav .nav-item a:hover,
	.nav-mobile .main-nav .nav-item a:focus,
	.navi-login-register .main-nav .nav-item a:hover,
	.navi-login-register .main-nav .nav-item a:focus {
		background: rgba(255, 255, 255, 0.12);
		color: #ffffff;
	}

	.nav-mobile .main-nav .nav-item a:focus-visible,
	.navi-login-register .main-nav .nav-item a:focus-visible {
		outline: 2px solid rgba(255, 255, 255, 0.44);
		outline-offset: -2px;
	}

	.nav-mobile .logged-in-nav a {
		background: rgba(255, 255, 255, 0.03);
		color: rgba(255, 255, 255, 0.93);
		border-bottom-color: rgba(255, 255, 255, 0.15);
		padding: 14px 16px;
	}

	.nav-mobile .logged-in-nav a:hover,
	.nav-mobile .logged-in-nav a:focus {
		background: rgba(255, 255, 255, 0.12);
		color: #ffffff;
	}

	.nav-mobile .btn-create-listing,
	.navi-login-register .btn-create-listing {
		border-color: #c6a756;
		background-color: #c6a756;
		color: #001d39;
	}

	.nav-mobile .btn-create-listing:hover,
	.nav-mobile .btn-create-listing:focus,
	.navi-login-register .btn-create-listing:hover,
	.navi-login-register .btn-create-listing:focus {
		border-color: #e0bf5e;
		background-color: #e0bf5e;
		color: #001d39;
	}
}
