/**
 * Navbar Styles - Standalone (No Astra Dependencies)
 * DaisyUI-inspired navbar styling for WordPress navigation menu
 * 
 * @package OTA_DatXeViet_Theme
 * @since 1.0.0
 */

/* Main header/navbar container */
.ota-header,
#masthead.ota-header,
header.ota-header {
	position: sticky !important;
	position: -webkit-sticky !important;
	/* Safari support */
	top: 0 !important;
	left: 0;
	right: 0;
	width: 100% !important;
	z-index: 500 !important;
	background-color: rgba(var(--primary-black) / 1);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	border: none;
	border-bottom: none;
	transition: background-color 0.2s ease, box-shadow 0.2s ease, backdrop-filter 0.2s ease;
	margin: 0 !important;
	padding: 0 20px !important;

}


.ota-header__inner {
	min-height: 4rem;
	padding: 0;
	width: 100%;
	position: relative;
}

.ota-header__content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 1rem 0;
}


/* Scrolled state - dark transparent background */
.ota-header.is-scrolled {
	background-color: rgba(var(--primary-black) / 0.5) !important;
	backdrop-filter: blur(15px);
	-webkit-backdrop-filter: blur(15px);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ota-header.is-scrolled .ota-menu a,
.ota-header.is-scrolled .ota-navbar a {
	color: rgb(var(--background)) !important;
}

.ota-header.is-scrolled .site-branding,
.ota-header.is-scrolled .site-title a,
.ota-header.is-scrolled .ota-header__logo-link {
	color: rgb(var(--background)) !important;
}

.ota-header.is-scrolled .ota-header-button,
.ota-header.is-scrolled .ota-header__hotline-btn {
	color: rgb(var(--background)) !important;
}

.ota-header.is-scrolled .menu-toggle {
	color: rgb(var(--background)) !important;
}

.ota-header.is-scrolled .menu-toggle svg,
.ota-header.is-scrolled .menu-toggle-icon {
	fill: rgb(var(--background)) !important;
	color: rgb(var(--background)) !important;
	stroke: rgb(var(--background)) !important;
}

/* Navbar container */
.ota-navbar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 1rem;
	flex: 1;
}

@media (max-width: 1300px) {
	.ota-navbar {
		gap: 0.5rem;
	}
}

/* Site Branding */
.ota-header__branding {
	display: flex;
	align-items: center;
}

.ota-header__logo-link {
	display: block;
	line-height: 0;
}

.ota-header__logo-img {
	max-height: 4.2rem; /* 30% larger when not scrolled (3rem * 1.3) */
	width: auto;
	height: auto;
	transition: max-height 0.3s ease;
}

/* Normal size when scrolled */
.ota-header.is-scrolled .ota-header__logo-img {
	max-height: 3rem;
}

.site-branding,
.site-title a {
	font-weight: 700;
	font-size: 1.5rem;
	text-decoration: none;
	color: rgb(var(--background)) !important;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Menu list container */
.ota-menu,
.ota-menu.main-header-menu {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Menu items */
.ota-menu>li {
	display: flex;
	align-items: center;
	position: relative;
	line-height: 20px !important;
}

/* Menu groups - Group items with divider */
.ota-menu>li.menu-item-group {
	position: relative;
}

@media (max-width: 1120px) {
	.ota-menu>li.menu-item-group {
		font-size: 12px;
		padding: 2px 5px;
	}

	.menu-item>a {
		font-size: 12px;
		padding: 2px 5px;
	}
}

@media (max-width: 1300px) {
	.ota-menu>li.menu-item-group {
		font-size: 12px;
	}

	.menu-item>a {
		font-size: 12px;

	}
}

.ota-menu>li.menu-item-group::before {
	content: '';
	position: absolute;
	left: -0.25rem;
	top: 50%;
	transform: translateY(-50%);
	width: 1px;
	height: 1.5rem;
	background-color: rgba(var(--foreground) / 0.1);
}

.ota-menu>li.menu-item-group:first-child::before {
	display: none;
}

/* Menu links - DaisyUI btn-ghost style */
.ota-menu a,
.ota-menu .menu-link {
	text-transform: uppercase;
	display: flex;
	align-items: center;
	padding: 0.5rem 1rem;
	border-radius: 0.5rem;
	text-decoration: none;
	transition: all 0.2s;
	font-weight: 600;
	letter-spacing: 0.05em;
	background-color: transparent;
	border: none;
	color: rgb(var(--background)) !important;
}

/* Menu links hover - DaisyUI btn-ghost hover */
.ota-menu a:hover,
.ota-menu .menu-link:hover {
	background-color: rgba(var(--foreground) / 0.05);
}

/* Active/current menu item - DaisyUI active state */
.ota-menu .current-menu-item>a,
.ota-menu .current_page_item>a {
	background-color: rgba(var(--primary) / 0.1);
	color: rgb(var(--primary));
	font-weight: 600;
}

/* Dropdown/submenu styling - DaisyUI dropdown style */
.ota-menu .sub-menu,
.ota-menu .children {
	position: absolute;
	top: 80%;
	left: 0;
	min-width: 13rem;
	background-color: rgba(var(--primary) / 0.9);
	backdrop-filter: blur(20px) !important;
	-webkit-backdrop-filter: blur(20px);
	border-radius: 0.5rem;
	padding: 0.5rem;
	margin-top: 0.25rem;
	display: none;
	z-index: 50;
	list-style: none;
}

/* Ensure parent menu items don't block backdrop-filter */
.ota-menu>li {
	overflow: visible;
}

.ota-menu li:hover>.sub-menu,
.ota-menu li:hover>.children {
	display: block;
}

/* Hide default dropdown arrows from theme */
.ota-menu>li.menu-item-has-children>a::before,
.ota-menu>li.menu-item-has-children>a::after {
	content: none !important;
}

/* Parent menu item with dropdown - DaisyUI dropdown style */
.ota-menu>li.menu-item-has-children>a::after {
	margin-left: 0.5rem;
	font-size: 0.625rem;
	opacity: 0.7;
}

/* Submenu items */
.ota-menu .sub-menu li,
.ota-menu .children li {
	width: 100%;
}

.ota-menu .sub-menu a,
.ota-menu .children a {
	width: 100%;
	padding: 0.5rem 1rem;
	border-radius: 0.375rem;
	display: block;
}

.ota-menu .sub-menu a:hover,
.ota-menu .children a:hover {
	background-color: rgba(var(--foreground) / 0.05);
}

/* Header Button / Hotline Button */
.ota-header__button-wrap {
	display: flex;
	align-items: center;
	white-space: nowrap;


}

.ota-header-button,
.ota-header__hotline-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	text-decoration: none;
	white-space: nowrap;
	padding: 0.5rem 1rem;
	border-radius: 0.5rem;
	font-weight: 600;
	transition: all 0.2s;
	background-color: rgba(var(--icon-color-primary)/ 1) !important;
	color: rgb(var(--icon-color-secondary)) !important;
	box-shadow:
		0 8px 20px rgba(var(--primary) / 0.7),
		inset 0 0 0 1px rgba(255 255 255 / 0.4);
	transition:
		background-color 0.25s ease,
		transform 0.2s ease,
		box-shadow 0.25s ease,
		filter 0.25s ease;
}

.ota-header-button:hover,
.ota-header__hotline-btn:hover {
	background-color: rgba(var(--primary) / 0.8) !important;
	transform: translateY(-2px);
	box-shadow:
		0 8px 20px rgba(var(--primary) / 0.35),
		inset 0 0 0 1px rgba(255 255 255 / 0.15);
	filter: brightness(1.05);
}

.ota-header-button:active,
.ota-header__hotline-btn:active {
	transform: translateY(0) scale(0.97);
	box-shadow:
		0 4px 10px rgba(var(--primary) / 0.25),
		inset 0 2px 6px rgba(0 0 0 / 0.2);
	filter: brightness(0.95);
}

/* Hotline button icon + jiggle animation */
.ota-header__hotline-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ota-header__hotline-icon svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	color: inherit;
	stroke: currentColor;
}

.ota-header__hotline-icon {
	animation: ota-phone-jiggle 2s ease-in-out infinite;
}

@keyframes ota-phone-jiggle {
	0%, 100% { transform: rotate(0deg); }
	10%, 30% { transform: rotate(-8deg); }
	20%, 40% { transform: rotate(8deg); }
	50% { transform: rotate(0deg); }
	60%, 80% { transform: rotate(-6deg); }
	70%, 90% { transform: rotate(6deg); }
}

/* Phone number button in main menu (custom menu item with class phone-number-component) */
.ota-menu>li.phone-number-component>a {
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding-inline: 1.25rem;
	border-radius: 9999px;
}

/* Mobile menu toggle button - DaisyUI btn style */
.menu-toggle {
	padding: 0.5rem;
	border-radius: 0.5rem;
	background-color: transparent !important;
	border: none !important;
	outline: none !important;
	cursor: pointer;
	display: none;
	/* Hidden by default, shown on mobile */
	align-items: center;
	justify-content: center;
	min-height: 2.5rem;
	min-width: 2.5rem;
	color: rgb(var(--background)) !important;
	box-shadow: none !important;
}

.menu-toggle:hover {
	background-color: rgba(var(--foreground) / 0.05) !important;
	border: none !important;
}

.menu-toggle:focus {
	outline: none !important;
	border: none !important;
	box-shadow: none !important;
}

.menu-toggle svg,
.menu-toggle-icon {
	fill: rgb(var(--background)) !important;
	color: rgb(var(--background)) !important;
	stroke: rgb(var(--background)) !important;
}

/* Hamburger → X: ẩn gạch giữa, xoay gạch trên/dưới */
.menu-toggle[aria-expanded="true"] .menu-toggle-line--mid {
	opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-line--top {
	transform-origin: 12px 6px;
	transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-line--bot {
	transform-origin: 12px 18px;
	transform: translateY(-6px) rotate(-45deg);
}

.menu-toggle-icon svg {
	overflow: visible;
}

.menu-toggle-line {
	transition: opacity 0.2s ease, transform 0.2s ease;
}

/* =========================================================
 * Auto route dropdown (\"Tuyến xe\") - compact style
 * =======================================================*/
/* Chữ sáng cho mục \"Tuyến xe\" (link tới /tuyen-xe/, không toggle) */
.ota-menu .menu-item-routes-root > a {
	color: #fff !important;
	font-weight: 700;
}

.ota-menu .ota-routes-submenu {
	/* Giữ cùng kiểu nền, chỉ giới hạn chiều cao */
	max-height: 60vh;
	overflow-y: auto;
	backdrop-filter: blur(10px);
}

.ota-menu .ota-routes-submenu a {
	/* Text thường, nhỏ hơn menu chính */
	text-transform: none;
	font-size: 0.75rem;
	line-height: 1.3;
	padding-top: 0.35rem;
	padding-bottom: 0.35rem;
}

/* Menu divider/separator styling */
.ota-menu>li.menu-item-separator {
	width: 1px;
	height: 1.5rem;
	background-color: rgb(var(--border));
	margin: 0 0.5rem;
	padding: 0;
	pointer-events: none;
}

.ota-menu>li.menu-item-separator>a {
	display: none;
}

/* Mobile Menu Drawer */
.ota-header__mobile-menu {
	display: none;
	position: fixed;
	/* Start exactly below the sticky header - match header min-height */
	top: 4rem;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(var(--primary-black) / 0.4);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	padding-top: 0;
	overflow-y: auto;
	z-index: 999;
}

.ota-header__mobile-menu-content {
	padding: 2rem;
	max-width: 100%;
	overflow-x: hidden;
}

/* Mobile menu styles */
@media (max-width: 768px) {

	/* Only show mobile menu on mobile devices */
	.ota-header__mobile-menu[aria-hidden="false"] {
		display: block;
	}

	/* Adjust top position to match actual header height on mobile */
	.ota-header__mobile-menu {
		/* Use the header's actual height - header inner min-height is 4rem */
		top: 4rem;
	}

	.ota-header__mobile-menu-content {
		padding: 1.5rem 1rem;
	}

	/* Hide desktop menu list only in the top navigation bar, not in the mobile drawer */
	.ota-header__navigation .ota-menu.main-header-menu {
		display: none !important;
	}

	.ota-header__content {
		flex-wrap: nowrap;
		gap: 0.5rem;
	}

	.ota-navbar {
		gap: 0.5rem;
		flex-wrap: nowrap;
	}

	.ota-menu {
		display: none;
	}

	/* Show menu toggle on mobile */
	.menu-toggle {
		display: flex;
		flex-shrink: 0;
	}

	/* Ensure hotline button and menu toggle don't wrap */
	.ota-header__button-wrap {
		flex-shrink: 0;
	}

	.ota-menu--mobile {
		display: flex !important;
		flex-direction: column;
		width: 100%;
		align-items: stretch;
		padding: 0;
		margin: 0;
		gap: 0;
	}

	.ota-menu--mobile>li {
		width: 100%;
		margin: 0;
		padding: 0;
		border-bottom: 1px solid rgba(var(--border) / 0.2);
	}



	.ota-menu--mobile>li:last-child {
		border-bottom: none;
	}

	.ota-menu--mobile a {
		width: 100%;
		color: rgb(var(--background)) !important;
		padding: 16px 20px !important;
		font-weight: 600 !important;
		font-size: 15px !important;
		letter-spacing: 0.02em;
		display: flex;
		align-items: center;
		justify-content: space-between;
		text-decoration: none;
		transition: background-color 0.2s ease;
	}

	.ota-menu--mobile a:hover {
		background-color: rgba(var(--foreground) / 0.05) !important;
	}

	/* Dropdown indicator for menu items with children */
	.ota-menu--mobile>li.menu-item-has-children>a::after {
		content: '▼';
		font-size: 10px;
		margin-left: 8px;
		opacity: 0.6;
		transition: transform 0.2s ease;
	}

	.ota-menu--mobile>li.menu-item-has-children>a[aria-expanded="true"]::after {
		transform: rotate(180deg);
	}

	/* Mobile submenu: ẩn mặc định, chỉ hiện khi toggle (parent có .focus) */
	.ota-menu--mobile .sub-menu,
	.ota-menu--mobile .children {
		display: none;
		position: static;
		box-shadow: none;
		margin: 0;
		padding: 0;
		padding-left: 0;
		background-color: transparent !important;
		border-top: 1px solid rgba(var(--border) / 0.1);
	}

	/* Show submenu when parent is active/expanded (toggle) */
	.ota-menu--mobile>li.menu-item-has-children.focus .sub-menu,
	.ota-menu--mobile>li.menu-item-has-children.focus .children {
		display: block;
	}

	/* Mặc định hiển thị submenu "Tuyến xe" (không ẩn) */
	.ota-menu--mobile>li.menu-item-routes-root .sub-menu,
	.ota-menu--mobile>li.menu-item-routes-root .children {
		display: block;
	}
	/* Mobile: submenu tuyến xe gọn, thụt lề, scroll nếu dài */
	.ota-menu--mobile .ota-routes-submenu {
		max-height: 13vh;
		overflow-y: auto;
		padding-left: 1rem;
		border-left: 2px solid rgba(var(--border) / 0.3);
		margin-left: 0.5rem;
		margin-top: 0.25rem;
		margin-bottom: 0.25rem;
	}

	.ota-menu--mobile .ota-routes-submenu a {
		font-size: 0.8125rem !important;
		padding: 0.5rem 0.75rem !important;
		text-transform: none;
	}

	.ota-menu--mobile .sub-menu li,
	.ota-menu--mobile .children li {
		border-bottom: 1px solid rgba(var(--border) / 0.1);
	}

	.ota-menu--mobile .sub-menu li:last-child,
	.ota-menu--mobile .children li:last-child {
		border-bottom: none;
	}

	.ota-menu--mobile .sub-menu a,
	.ota-menu--mobile .children a {
		color: rgba(var(--background)) !important;
		padding: 12px 20px !important;
		font-weight: 400 !important;
		font-size: 14px !important;
		display: block;
	}

	.ota-menu--mobile .sub-menu a:hover,
	.ota-menu--mobile .children a:hover {
		background-color: rgba(var(--foreground) / 0.03) !important;
		color: rgb(var(--foreground)) !important;
	}

	/* Hide group dividers on mobile */
	.ota-menu--mobile>li.menu-item-group::before {
		display: none;
	}

	.ota-menu--mobile>li.menu-item-separator {
		width: 100%;
		height: 1px;
		margin: 12px 0;
		background-color: rgba(var(--border) / 0.3);
	}

	.ota-header.is-scrolled .ota-menu--mobile a {
		color: rgb(var(--foreground)) !important;
	}

	/* Mobile: Ensure button doesn't wrap */
	.ota-header__button-wrap,
	.ota-header-button,
	.ota-header__hotline-btn {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	/* Mobile: Ensure branding doesn't shrink too much */
	.ota-header__branding {
		flex-shrink: 1;
		min-width: 0;
	}

	.ota-header__logo-img {
		max-height: 3.25rem; /* 30% larger when not scrolled (2.5rem * 1.3) */
	}

	/* Normal size when scrolled on mobile */
	.ota-header.is-scrolled .ota-header__logo-img {
		max-height: 2.5rem;
	}

	/* Mobile: Better spacing for navigation items */
	.ota-header__navigation {
		display: flex;
		align-items: center;
		gap: 0.5rem;
	}
}

/* =========================================================
 * GTranslate – Modern UI (Popup/Dropdown)
 * ========================================================= */
.gtranslate_wrapper {
	--gtranslate-primary: rgb(var(--primary, 0 123 255));
	border-radius: 12px !important;
	overflow: visible !important;
	font-family: Inter, Roboto, Arial, sans-serif !important;
}

/* Popup/Dropdown container */
.gtranslate_wrapper .gt_white_content,
.gt_white_content {
	border-radius: 12px !important;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
	border: none !important;
	padding: 8px 0 !important;
	background: #fff !important;
	z-index: 99999 !important;
}

/* Language links */
.gtranslate_wrapper .gt_white_content a,
.gt_white_content a {
	display: flex !important;
	align-items: center !important;
	padding: 12px 20px !important;
	color: #333 !important;
	text-decoration: none !important;
	font-size: 14px !important;
	transition: background 0.2s ease, color 0.2s ease !important;
}

.gtranslate_wrapper .gt_white_content a:hover,
.gt_white_content a:hover {
	background-color: #f8f9fa !important;
	color: var(--gtranslate-primary) !important;
}

/* Trigger button (EN / VI) – bo góc, bóng nhẹ */
.gtranslate_wrapper a.glink,
.gtranslate_wrapper .gt_selector {
	border-radius: 12px !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* Ẩn "Powered by Google" nếu có */
.gtranslate_wrapper .gt-powered-by,
.gt_container--cgxkb .gt-powered-by {
	display: none !important;
}

@media (max-width: 768px) {
	.gtranslate_wrapper {
		width: 100% !important;
		max-width: 100% !important;
	}

	.gtranslate_wrapper .gt_white_content a,
	.gt_white_content a {
		padding: 15px 20px !important;
		font-size: 16px !important;
		min-height: 48px !important;
		align-items: center !important;
		justify-content: center !important;
	}

	.gtranslate_wrapper a.glink,
	.gtranslate_wrapper .gt_selector {
		min-height: 44px !important;
		padding: 12px 16px !important;
	}
}