/**
 * Lux Nav — off-canvas drill-down menu + mobile bottom navigation.
 *
 * Colours and sizes arrive as CSS custom properties printed inline by PHP.
 * `--lux-nav-x` flips every horizontal transform for RTL so one rule set
 * serves both directions.
 */

/* ------------------------------------------------------------ scroll lock */

html.lux-nav-locked,
html.lux-nav-locked body {
	overflow: hidden;
}

html.lux-nav-locked body {
	position: fixed;
	width: 100%;
}

/* ------------------------------------------------------------------ drawer */

.lux-nav-drawer {
	--lux-nav-width: 340px;
	--lux-nav-bg: #fff;
	--lux-nav-text: #1f1f1f;
	--lux-nav-muted: #8a8a8a;
	--lux-nav-accent: #4a1620;
	--lux-nav-border: #efefef;
	--lux-nav-head-bg: #fff;
	--lux-nav-overlay: rgba(0, 0, 0, 0.45);
	--lux-nav-duration: 320ms;
	--lux-nav-item-height: 56px;
	--lux-nav-radius: 0px;
	--lux-nav-x: 1;
	--lux-nav-ease: cubic-bezier(0.32, 0.72, 0, 1);

	position: fixed;
	inset: 0;
	z-index: 999990;
}

[dir='rtl'] .lux-nav-drawer,
.rtl .lux-nav-drawer {
	--lux-nav-x: -1;
}

.lux-nav-drawer[hidden] {
	display: none;
}

.lux-nav-drawer__overlay {
	position: absolute;
	inset: 0;
	background: var(--lux-nav-overlay);
	opacity: 0;
	transition: opacity var(--lux-nav-duration) var(--lux-nav-ease);
	-webkit-tap-highlight-color: transparent;
}

.lux-nav-drawer.is-open .lux-nav-drawer__overlay {
	opacity: 1;
}

.lux-nav-drawer__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(var(--lux-nav-width), 88vw);
	max-width: 100%;
	overflow: hidden;
	color: var(--lux-nav-text);
	background: var(--lux-nav-bg);
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.18);
	transition: transform var(--lux-nav-duration) var(--lux-nav-ease);
	will-change: transform;
}

.lux-nav-drawer--start .lux-nav-drawer__panel {
	inset-inline-start: 0;
	border-start-end-radius: var(--lux-nav-radius);
	border-end-end-radius: var(--lux-nav-radius);
	transform: translateX(calc(-100% * var(--lux-nav-x)));
}

.lux-nav-drawer--end .lux-nav-drawer__panel {
	inset-inline-end: 0;
	border-start-start-radius: var(--lux-nav-radius);
	border-end-start-radius: var(--lux-nav-radius);
	transform: translateX(calc(100% * var(--lux-nav-x)));
}

.lux-nav-drawer.is-open .lux-nav-drawer__panel {
	transform: translateX(0);
}

/* -------------------------------------------------------------------- head */

.lux-nav-drawer__head {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 6px;
	min-height: 60px;
	padding: 10px 12px;
	background: var(--lux-nav-head-bg);
	border-bottom: 1px solid var(--lux-nav-border);
}

/*
 * These are plain icon controls, not buttons — no box, no fill, in any state.
 *
 * Each rule is scoped with the container class so it scores two classes, which
 * outranks both a theme reset (`button:hover`) and an Elementor kit rule
 * (`.elementor-kit-N button`). Without that, a themed `button` background
 * paints a coloured block behind the icon. Nothing here needs !important.
 */
.lux-nav-drawer .lux-nav-drawer__back,
.lux-nav-drawer .lux-nav-drawer__close {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	font: inherit;
	color: var(--lux-nav-text);
	background: transparent;
	background-image: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: color 0.18s ease, opacity 0.18s ease;
}

.lux-nav-drawer .lux-nav-drawer__back:hover,
.lux-nav-drawer .lux-nav-drawer__back:focus,
.lux-nav-drawer .lux-nav-drawer__back:active,
.lux-nav-drawer .lux-nav-drawer__close:hover,
.lux-nav-drawer .lux-nav-drawer__close:focus,
.lux-nav-drawer .lux-nav-drawer__close:active {
	color: var(--lux-nav-accent);
	background: transparent;
	background-image: none;
	border-color: transparent;
	box-shadow: none;
}

.lux-nav-drawer .lux-nav-drawer__back:focus-visible,
.lux-nav-drawer .lux-nav-drawer__close:focus-visible {
	outline: 2px solid var(--lux-nav-accent);
	outline-offset: 2px;
}

.lux-nav-drawer .lux-nav-drawer__back[hidden] {
	display: none;
}

/* Points "back", i.e. against the reading direction. */
.lux-nav-drawer__back-icon {
	display: inline-flex;
	transform: scaleX(calc(-1 * var(--lux-nav-x)));
}

.lux-nav-drawer__close {
	margin-inline-start: auto;
}

.lux-nav-drawer .lux-nav-drawer__title {
	flex: 1 1 auto;
	margin: 0;
	padding: 0;
	overflow: hidden;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.4;
	color: var(--lux-nav-text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lux-nav-drawer__title.is-swapping {
	animation: lux-nav-title var(--lux-nav-duration) var(--lux-nav-ease);
}

@keyframes lux-nav-title {
	from {
		opacity: 0;
		transform: translateY(6px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* ------------------------------------------------------------------ panels */

.lux-nav-drawer__body {
	position: relative;
	flex: 1 1 auto;
	overflow: hidden;
}

.lux-nav-panel {
	position: absolute;
	inset: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	visibility: hidden;
	transform: translateX(calc(100% * var(--lux-nav-x)));
	-webkit-overflow-scrolling: touch;
	transition:
		transform var(--lux-nav-duration) var(--lux-nav-ease),
		visibility 0s linear var(--lux-nav-duration);
}

.lux-nav-panel.is-active,
.lux-nav-panel.is-prev {
	visibility: visible;
	transition:
		transform var(--lux-nav-duration) var(--lux-nav-ease),
		visibility 0s;
}

.lux-nav-panel.is-active {
	transform: translateX(0);
}

.lux-nav-panel.is-prev {
	transform: translateX(calc(-100% * var(--lux-nav-x)));
}

/* ------------------------------------------------------------------- items */

.lux-nav-list {
	margin: 0;
	padding: 6px 0 32px;
	list-style: none;
}

.lux-nav-item {
	display: flex;
	align-items: stretch;
	margin: 0;
	border-bottom: 1px solid var(--lux-nav-border);
}

.lux-nav-item:last-child {
	border-bottom: 0;
}

.lux-nav-drawer .lux-nav-item__link {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	min-height: var(--lux-nav-item-height);
	padding: 8px 20px;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--lux-nav-text);
	text-decoration: none;
	background: transparent;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.lux-nav-drawer .lux-nav-item__link:hover,
.lux-nav-drawer .lux-nav-item__link:focus {
	color: var(--lux-nav-accent);
	background: var(--lux-nav-accent-soft);
	text-decoration: none;
}

.lux-nav-drawer .lux-nav-item__link:focus-visible {
	outline: 2px solid var(--lux-nav-accent);
	outline-offset: -2px;
}

.lux-nav-drawer .lux-nav-item.is-current > .lux-nav-item__link {
	font-weight: 700;
	color: var(--lux-nav-accent);
}

.lux-nav-item__text {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lux-nav-drawer .lux-nav-item--all .lux-nav-item__link {
	min-height: 46px;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--lux-nav-accent);
	background: var(--lux-nav-accent-soft);
}

/* The arrow is a separate hit target: text navigates, arrow drills in. */
/* The arrow is its own hit target but reads as part of the row: no fill. */
.lux-nav-drawer .lux-nav-item__toggle {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 56px;
	padding: 0;
	font: inherit;
	color: var(--lux-nav-muted);
	background: transparent;
	background-image: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: color 0.18s ease;
}

.lux-nav-drawer .lux-nav-item__toggle:hover,
.lux-nav-drawer .lux-nav-item__toggle:focus,
.lux-nav-drawer .lux-nav-item__toggle:active {
	color: var(--lux-nav-accent);
	background: transparent;
	background-image: none;
	border-color: transparent;
	box-shadow: none;
}

.lux-nav-drawer .lux-nav-item__toggle:focus-visible {
	outline: 2px solid var(--lux-nav-accent);
	outline-offset: -2px;
}

/* Points "forward", i.e. along the reading direction. */
.lux-nav-item__chevron {
	display: inline-flex;
	transform: scaleX(var(--lux-nav-x));
	transition: transform 0.18s ease;
}

.lux-nav-item__toggle:hover .lux-nav-item__chevron {
	transform: scaleX(var(--lux-nav-x)) translateX(2px);
}

/* --------------------------------------------------------- bottom navigation */

/*
 * Declared on :root rather than .lux-bn because `body` also needs the height
 * to reserve space for the bar.
 */
:root {
	--lux-bn-bg: #fff;
	--lux-bn-color: #6b6b6b;
	--lux-bn-active: #4a1620;
	--lux-bn-border: #ececec;
	--lux-bn-height: 64px;
	--lux-bn-icon: 24px;
	--lux-bn-radius: 0px;
	--lux-bn-badge-bg: #4a1620;
	--lux-bn-badge-text: #fff;
}

.lux-bn {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 999980;
	background: var(--lux-bn-bg);
	border-top: 1px solid var(--lux-bn-border);
	border-radius: var(--lux-bn-radius) var(--lux-bn-radius) 0 0;
	box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.06);
	padding-bottom: env(safe-area-inset-bottom, 0px);
	transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.lux-bn--float {
	inset-inline: 12px;
	bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	border: 1px solid var(--lux-bn-border);
	border-radius: var(--lux-bn-radius);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
	padding-bottom: 0;
}

.lux-bn.is-hidden {
	transform: translateY(calc(100% + 24px));
}

.lux-bn__list {
	display: grid;
	grid-template-columns: repeat(var(--lux-bn-count, 4), 1fr);
	margin: 0;
	padding: 0;
	list-style: none;
}

.lux-bn__item {
	margin: 0;
	min-width: 0;
}

/*
 * Tabs are flat: only the colour changes between states. Scoped with `.lux-bn`
 * so a themed `button` background cannot draw a block behind a tab that happens
 * to be a <button> (the "open the menu" action) while its <a> siblings stay
 * clean.
 */
.lux-bn .lux-bn__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 100%;
	height: var(--lux-bn-height);
	padding: 6px 4px;
	font: inherit;
	font-size: 0.75rem;
	line-height: 1.3;
	color: var(--lux-bn-color);
	text-align: center;
	text-decoration: none;
	background: transparent;
	background-image: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	-webkit-tap-highlight-color: transparent;
	transition: color 0.18s ease;
}

.lux-bn .lux-bn__link:hover,
.lux-bn .lux-bn__link:focus,
.lux-bn .lux-bn__link:active {
	color: var(--lux-bn-active);
	text-decoration: none;
	background: transparent;
	background-image: none;
	border-color: transparent;
	box-shadow: none;
}

.lux-bn .lux-bn__link:focus-visible {
	outline: 2px solid var(--lux-bn-active);
	outline-offset: -3px;
	border-radius: 10px;
}

.lux-bn .lux-bn__item.is-current .lux-bn__link {
	color: var(--lux-bn-active);
	font-weight: 700;
}

.lux-bn__icon {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--lux-bn-icon);
	height: var(--lux-bn-icon);
}

.lux-bn__icon .lux-icon {
	width: 100%;
	height: 100%;
	display: block;
}

.lux-bn__icon .lux-icon--image {
	object-fit: contain;
}

.lux-bn__label {
	display: block;
	width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lux-bn--no-labels .lux-bn__link {
	gap: 0;
}

.lux-bn__badge {
	position: absolute;
	top: -6px;
	inset-inline-end: -8px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	color: var(--lux-bn-badge-text);
	text-align: center;
	background: var(--lux-bn-badge-bg);
	border-radius: 9px;
}

.lux-bn__badge.is-empty {
	display: none;
}

body.lux-bn-active {
	padding-bottom: calc(var(--lux-bn-height, 64px) + env(safe-area-inset-bottom, 0px));
}

/* --------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
	.lux-nav-drawer__panel,
	.lux-nav-drawer__overlay,
	.lux-nav-panel,
	.lux-bn {
		transition-duration: 1ms !important;
	}

	.lux-nav-drawer__title.is-swapping {
		animation: none;
	}
}
