fix: ensure mobile menu and language dropdown appear in front of hero banner video (raised z-indexes for overlays)
- Navbar: z-[999] - Mobile menu container/panel: z-[1000]/z-[1001] - Cart drawer: z-[980]/z-[990] - LanguageSwitcher dropdown/backdrop: z-[1010]/z-[1020] - Updated comments - Mobile menu (incl. when clicking language inside it) now reliably stacks above the mobile banner video and other content.
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
* KEY DESIGN CHOICES:
|
* KEY DESIGN CHOICES:
|
||||||
* - Fixed position, full-height, max-w-md (beautiful on both mobile and desktop)
|
* - Fixed position, full-height, max-w-md (beautiful on both mobile and desktop)
|
||||||
* - Backdrop click closes it (standard mobile pattern)
|
* - Backdrop click closes it (standard mobile pattern)
|
||||||
* - z-[70] sits above almost everything (including the sticky category nav)
|
* - z-[990] sits above almost everything (including the sticky category nav) (below mobile menu)
|
||||||
* - All cart mutations go through the context — this component is "dumb" UI only
|
* - All cart mutations go through the context — this component is "dumb" UI only
|
||||||
*
|
*
|
||||||
* THE ORDERING FLOW (very important for restaurant context):
|
* THE ORDERING FLOW (very important for restaurant context):
|
||||||
@@ -82,13 +82,13 @@ Thank you!`;
|
|||||||
{/* SEMI-TRANSPARENT BACKDROP */}
|
{/* SEMI-TRANSPARENT BACKDROP */}
|
||||||
{/* Clicking anywhere outside the drawer closes it (standard mobile pattern) */}
|
{/* Clicking anywhere outside the drawer closes it (standard mobile pattern) */}
|
||||||
<div
|
<div
|
||||||
className="fixed inset-0 bg-black/40 z-[60]"
|
className="fixed inset-0 bg-black/40 z-[980]"
|
||||||
onClick={closeCart}
|
onClick={closeCart}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* THE ACTUAL DRAWER — slides in from right */}
|
{/* THE ACTUAL DRAWER — slides in from right */}
|
||||||
{/* z-[70] ensures it sits above sticky nav, category pills, and most other UI */}
|
{/* z-[990] ensures it sits above sticky nav, category pills, and most other UI (below mobile menu) */}
|
||||||
<div className="fixed top-0 right-0 h-full w-full max-w-md bg-[#F8F5F0] z-[70] shadow-2xl flex flex-col">
|
<div className="fixed top-0 right-0 h-full w-full max-w-md bg-[#F8F5F0] z-[990] shadow-2xl flex flex-col">
|
||||||
{/* HEADER — Title + item count + quick clear + close button */}
|
{/* HEADER — Title + item count + quick clear + close button */}
|
||||||
<div className="flex items-center justify-between p-6 border-b border-[#EDE6D9]">
|
<div className="flex items-center justify-between p-6 border-b border-[#EDE6D9]">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
|
|||||||
@@ -31,12 +31,12 @@ export default function LanguageSwitcher() {
|
|||||||
<>
|
<>
|
||||||
{/* Backdrop */}
|
{/* Backdrop */}
|
||||||
<div
|
<div
|
||||||
className="fixed inset-0 z-40"
|
className="fixed inset-0 z-[1010]"
|
||||||
onClick={() => setIsOpen(false)}
|
onClick={() => setIsOpen(false)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Dropdown */}
|
{/* Dropdown */}
|
||||||
<div className="absolute right-0 top-full mt-2 z-50 w-44 rounded-2xl border border-[#c99a2e]/20 bg-[#fbf7ef] shadow-2xl overflow-hidden">
|
<div className="absolute right-0 top-full mt-2 z-[1020] w-44 rounded-2xl border border-[#c99a2e]/20 bg-[#fbf7ef] shadow-2xl overflow-hidden">
|
||||||
{languages.map((lang) => (
|
{languages.map((lang) => (
|
||||||
<button
|
<button
|
||||||
key={lang.code}
|
key={lang.code}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export default function Navbar({ variant = "default" }: NavbarProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<nav
|
<nav
|
||||||
className="fixed top-0 left-0 right-0 z-[60] h-[64px] border-b border-[#c99a2e]/20 bg-[#fbf7ef] shadow-sm backdrop-blur-xl"
|
className="fixed top-0 left-0 right-0 z-[999] h-[64px] border-b border-[#c99a2e]/20 bg-[#fbf7ef] shadow-sm backdrop-blur-xl"
|
||||||
>
|
>
|
||||||
<div className="max-w-7xl mx-auto px-6 flex items-center justify-between h-full">
|
<div className="max-w-7xl mx-auto px-6 flex items-center justify-between h-full">
|
||||||
{/* Top subtle gold line for extra frame separation */}
|
{/* Top subtle gold line for extra frame separation */}
|
||||||
@@ -178,10 +178,10 @@ export default function Navbar({ variant = "default" }: NavbarProps) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Modern Mobile Menu Drawer (slide-in, animated, high-contrast, touch-friendly) */}
|
{/* Modern Mobile Menu Drawer (slide-in, animated, high-contrast, touch-friendly) - high z to always appear in front of hero banner video etc. */}
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
{isOpen && (
|
{isOpen && (
|
||||||
<div className="md:hidden fixed inset-0 z-[65]">
|
<div className="md:hidden fixed inset-0 z-[1000]">
|
||||||
{/* Backdrop */}
|
{/* Backdrop */}
|
||||||
<motion.div
|
<motion.div
|
||||||
className="absolute inset-0 bg-[#101724]/70 backdrop-blur-md"
|
className="absolute inset-0 bg-[#101724]/70 backdrop-blur-md"
|
||||||
@@ -194,7 +194,7 @@ export default function Navbar({ variant = "default" }: NavbarProps) {
|
|||||||
|
|
||||||
{/* Sliding Panel - modern, full-bleed on small phones, elegant on larger */}
|
{/* Sliding Panel - modern, full-bleed on small phones, elegant on larger */}
|
||||||
<motion.div
|
<motion.div
|
||||||
className="absolute right-0 top-0 bottom-0 w-[82%] max-w-[340px] bg-[#fbf7ef] shadow-2xl border-l border-[#c99a2e]/10 flex flex-col overflow-y-auto"
|
className="absolute right-0 top-0 bottom-0 w-[82%] max-w-[340px] bg-[#fbf7ef] shadow-2xl border-l border-[#c99a2e]/10 flex flex-col overflow-y-auto z-[1001]"
|
||||||
initial={{ x: '100%' }}
|
initial={{ x: '100%' }}
|
||||||
animate={{ x: 0 }}
|
animate={{ x: 0 }}
|
||||||
exit={{ x: '100%' }}
|
exit={{ x: '100%' }}
|
||||||
|
|||||||
Reference in New Issue
Block a user