/**
 * WPRaffle Theme v1.3.5 — shared header/mobile fixes
 *
 * Applies across all presets. Fixes:
 * 1. Search + notification glyphs inheriting muted/grey button/icon styling.
 * 2. Mobile menu being constrained to the header's containing block when a
 *    preset uses backdrop-filter on .wpr-header.
 */

/* Header action controls must remain real icon buttons even where a preset has
 * broad generic `button` rules. Keep glyphs tied to the header foreground. */
.wpr-header .wpr-header__actions .wpr-icon-btn,
.wpr-header .wpr-header__actions button.wpr-icon-btn,
.wpr-header .wpr-header__actions .wpr-search-toggle,
.wpr-header .wpr-header__actions .wprt-notification-bell > .wpr-icon-btn {
	min-width: 44px !important;
	width: 44px !important;
	min-height: 44px !important;
	height: 44px !important;
	padding: 0 !important;
	margin: 0 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	box-shadow: none !important;
	color: inherit !important;
	opacity: 1 !important;
	filter: none !important;
	-webkit-filter: none !important;
	transform: none;
	line-height: 1 !important;
	text-decoration: none !important;
	appearance: none;
	-webkit-appearance: none;
}

/* The Font Awesome elements themselves can otherwise retain a muted rule from
 * a vendor/theme layer. Explicit currentColor makes the active preset own it. */
.wpr-header .wpr-header__actions .wpr-icon-btn > i,
.wpr-header .wpr-header__actions .wpr-search-toggle > i,
.wpr-header .wpr-header__actions .wprt-notification-bell > .wpr-icon-btn > i {
	color: currentColor !important;
	opacity: 1 !important;
	filter: none !important;
	-webkit-filter: none !important;
}

/* Preset-aware foregrounds. */
.wpr-preset-default .wpr-header .wpr-header__actions .wpr-icon-btn,
.wpr-preset-golf .wpr-header .wpr-header__actions .wpr-icon-btn,
.wpr-preset-car .wpr-header .wpr-header__actions .wpr-icon-btn,
.wpr-preset-retro .wpr-header .wpr-header__actions .wpr-icon-btn,
.wpr-preset-diamond .wpr-header .wpr-header__actions .wpr-icon-btn {
	color: #fff !important;
}

.wpr-preset-default .wpr-header .wpr-header__actions .wpr-icon-btn:hover,
.wpr-preset-default .wpr-header .wpr-header__actions .wpr-icon-btn:focus-visible {
	background: rgba(255,255,255,.07) !important;
	color: #ffdc25 !important;
}

.wpr-preset-golf .wpr-header .wpr-header__actions .wpr-icon-btn:hover,
.wpr-preset-golf .wpr-header .wpr-header__actions .wpr-icon-btn:focus-visible {
	background: rgba(255,255,255,.08) !important;
	color: var(--wpr-golf-lime, #d8f35a) !important;
}

.wpr-preset-car .wpr-header .wpr-header__actions .wpr-icon-btn:hover,
.wpr-preset-car .wpr-header .wpr-header__actions .wpr-icon-btn:focus-visible {
	background: rgba(255,255,255,.08) !important;
	color: var(--wpr-car-orange, #f05a24) !important;
}

.wpr-preset-retro .wpr-header .wpr-header__actions .wpr-icon-btn:hover,
.wpr-preset-retro .wpr-header .wpr-header__actions .wpr-icon-btn:focus-visible {
	background: rgba(255,255,255,.07) !important;
	color: var(--wpr-retro-cyan, #20d9ff) !important;
}

.wpr-preset-diamond .wpr-header .wpr-header__actions .wpr-icon-btn:hover,
.wpr-preset-diamond .wpr-header .wpr-header__actions .wpr-icon-btn:focus-visible {
	background: rgba(216,184,74,.10) !important;
	color: var(--wpr-dia-champagne, #f5e7ad) !important;
}

/* Keep account text link flexible; only true circular icon buttons get width. */
.wpr-header .wpr-header__actions .wpr-account.wpr-icon-btn {
	width: auto !important;
	padding-inline: .85rem !important;
}

/* Notification count remains positioned against its wrapper/button. */
.wpr-header .wprt-notification-bell {
	position: relative;
	flex: 0 0 auto;
}

/* ================================================================
 * MOBILE NAV — FORCE VIEWPORT-SIZED DRAWER
 *
 * backdrop-filter on a header can make it a containing block for fixed
 * descendants in modern browsers. The nav therefore needs an explicit viewport
 * block size instead of relying solely on inset:0.
 * ================================================================ */
@media (max-width: 991.98px) {
	.wpr-header .wpr-nav.is-open {
		display: block !important;
		position: fixed !important;
		top: 0 !important;
		right: 0 !important;
		bottom: auto !important;
		left: 0 !important;
		width: 100vw !important;
		max-width: none !important;
		height: 100vh !important;
		height: 100dvh !important;
		min-height: 100vh !important;
		min-height: 100dvh !important;
		max-height: 100vh !important;
		max-height: 100dvh !important;
		margin: 0 !important;
		padding:
			calc(var(--wpr-header-h, 72px) + env(safe-area-inset-top) + 1rem)
			max(1.25rem, env(safe-area-inset-right))
			calc(2rem + env(safe-area-inset-bottom))
			max(1.25rem, env(safe-area-inset-left)) !important;
		overflow-x: hidden !important;
		overflow-y: auto !important;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
		z-index: 2147483000 !important;
		box-sizing: border-box !important;
	}

	.wpr-header .wpr-nav.is-open > ul,
	.wpr-header .wpr-nav.is-open .wpr-primary-menu {
		display: flex !important;
		flex-direction: column !important;
		align-items: stretch !important;
		width: 100% !important;
		max-height: none !important;
		height: auto !important;
		overflow: visible !important;
		margin: 0 !important;
	}

	.wpr-header .wpr-nav.is-open li {
		display: block !important;
		width: 100% !important;
		height: auto !important;
		min-height: 0 !important;
		max-height: none !important;
	}

	.wpr-header .wpr-nav.is-open a {
		display: flex !important;
		width: 100% !important;
		min-height: 52px !important;
		height: auto !important;
		padding: .9rem 0 !important;
		align-items: center !important;
		white-space: normal !important;
	}

	/* Dropdowns stay in document flow so long menus can scroll naturally. */
	.wpr-header .wpr-nav.is-open .sub-menu {
		display: flex !important;
		position: static !important;
		width: 100% !important;
		min-width: 0 !important;
		max-width: none !important;
		height: auto !important;
		max-height: none !important;
		overflow: visible !important;
		opacity: 1 !important;
		visibility: visible !important;
		transform: none !important;
	}

	/* Keep the menu toggle above the viewport menu so it can close it. */
	.wpr-header .wpr-menu-toggle {
		position: relative;
		z-index: 2147483001 !important;
	}

	/* Header logo/actions must not create a clipping context over the drawer. */
	.wpr-header,
	.wpr-header__inner,
	.wpr-header .container {
		overflow: visible !important;
	}
}

/* Keep the mobile drawer visually aligned with each dark refreshed preset. */
@media (max-width: 991.98px) {
	.wpr-preset-default .wpr-header .wpr-nav.is-open {
		background: #0b0b0d !important;
		color: #f5f4ef !important;
	}
	.wpr-preset-golf .wpr-header .wpr-nav.is-open {
		background: var(--wpr-golf-ink, #10271c) !important;
		color: #fff !important;
	}
	.wpr-preset-car .wpr-header .wpr-nav.is-open {
		background: var(--wpr-car-ink, #111214) !important;
		color: #fff !important;
	}
	.wpr-preset-retro .wpr-header .wpr-nav.is-open {
		background: var(--wpr-retro-black, #0b0812) !important;
		color: #fff !important;
	}
	.wpr-preset-diamond .wpr-header .wpr-nav.is-open {
		background: #171719 !important;
		color: #fff !important;
	}

	.wpr-preset-default .wpr-header .wpr-nav.is-open a,
	.wpr-preset-golf .wpr-header .wpr-nav.is-open a,
	.wpr-preset-car .wpr-header .wpr-nav.is-open a,
	.wpr-preset-retro .wpr-header .wpr-nav.is-open a,
	.wpr-preset-diamond .wpr-header .wpr-nav.is-open a {
		color: #fff !important;
		border-bottom-color: rgba(255,255,255,.10) !important;
	}

	.wpr-preset-default .wpr-header .wpr-nav.is-open .sub-menu,
	.wpr-preset-golf .wpr-header .wpr-nav.is-open .sub-menu,
	.wpr-preset-car .wpr-header .wpr-nav.is-open .sub-menu,
	.wpr-preset-retro .wpr-header .wpr-nav.is-open .sub-menu,
	.wpr-preset-diamond .wpr-header .wpr-nav.is-open .sub-menu {
		background: transparent !important;
		border: 0 !important;
		box-shadow: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wpr-header .wpr-header__actions .wpr-icon-btn,
	.wpr-header .wpr-nav.is-open {
		transition: none !important;
	}
}
