/**
 * Mobile navigation — scoped to max-width breakpoints only.
 * Desktop header/nav (992px+) is unchanged (style.css + resp.css).
 *
 * Breakpoints: 991 | 768 | 576 | 480
 *
 * @package dreamtime
 */

#nav-overlay,
#nav .submenu-toggle {
	display: none;
}

/* ================================================================== 991px — mobile nav activation */
@media (max-width: 991px) {
	#header {
		height: 72px;
	}

	#header_bc {
		height: 72px;
	}

	#header .container {
		display: flex;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: space-between;
		height: 100%;
		position: relative;
	}

	#logo {
		float: none;
		flex: 0 1 auto;
		min-width: 0;
		z-index: 1001;
	}

	#logo img {
		height: 56px;
		width: auto;
		margin: 0;
		display: block;
	}

	#mob-nav {
		display: flex;
		align-items: center;
		justify-content: center;
		position: relative;
		right: auto;
		top: auto;
		flex: 0 0 auto;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		float: none;
		background: transparent;
		border: 2px solid #222;
		border-radius: 4px;
		color: #222;
		font-size: 20px;
		line-height: 1;
		z-index: 1001;
		-webkit-appearance: none;
		appearance: none;
		-webkit-tap-highlight-color: transparent;
		box-shadow: none;
		transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
	}

	#mob-nav:hover {
		background: #f7f8fa;
	}

	#mob-nav:active {
		background: #eef0f3;
	}

	#mob-nav:focus {
		outline: none;
	}

	#mob-nav:focus-visible {
		outline: 2px solid #222;
		outline-offset: 2px;
	}

	#mob-nav i {
		line-height: 1;
	}

	#mob-nav.is-active {
		background: #222;
		border-color: #222;
		color: #fff;
	}

	#nav-overlay {
		display: block;
		position: fixed;
		left: 0;
		right: 0;
		top: 72px;
		bottom: 0;
		background: rgba(0, 0, 0, 0.45);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s ease, visibility 0.3s ease;
		z-index: 997;
		pointer-events: none;
	}

	#nav-overlay.is-visible {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}

	#nav {
		display: block;
		float: none;
		flex: none;
		position: fixed;
		left: 0;
		right: 0;
		top: 72px;
		width: 100%;
		max-height: calc(100dvh - 72px);
		margin: 0;
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		background: #fff;
		box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
		transform: translateY(-8px);
		opacity: 0;
		visibility: hidden;
		transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
		z-index: 998;
	}

	#nav.is-open {
		transform: translateY(0);
		opacity: 1;
		visibility: visible;
	}

	#nav > ul,
	#nav ul.menu {
		float: none;
		display: block;
		width: 100%;
		margin: 0;
		padding: 6px 0 12px;
	}

	#nav a,
	#nav button {
		-webkit-tap-highlight-color: transparent;
	}

	#nav ul li {
		float: none;
		display: block;
		width: 100%;
		margin: 0;
		position: relative;
		border-bottom: 1px solid #eee;
	}

	#nav ul li:last-child {
		border-bottom: none;
	}

	#nav ul li a {
		float: none;
		display: block;
		width: auto;
		padding: 14px 56px 14px 20px;
		font-size: 15px;
		font-weight: 400;
		color: #333;
		text-align: left;
		letter-spacing: 0.02em;
		line-height: 1.45;
		border-bottom: none;
		border-radius: 0;
		box-shadow: none;
		outline: none;
		transition: background-color 0.2s ease, color 0.2s ease;
	}

	#nav ul li a:hover {
		color: #222;
		background-color: #f7f8fa;
		text-decoration: none;
	}

	#nav ul li a:active {
		background-color: #eef0f3;
	}

	#nav ul li a:focus {
		outline: none;
		box-shadow: none;
	}

	#nav ul li a:focus:not(:focus-visible) {
		background-color: transparent;
	}

	#nav ul li a:focus-visible {
		outline: 2px solid #555;
		outline-offset: -2px;
		background-color: #f7f8fa;
		text-decoration: none;
	}

	#nav .menu-item-has-children.is-open > a {
		background-color: #f7f8fa;
		color: #222;
	}

	#nav .menu-item-has-children.is-open > a:focus:not(:focus-visible) {
		background-color: #f7f8fa;
	}

	#nav .menu-item-has-children > a {
		padding-right: 56px;
	}

	#nav .submenu-toggle {
		position: absolute;
		top: 0;
		right: 0;
		width: 48px;
		height: 100%;
		min-height: 48px;
		display: flex;
		align-items: center;
		justify-content: center;
		float: none;
		margin: 0;
		padding: 0;
		background: transparent;
		background-color: transparent;
		border: none;
		border-left: 1px solid #eee;
		border-radius: 0;
		color: #555;
		font-size: 13px;
		font-weight: 400;
		line-height: 1;
		cursor: pointer;
		-webkit-appearance: none;
		appearance: none;
		-webkit-tap-highlight-color: transparent;
		box-shadow: none;
		outline: none;
		user-select: none;
		touch-action: manipulation;
		transition: background-color 0.2s ease, color 0.2s ease;
	}

	#nav .submenu-toggle i {
		display: block;
		line-height: 1;
		pointer-events: none;
		transition: transform 0.25s ease;
	}

	#nav .submenu-toggle:hover {
		background-color: #f7f8fa;
		color: #222;
	}

	#nav .submenu-toggle:active {
		background-color: #eef0f3;
		color: #222;
	}

	#nav .submenu-toggle:focus {
		outline: none;
		box-shadow: none;
	}

	#nav .submenu-toggle:focus:not(:focus-visible) {
		background-color: transparent;
		color: #555;
	}

	#nav .submenu-toggle:focus-visible {
		outline: 2px solid #555;
		outline-offset: -2px;
		background-color: #f7f8fa;
		color: #222;
	}

	#nav .menu-item-has-children.is-open > .submenu-toggle {
		background-color: #f0f1f3;
		color: #222;
	}

	#nav .menu-item-has-children.is-open > .submenu-toggle:focus:not(:focus-visible) {
		background-color: #f0f1f3;
		color: #222;
	}

	#nav .menu-item-has-children.is-open > .submenu-toggle i {
		transform: rotate(180deg);
	}

	#nav ul ul,
	#nav .sub-menu {
		position: static;
		display: block;
		width: 100%;
		height: auto;
		max-height: 0;
		left: auto;
		top: auto;
		margin: 0;
		padding: 0;
		overflow: hidden;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border-radius: 0;
		background: #f7f8fa;
		transition: max-height 0.32s ease;
	}

	#nav .menu-item-has-children.is-open > ul.sub-menu,
	#nav .menu-item-has-children.is-open > ul {
		max-height: 480px;
	}

	#nav ul ul li {
		width: 100%;
		margin: 0;
		border-bottom: 1px solid #ececec;
	}

	#nav ul ul li:last-child {
		border-bottom: none;
	}

	#nav ul ul li a {
		padding: 12px 20px 12px 32px;
		font-size: 14px;
		color: #555;
	}

	#nav ul ul li a:hover {
		background: #eef0f3;
		color: #222;
	}

	#nav ul ul li a:focus-visible {
		outline: 2px solid #555;
		outline-offset: -2px;
		background: #eef0f3;
		color: #222;
	}

	#nav ul li:hover > ul {
		opacity: 1;
		visibility: visible;
		transform: none;
		max-height: 0;
	}

	#nav .menu-item-has-children.is-open:hover > ul {
		max-height: 480px;
	}

	body.nav-menu-open {
		overflow: hidden;
	}
}

/* ================================================================== 768px */
@media (max-width: 768px) {
	#nav ul li a {
		padding-top: 13px;
		padding-bottom: 13px;
		font-size: 14px;
	}

	#nav ul ul li a {
		padding-left: 28px;
		font-size: 13px;
	}
}

/* ================================================================== 576px */
@media (max-width: 576px) {
	#header .container {
		width: 94%;
	}

	#nav ul li a {
		padding-left: 16px;
		padding-right: 52px;
	}

	#nav ul ul li a {
		padding-left: 24px;
	}
}

/* ================================================================== 480px */
@media (max-width: 480px) {
	#header,
	#header_bc {
		height: 64px;
	}

	#logo img {
		height: 48px;
	}

	#mob-nav {
		width: 40px;
		height: 40px;
		font-size: 18px;
	}

	#nav,
	#nav-overlay {
		top: 64px;
	}

	#nav {
		max-height: calc(100dvh - 64px);
	}

	#nav .submenu-toggle {
		width: 44px;
		min-height: 44px;
	}
}
