/* Header: the Light Luxury Floating Bar (design lab D5), the menu sheet, and the search dialog.
   Navigation motion is quick and subtle (0.18-0.26 s, opacity and small transforms) and never delays a link. */

/* ---------- Floating bar ---------- */
.rx-fb {
	position: fixed; inset: 0 0 auto; z-index: 40;
	padding: var(--rx-fb-inset) var(--rx-gutter) 0;
	color: var(--rx-lux-ink); font-family: var(--rx-font-modern);
	pointer-events: none; /* only the bar itself takes clicks */
}
.admin-bar .rx-fb { top: 32px; }
@media (max-width: 782px) { .admin-bar .rx-fb { top: 46px; } }
@media (max-width: 600px) { .admin-bar .rx-fb { top: 0; } }

.rx-fb__bar {
	pointer-events: auto; position: relative;
	max-width: calc(var(--rx-container) - 2 * var(--rx-gutter)); margin-inline: auto;
	height: var(--rx-fb-h); padding-inline: 22px 10px;
	display: flex; align-items: center; gap: 24px;
	background: var(--rx-lux-white);
	box-shadow: 0 10px 30px rgba(18, 20, 22, .09), 0 0 0 1px rgba(18, 20, 22, .05);
	transition: background-color .24s var(--rx-lux-ease), color .24s var(--rx-lux-ease), box-shadow .24s var(--rx-lux-ease);
}
/* Over a film area (a hero that asks for it with [data-rox-film-zone]) the bar turns to smoked glass. */
.rx-fb[data-tone="film"]:not([data-dd-open]) { color: #fff; }
.rx-fb[data-tone="film"]:not([data-dd-open]) .rx-fb__bar { background: rgba(16, 18, 20, .34); box-shadow: 0 0 0 1px rgba(255, 255, 255, .16); backdrop-filter: blur(16px) saturate(1.3); }

.rx-fb .rx-logo { color: inherit; min-height: 44px; }
.rx-fb .rx-logo:hover { color: inherit; }
.rx-fb .rx-logo__word { font-family: var(--rx-font-modern); font-weight: 800; font-size: 19px; letter-spacing: .32em; margin-inline-end: -.32em; }
.rx-fb .rx-logo img { max-height: 28px; }

.rx-fb__nav { margin-inline: auto; }
.rx-fb__list { display: flex; align-items: center; gap: clamp(18px, 2vw, 32px); margin: 0; padding: 0; list-style: none; }
.rx-fb__link {
	position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0;
	background: none; border: 0; color: inherit; text-decoration: none; cursor: pointer;
	font: 600 14px/1 var(--rx-font-modern); letter-spacing: .01em; white-space: nowrap;
}
.rx-fb__link:hover { color: inherit; }
.rx-fb__link::after {
	content: ""; position: absolute; inset-inline: 0; bottom: 10px; height: 1.5px; background: currentColor;
	transform: scaleX(0); transform-origin: left; transition: transform .24s var(--rx-lux-ease);
}
[dir="rtl"] .rx-fb__link::after { transform-origin: right; }
.rx-fb__link:hover::after, .rx-fb__link[aria-expanded="true"]::after, .rx-fb__link[aria-current]::after { transform: scaleX(1); }
.rx-fb__chev { width: 7px; height: 7px; border-inline-end: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .24s var(--rx-lux-ease); }
[aria-expanded="true"] > .rx-fb__chev { transform: translateY(1px) rotate(-135deg); }

.rx-fb__end { display: flex; align-items: center; gap: 8px; }
.rx-fb__icon {
	display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
	background: none; border: 0; color: inherit; cursor: pointer;
}
.rx-fb__icon:hover { color: inherit; opacity: .7; }
.rx-fb .rx-lang a, .rx-sheet .rx-lang a { color: inherit; opacity: .6; }
.rx-fb .rx-lang a[aria-current="true"], .rx-sheet .rx-lang a[aria-current="true"] { opacity: 1; border-bottom-color: currentColor; }

.rx-fb__cta, .rx-fb__menu {
	display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px;
	font: 700 12px/1 var(--rx-font-modern); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
	border: 1px solid currentColor; cursor: pointer;
	transition: background-color .18s var(--rx-lux-ease), color .18s var(--rx-lux-ease), border-color .18s var(--rx-lux-ease);
}
.rx-fb__cta { background: var(--rx-lux-ink); border-color: var(--rx-lux-ink); color: #fff; }
.rx-fb__cta:hover { background: var(--rx-lux-ink-hover); border-color: var(--rx-lux-ink-hover); color: #fff; }
.rx-fb[data-tone="film"]:not([data-dd-open]) .rx-fb__cta { background: #fff; border-color: #fff; color: var(--rx-lux-ink); }
.rx-fb__menu { display: none; background: none; color: inherit; }
.rx-fb__menu:hover { background: var(--rx-lux-ink); border-color: var(--rx-lux-ink); color: #fff; }
.rx-header__cta-short { display: none; }

/* ---------- Models panel (attached to the bar) ---------- */
.rx-fb__item--dd { position: static; }
.rx-fb__panel {
	position: absolute; top: calc(100% + 8px); inset-inline-start: 0; width: min(720px, 100%);
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 8px; padding: 8px;
	background: var(--rx-lux-white); color: var(--rx-lux-ink);
	box-shadow: 0 18px 44px rgba(18, 20, 22, .14), 0 0 0 1px rgba(18, 20, 22, .05);
	animation: rxFbIn .18s var(--rx-lux-ease) both;
}
.rx-fb__panel[hidden] { display: none; }
.rx-fb__panel::before { content: ""; position: absolute; inset: -10px 0 auto; height: 10px; } /* hover bridge */
@keyframes rxFbIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.rx-fb__choices { display: grid; gap: 4px; align-content: start; margin: 0; padding: 0; list-style: none; }
.rx-fb__choice {
	display: grid; gap: 2px; padding: 16px 18px; color: var(--rx-lux-ink); text-decoration: none;
	border-inline-start: 2px solid transparent; transition: background-color .18s linear, border-color .18s linear;
}
.rx-fb__choice:hover, .rx-fb__choice:focus-visible, .rx-fb__choice.is-current { background: var(--rx-lux-mist); border-inline-start-color: var(--rx-lux-ink); color: var(--rx-lux-ink); }
.rx-fb__choice:focus-visible { outline-offset: -2px; }
.rx-fb__choice-name { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.rx-fb__choice-desc, .rx-fb__choice-fig { font-size: 13px; color: var(--rx-lux-graphite); }
.rx-fb__choice-fig b { color: var(--rx-lux-ink); font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.rx-fb__choice-state { margin-top: 6px; font-size: 12px; font-weight: 600; }
.rx-fb__choice-state.is-soon { color: var(--rx-lux-graphite); }
.rx-fb__all { display: inline-flex; align-items: center; min-height: 44px; margin: 4px 18px 6px; font-size: 13px; font-weight: 600; color: var(--rx-lux-ink); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.rx-fb__preview { position: relative; min-height: 220px; background: var(--rx-lux-mist); overflow: hidden; }
.rx-fb__pv { position: absolute; inset: 0; opacity: 0; transition: opacity .2s linear; }
.rx-fb__pv.is-active { opacity: 1; }
.rx-fb__pv img { width: 100%; height: 100%; object-fit: cover; object-position: 58% 55%; }
.rx-fb__pv--plate { display: grid; place-items: center; }
.rx-fb__pv--plate span { font-size: 18px; font-weight: 300; letter-spacing: .3em; color: var(--rx-lux-graphite); }

/* Narrow desktop: shorter booking label */
@media (max-width: 1239px) {
	.rx-fb__bar { gap: 16px; padding-inline-start: 18px; }
	.rx-fb__cta .rx-header__cta-long { display: none; }
	.rx-fb__cta .rx-header__cta-short { display: inline; }
}

/* ---------- Tablet and phone (below 1024px) ----------
   The bar keeps the wordmark, the test-drive request and a labelled Menu button; every destination is in the sheet.
   The page reserves room for the bar at the top (see hero.css), so at rest it never covers the film or the text.
   While the visitor scrolls down the bar steps away (rox.js: initFloatingBar), and it comes back on the way up,
   at the top of the page, while it holds keyboard focus, and while a menu or dialog is open. */
@media (max-width: 1023px) {
	.rx-fb { padding-top: max(var(--rx-fb-inset), env(safe-area-inset-top, 0px)); transition: transform .3s var(--rx-lux-ease); }
	.rx-fb.is-away { transform: translateY(calc(-100% - 12px)); }
	.rx-fb__nav { display: none; }
	.rx-fb__end { margin-inline-start: auto; }
	.rx-fb__menu { display: inline-flex; gap: 10px; }
}
.rx-fb__menu-icon { position: relative; width: 16px; height: 9px; flex: none; }
.rx-fb__menu-icon i { position: absolute; inset-inline: 0; height: 1.5px; background: currentColor; }
.rx-fb__menu-icon i:first-child { top: 0; }
.rx-fb__menu-icon i:last-child { bottom: 0; }
/* Phone: the same bar, slimmer; search moves into the menu sheet on the narrowest screens */
@media (max-width: 640px) {
	.rx-fb { padding-inline: 10px; }
	.rx-fb__bar { padding-inline: 16px 6px; gap: 6px; }
	.rx-fb .rx-logo__word { font-size: 17px; }
	.rx-fb__cta, .rx-fb__menu { min-height: 40px; padding: 0 12px; font-size: 11px; letter-spacing: .08em; }
	.rx-fb .rx-lang { display: none; }
}
@media (max-width: 379px) {
	.rx-fb .rx-search-btn { display: none; } /* still one tap away: first row of the menu sheet */
}
@media (prefers-reduced-motion: reduce) { .rx-fb { transition: none; } }

/* ---------- Menu sheet (bottom sheet on <dialog>) ---------- */
.rx-sheet {
	--open-ms: 260; --close-ms: 180;
	position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none;
	margin: 0; padding: 0; border: 0; background: transparent; color: var(--rx-lux-ink); overflow: hidden;
	font-family: var(--rx-font-modern);
}
.rx-sheet::backdrop { background: rgba(8, 10, 12, 0); transition: background-color .24s linear; }
.rx-sheet[data-state="open"]::backdrop { background: rgba(8, 10, 12, .4); }
.rx-sheet__panel {
	position: absolute; inset-inline: 0; bottom: 0; margin-inline: auto; max-width: 720px; max-height: calc(100% - 40px);
	display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--rx-lux-white);
	padding-bottom: env(safe-area-inset-bottom, 0px);
	transform: translateY(100%); transition: transform .18s var(--rx-lux-ease);
}
.rx-sheet[data-state="open"] .rx-sheet__panel { transform: none; transition: transform .26s var(--rx-lux-ease); }
.rx-sheet__bar { position: relative; display: flex; align-items: center; gap: 4px; padding: 14px 8px 6px var(--rx-gutter); }
.rx-sheet__grip { position: absolute; top: 8px; left: 50%; width: 36px; height: 3px; background: var(--rx-lux-hairline); transform: translateX(-50%); }
.rx-sheet__title { margin: 0 auto 0 0; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--rx-lux-graphite); }
[dir="rtl"] .rx-sheet__title { margin: 0 0 0 auto; }
.rx-sheet__close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: none; border: 0; color: inherit; cursor: pointer; }
.rx-sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 4px var(--rx-gutter) calc(20px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 10px; align-content: start; }
.rx-sheet__search {
	display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px;
	background: none; border: 1px solid var(--rx-lux-hairline); color: var(--rx-lux-graphite); cursor: pointer;
	font: 500 16px/1 var(--rx-font-modern); text-align: start;
}
.rx-sheet__search:hover { border-color: var(--rx-lux-ink); color: var(--rx-lux-ink); }
.rx-sheet__label { margin: 8px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--rx-lux-graphite); }
.rx-sheet__models { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding: 0; list-style: none; }
.rx-sheet__model { display: grid; gap: 2px; color: var(--rx-lux-ink); text-decoration: none; }
.rx-sheet__model:hover { color: var(--rx-lux-ink); }
.rx-sheet__img { display: block; aspect-ratio: 2 / 1; overflow: hidden; background: var(--rx-lux-mist); margin-bottom: 6px; }
.rx-sheet__img img { width: 100%; height: 100%; object-fit: cover; object-position: 58% 55%; }
.rx-sheet__img--plate { display: grid; place-items: center; }
.rx-sheet__img--plate span { font-size: 12px; font-weight: 300; letter-spacing: .24em; color: var(--rx-lux-graphite); text-align: center; padding: 0 8px; }
.rx-sheet__name { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.rx-sheet__meta { font-size: 12px; font-weight: 600; color: var(--rx-lux-graphite); }
.rx-sheet__links { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rx-sheet__links a { display: flex; align-items: center; min-height: 50px; padding: 6px 14px; background: var(--rx-lux-mist); color: var(--rx-lux-ink); font-size: 15px; font-weight: 600; line-height: 1.25; text-decoration: none; transition: background-color .18s linear; }
.rx-sheet__links a:hover { background: var(--rx-lux-hairline); color: var(--rx-lux-ink); }
/* With an odd number of links, the last one takes the full row, so no cell is left empty. */
.rx-sheet__links li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.rx-sheet__links a[aria-current="page"] { border-inline-start: 3px solid var(--rx-lux-ink); }
/* Find your ROX and the concierge under the models, and the two owner links: full rows, never an empty cell. */
.rx-sheet__links.rx-sheet__links--extra { margin-top: -6px; }
.rx-sheet__links.rx-sheet__links--single { grid-template-columns: 1fr; }
.rx-sheet__links.rx-sheet__links--pair { grid-template-columns: 1fr 1fr; }
.rx-sheet__drive { display: flex; align-items: center; justify-content: center; min-height: 52px; margin-top: 4px; background: var(--rx-lux-ink); color: #fff; font: 700 13px/1 var(--rx-font-modern); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; }
.rx-sheet__drive:hover { background: var(--rx-lux-ink-hover); color: #fff; }
@media (min-width: 641px) {
	.rx-sheet__links { grid-template-columns: repeat(3, 1fr); }
	.rx-sheet__links li:last-child:nth-child(odd) { grid-column: auto; }
	.rx-sheet__img { aspect-ratio: 16 / 9; }
}

/* ---------- Shared pieces still used by the search dialog and other templates ---------- */
.rx-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--rx-on-dark); text-decoration: none; min-height: 44px; }
.rx-logo:hover { color: var(--rx-on-dark); }
.rx-logo__word { font-family: var(--rx-font-ui); font-weight: 600; font-size: 26px; letter-spacing: .32em; margin-inline-end: -.32em; }
.rx-logo img { width: auto; max-height: 34px; }
.rx-icon-btn {
	position: relative;
	display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
	background: none; border: 0; color: var(--rx-on-dark);
}
.rx-icon-btn--framed { border: 1px solid var(--rx-line-dark-strong); }
.rx-icon-btn:hover { color: var(--rx-accent); }
.rx-lang { display: flex; align-items: center; gap: 2px; font-size: 12px; letter-spacing: .12em; }
.rx-lang a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--rx-on-dark-muted); text-decoration: none; border-bottom: 1px solid transparent; }
.rx-lang a[aria-current="true"] { color: var(--rx-on-dark); border-bottom-color: var(--rx-accent); }
.rx-lang a:lang(ar) { font-family: var(--rx-font-ar); font-size: 13px; letter-spacing: 0; }

/* Search dialog (unchanged from Milestone 1) */
.rx-dialog {
	position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none;
	margin: 0; padding: 0; border: 0; background: var(--rx-ink); color: var(--rx-on-dark);
	overflow-y: auto; overscroll-behavior: contain;
}
.rx-dialog::backdrop { background: rgba(9, 12, 11, .7); }
.rx-dialog[open] { animation: mIn .5s var(--rx-ease) both; }
@keyframes mIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.rx-menu__bar { height: var(--rx-header-h); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.rx-search__inner { max-width: 900px; margin-inline: auto; padding: 0 var(--rx-gutter) 48px; }
.rx-search__form { margin-top: 12vh; }
.rx-search__label { display: block; font-size: var(--rx-fs-label); letter-spacing: var(--rx-track-eyebrow); text-transform: uppercase; color: var(--rx-accent); }
.rx-search__field { display: flex; align-items: center; gap: 12px; margin-top: 18px; border-bottom: 1px solid var(--rx-line-dark-strong); transition: border-color .3s; }
.rx-search__field:focus-within { border-color: var(--rx-accent); }
.rx-search__input {
	flex: 1; min-width: 0; padding: 14px 0; background: none; border: 0; outline: none;
	font-family: var(--rx-font-display); font-size: clamp(32px, 5vw, 56px); color: var(--rx-on-dark);
}
.rx-search__input::placeholder { color: rgba(244, 240, 232, .4); }
.rx-search__hint { margin-top: 16px; font-size: 14px; color: var(--rx-on-dark-muted); }
.rx-search__quick { margin: 40px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.rx-search__quick a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--rx-line-dark-strong); color: var(--rx-on-dark-control); text-decoration: none; font-size: 14px; }
.rx-search__quick a:hover { border-color: var(--rx-accent); color: var(--rx-on-dark); }

@media (prefers-reduced-motion: reduce) {
	.rx-dialog[open], .rx-fb__panel { animation: none; }
	.rx-fb__bar, .rx-fb__link::after, .rx-fb__chev, .rx-fb__pv, .rx-sheet__panel, .rx-sheet::backdrop { transition: none; }
}

/* Focus: an ink ring on the white Light Luxury surfaces (the theme's champagne ring is too faint on white), white over film. */
.rx-fb :focus-visible, .rx-sheet :focus-visible { outline: 2px solid var(--rx-lux-ink); outline-offset: 3px; }
.rx-fb[data-tone="film"]:not([data-dd-open]) .rx-fb__bar :focus-visible { outline-color: #fff; }
.rx-fb__choice:focus-visible { outline-offset: -2px; }
