/**
 * TechRoyal Mobile UI — Version 1.4
 * Mobile-only navigation bar, now docked to the TOP of the layout
 * (directly below the site's announcement banner) instead of
 * floating at the bottom.
 * Order (fixed): Menu → Logo → Search → Cart → Dark Mode.
 * Desktop is completely untouched — this bar is hidden above 768px.
 *
 * UPDATE 1.4: moved from a floating bottom pill to a full-width
 * fixed top bar, with an auto-hide-on-scroll show/hide animation.
 * If your theme also has a fixed/sticky announcement bar above this
 * one, set --trsc-mnav-top-offset (in px) to that bar's height so
 * this nav docks directly beneath it instead of overlapping it.
 */

:root {
	--trsc-mnav-top-offset: 0px;
	--trsc-mnav-height: 64px;
}

.trsc-mnav {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	top: var(--trsc-mnav-top-offset);
	z-index: 999999;
	height: var(--trsc-mnav-height);
	width: 100%;
	padding: 0 16px;
	align-items: center;
	background: #000000;
	border: none;
	border-bottom: 1px solid rgba(212, 175, 55, 0.35);
	border-radius: 0;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
	direction: rtl;
	box-sizing: border-box;
	transform: translateY(0);
	opacity: 1;
	transition: transform 280ms ease, opacity 280ms ease;
	will-change: transform, opacity;
}

/* Auto-hide state, toggled by JS while scrolling down */
.trsc-mnav.trsc-mnav-hidden {
	transform: translateY(-100%);
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 768px) {
	.trsc-mnav {
		display: flex;
	}

	/* V3: WordPress admin bar is 46px tall at this width when the
	   user is logged in — drop the bar below it instead of covering
	   it. Reuses the existing top-offset variable; nothing else about
	   the mobile bar's design changes. */
	body.admin-bar {
		--trsc-mnav-top-offset: 46px;
	}

	/* leave room at the top of the page so the hero banner never hides behind the bar */
	body.trsc-mnav-active {
		padding-top: calc(var(--trsc-mnav-height) + var(--trsc-mnav-top-offset));
	}
}

.trsc-mnav * {
	box-sizing: border-box;
}

/* v1.10.1: kill the default blue/grey tap-highlight flash that mobile
   browsers (Chrome/WebView in particular) draw over links and buttons
   on touch. This affects the whole bar plus the off-canvas category
   menu it opens, since every item in there is a plain <a>/<button>. */
.trsc-mnav,
.trsc-mnav *,
.trsc-mnav-panel-overlay,
.trsc-mnav-panel-overlay * {
	-webkit-tap-highlight-color: transparent;
	tap-highlight-color: transparent;
}

.trsc-mnav a,
.trsc-mnav button,
.trsc-mnav-panel a,
.trsc-mnav-panel button {
	-webkit-tap-highlight-color: transparent;
	outline: none;
}

.trsc-mnav-panel a:active,
.trsc-mnav-panel a:focus,
.trsc-mnav-panel button:active,
.trsc-mnav-panel button:focus {
	background: transparent;
	outline: none;
}

.trsc-mnav-menu {
	background: none;
	border: none;
	padding: 0;
	margin-inline-end: 12px;
	color: #d4af37;
	font-size: 22px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex: 0 0 auto;
}

.trsc-mnav-logo {
	margin-inline-end: 28px;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #000000;
	border: 2px solid #d4af37;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.trsc-mnav-logo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.trsc-mnav-logo-fallback {
	color: #d4af37;
	font-weight: 700;
	font-size: 15px;
}

.trsc-mnav-search {
	margin-inline-end: 20px;
	flex: 1 1 auto;
	min-width: 0;
	height: 42px;
	display: flex;
	align-items: center;
	background: #1b1b1b;
	border: 1px solid rgba(212, 175, 55, 0.35);
	border-radius: 999px;
	padding: 0 14px;
	overflow: hidden;
}

.trsc-mnav-search svg,
.trsc-mnav-search .trsc-mnav-search-icon {
	color: #d4af37;
	flex: 0 0 auto;
	margin-inline-end: 8px;
	font-size: 15px;
	line-height: 1;
}

.trsc-mnav-search input {
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	border: none;
	outline: none;
	box-shadow: none;
	color: #f2f2f2;
	/* 16px is the mobile-browser threshold: anything smaller triggers
	   the native "zoom into input" behavior (Telegram/Chrome in-app
	   webviews), which renders a floating duplicate box on focus. */
	font-size: 16px;
	line-height: 1.2;
	width: 100%;
	min-width: 0;
	padding: 0;
	margin: 0;
	border-radius: 0;
}

.trsc-mnav-search input::placeholder {
	color: #9a9a9a;
	font-size: 13px;
}

.trsc-mnav-cart {
	margin-inline-end: 18px;
	flex: 0 0 auto;
	position: relative;
	color: #d4af37;
	font-size: 21px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

.trsc-mnav-cart-count {
	position: absolute;
	top: -6px;
	inset-inline-end: -8px;
	background: #d4af37;
	color: #000;
	font-size: 10px;
	font-weight: 700;
	min-width: 16px;
	height: 16px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 3px;
}

.trsc-mnav-cart-count[data-count="0"] {
	display: none;
}

.trsc-mnav-dark {
	background: none !important;
	background-color: transparent !important;
	border: none !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	padding: 0 !important;
	margin-inline-end: 0;
	flex: 0 0 auto;
	width: auto;
	height: auto;
	color: #d4af37;
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.trsc-mnav-dark svg {
	display: block;
	background: none !important;
}

/* Off-canvas menu panel */
.trsc-mnav-panel-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 999998;
}

.trsc-mnav-panel-overlay.trsc-mnav-open {
	display: block;
}

.trsc-mnav-panel {
	position: fixed;
	top: 0;
	right: 0;
	height: 100%;
	width: 78%;
	max-width: 300px;
	background: #0d0d0d;
	border-left: 1px solid rgba(212, 175, 55, 0.35);
	z-index: 999999;
	transform: translateX(100%);
	transition: transform 0.25s ease;
	padding: 24px 18px;
	overflow-y: auto;
	direction: rtl;
}

.trsc-mnav-panel-overlay.trsc-mnav-open .trsc-mnav-panel {
	transform: translateX(0);
}

.trsc-mnav-panel a {
	display: block;
	color: #f2f2f2;
	text-decoration: none;
	font-size: 15px;
	padding: 12px 4px;
	border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}

.trsc-mnav-panel a:hover {
	color: #d4af37;
}

.trsc-mnav-panel-close {
	background: none;
	border: none;
	color: #d4af37;
	font-size: 20px;
	margin-bottom: 18px;
	cursor: pointer;
}

/* v1.10: the crude site-wide "body.trsc-dark-active { !important }"
   override that used to live here has been removed. The dark-mode
   buttons above no longer run their own independent state — they now
   proxy the real "WP Dark Mode" plugin switch directly (see
   mobile-navbar.js / desktop-header.js), so the plugin's own, far more
   complete theming handles the whole site correctly on its own. */

/* The real WP Dark Mode floating switch is visually hidden site-wide
   since the header/nav bar buttons above are now its on-screen
   stand-in (positioned next to the cart, per site design) and proxy
   clicks straight to it. It is only hidden with `display:none` — never
   removed from the DOM or disabled in the plugin's own settings — so
   it stays fully functional and clickable via JS, and OS-aware
   auto-switching keeps working exactly as the plugin intends. */
.wp-dark-mode-floating-switch {
	display: none !important;
}
