nav{
	position: fixed;
	top:0;
	left: 0;
	height: fit-content;
	width: calc(100vw - var(--padding));
	padding: 0.5rem 3rem ;
	display: flex;
	justify-content: space-between;
	align-items: center;
	z-index: 9999999;
	background: rgba(255, 255, 255, 0.4);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

nav .logo{
	width: 9rem;
	height: auto;
}
nav .logo a {
	display: block;
	width: 100%;
}
nav .logo img{
	width: 100%;
	height: auto;
	display: block;
	margin-top: 0rem;
}

nav ul{
	position: relative;
	display: flex;
	gap: 0.5rem;
	list-style-type: none;
}

nav ul li{
	height: 2.5rem;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Override overflow for dropdown items */
nav ul li.has-dropdown{
	position: relative;
	overflow: visible;
}

nav ul li a{
	text-decoration: none;
	height: 100%;
	width: 100%;
	padding: 0.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1.2;
	font-family: "base";
	color:#000;
	gap: 0.2rem;
	font-size: 0.9rem;
	font-weight: 600;
}

nav ul li a span{
	height: 1rem;
	width: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

nav .action_buttons{
	display: flex;
	gap: 0.5rem;
}

nav button{
	border:none;
	background: none;
	border-radius: 0.2rem;
	height: 2.5rem;
	width: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

nav .nav-toggle{
	display: none;
}

nav .action_buttons button{
	color: #000;
}

nav .action_buttons button.whatsapp{
	color: #000;
	background-color: #25D366;
}


nav .dropdown-menu{
	position: absolute;
	top: 100%;
	left: 0;
	background: #fff;
	box-shadow: 0 4px 20px rgba(0,0,0,0.1);
	border-radius: 0.2rem;
	list-style-type: none;
	min-width: 220px;
	padding: 0.5rem 0;
	margin-top: 0.5rem;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: all 0.3s ease;
	z-index: 1000;
	display: flex;
	flex-direction: column;
}

nav ul li.has-dropdown:hover > .dropdown-menu{
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

nav .dropdown-menu li{
	height: 2.5rem;
	overflow: visible;
	width: 100%;
	padding: 0;
}

nav .dropdown-menu li a{
	height: 2.5rem;
	padding: 0 1rem;
	justify-content: flex-start;
	font-size: 0.9rem;
	white-space: nowrap;
	transition: background 0.2s ease;
}

nav .dropdown-menu li a:hover{
	background: #f5f5f5;
}

nav .dropdown-menu li a span{
	height: 2rem;
	width: 0rem;
	display: flex;
	align-items: center;
	justify-content: center;
	will-change: width;
	transition: 0.2s;
	margin-right: 0;
}

nav .dropdown-menu li a:hover span{
	width: 2rem;
}

nav .dropdown-menu li a span svg{
	transform: scale(0.8);
}

/* Subdropdown Styles */
nav .dropdown-menu li.has-subdropdown{
	position: relative;
}

nav .dropdown-menu li.has-subdropdown > a{
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-right: 0.5rem;
}

nav .dropdown-menu li.has-subdropdown > a .arrow-icon{
	margin-right: 0;
}

nav .dropdown-menu li.has-subdropdown > a .chevron-icon{
	height: 2rem;
	width: 1.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-left: auto;
	color: #666;
	transition: transform 0.2s ease;
}

nav .dropdown-menu li.has-subdropdown:hover > a .chevron-icon{
	transform: translateX(3px);
	color: var(--color);
}

nav .subdropdown-menu{
	position: absolute;
	top: 0;
	left: 100%;
	background: #fff;
	box-shadow: 0 4px 20px rgba(0,0,0,0.1);
	border-radius: 0.2rem;
	list-style-type: none;
	min-width: 250px;
	padding: 0.5rem 0;
	margin-left: 0.5rem;
	opacity: 0;
	visibility: hidden;
	transform: translateX(-10px);
	transition: all 0.3s ease;
	z-index: 1001;
	display: flex;
	flex-direction: column;
}

nav .dropdown-menu li.has-subdropdown:hover > .subdropdown-menu{
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
}

nav .subdropdown-menu li{
	height: 2.5rem;
}

nav .subdropdown-menu li a{
	height: 2.5rem;
	padding: 0 1rem;
}

@media (max-width: 1023px){
	nav{
		padding: 0.5rem 1rem;
		width: 100%;
	}

	nav .logo{ width: 7.5rem; }

	nav .nav-toggle{
		display: flex;
		color: #000;
	}

	nav ul.navigation{
		position: fixed;
		top: 4.2rem;
		left: 0;
		right: 0;
		flex-direction: column;
		gap: 0;
		padding: 0.75rem 1rem;
		background: rgba(255, 255, 255, 0.95);
		backdrop-filter: blur(10px);
		-webkit-backdrop-filter: blur(10px);
		border-bottom: 1px solid rgba(0, 0, 0, 0.06);
		max-height: calc(100vh - 4.2rem);
		overflow: auto;
		opacity: 0;
		visibility: hidden;
		transform: translateY(-10px);
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
		z-index: 9999998;
	}

	nav.nav-open ul.navigation{
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	nav ul li{
		height: auto;
		justify-content: flex-start;
		width: 100%;
		overflow: visible;
	}

	/* Stack dropdown content vertically on mobile (prevents submenus appearing beside the parent) */
	nav ul li.has-dropdown,
	nav .dropdown-menu li.has-subdropdown{
		flex-direction: column;
		align-items: stretch;
		height: auto;
	}

	nav ul li a{
		justify-content: space-between;
		padding: 0.75rem 0.5rem;
		width: 100%;
	}

	/* Mobile dropdown: tap-to-open via .open */
	nav .dropdown-menu{
		position: static;
		box-shadow: none;
		margin-top: 0;
		transform: none;
		opacity: 1;
		visibility: visible;
		display: none;
		width: 100%;
		padding: 0.25rem 0;
		border-radius: 0;
		background: transparent;
	}

	/* On mobile, ignore :hover flyout behavior entirely */
	nav ul li.has-dropdown:hover > .dropdown-menu{
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	nav ul li.has-dropdown.open > .dropdown-menu{
		display: flex;
	}

	/* Mobile subdropdown: stack under parent instead of flyout */
	nav .subdropdown-menu{
		position: static;
		box-shadow: none;
		margin-left: 0;
		transform: none;
		opacity: 1;
		visibility: visible;
		display: none;
		width: 100%;
		padding: 0.25rem 0;
		border-radius: 0;
		background: transparent;
	}

	nav .dropdown-menu li.has-subdropdown:hover > .subdropdown-menu{
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	nav .dropdown-menu li.has-subdropdown.open > .subdropdown-menu{
		display: flex;
	}

	nav .subdropdown-menu li a{
		padding-left: 2rem;
	}

	nav .dropdown-menu li a{
		padding-left: 1.25rem;
	}

	nav .dropdown-menu li a:hover{
		background: transparent;
	}

	nav .dropdown-menu li a:hover span{
		width: 0;
	}
}

/* ===== Global Product Search Overlay ===== */
nav .search-toggle{
	color: #000;
}

.search-overlay{
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 99999999;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding-top: 8rem;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s;
}

.search-overlay.active{
	opacity: 1;
	visibility: visible;
}

.search-container{
	width: 90%;
	max-width: 700px;
	background: #fff;
	border-radius: 1rem;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0,0,0,0.3);
	transform: translateY(-20px);
	transition: transform 0.3s ease;
}

.search-overlay.active .search-container{
	transform: translateY(0);
}

.search-input-wrapper{
	display: flex;
	align-items: center;
	padding: 1rem 1.5rem;
	border-bottom: 1px solid #eee;
	gap: 1rem;
}

.search-input-wrapper svg{
	width: 20px;
	height: 20px;
	color: #999;
	flex-shrink: 0;
}

#global-search-input{
	flex: 1;
	border: none;
	outline: none;
	font-size: 1.1rem;
	font-family: "base", sans-serif;
	color: #333;
	background: transparent;
}

#global-search-input::placeholder{
	color: #aaa;
}

.search-close{
	background: none;
	border: none;
	font-size: 1.8rem;
	cursor: pointer;
	color: #999;
	padding: 0;
	line-height: 1;
	width: auto;
	height: auto;
	transition: color 0.2s;
}

.search-close:hover{
	color: #333;
}

.search-results{
	max-height: 400px;
	overflow-y: auto;
}

.search-result-item{
	display: flex;
	align-items: center;
	padding: 0.8rem 1.5rem;
	text-decoration: none;
	color: #333;
	gap: 1rem;
	transition: background 0.2s;
	border-bottom: 1px solid #f5f5f5;
}

.search-result-item:hover{
	background: #f8f8f8;
}

.search-result-item img{
	width: 50px;
	height: 50px;
	object-fit: cover;
	border-radius: 0.5rem;
	background: #f0f0f0;
}

.search-result-info{
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.search-result-name{
	font-family: "base", sans-serif;
	font-weight: 600;
	font-size: 0.95rem;
	text-transform: capitalize;
}

.search-result-meta{
	font-family: "base", sans-serif;
	font-size: 0.8rem;
	color: #888;
}

.no-results{
	padding: 2rem;
	text-align: center;
	color: #999;
	font-family: "base", sans-serif;
	font-size: 0.95rem;
}

@media (max-width: 1023px){
	.search-overlay{
		padding-top: 5rem;
	}

	.search-container{
		width: 95%;
		border-radius: 0.75rem;
	}

	.search-input-wrapper{
		padding: 0.8rem 1rem;
		gap: 0.75rem;
	}

	#global-search-input{
		font-size: 1rem;
	}

	.search-results{
		max-height: 50vh;
	}

	.search-result-item{
		padding: 0.7rem 1rem;
	}

	.search-result-item img{
		width: 40px;
		height: 40px;
	}
}

@media (max-width: 576px){
	.search-overlay{
		padding-top: 1rem;
		padding-left: 0.75rem;
		padding-right: 0.75rem;
		padding-bottom: 1rem;
	}

	.search-container{
		width: 100%;
		max-width: none;
		max-height: calc(100dvh - 2rem);
		display: flex;
		flex-direction: column;
	}

	.search-input-wrapper{
		padding: 0.75rem 0.9rem;
	}

	#global-search-input{
		font-size: 16px;
	}

	.search-results{
		max-height: none;
		overflow: auto;
		-webkit-overflow-scrolling: touch;
	}
}
