/* ==========================================================================
   HEADER – Flatsome header: logo, HTML 1 ("AndGain Asia"), menu, HTML 2 [ag_lang_switch], HTML 3 [ag_header_cta]
   1. Desktop
   2. Scrolled (sticky) state
   3. Mobile header
   4. Mobile menu overlay (Flatsome off-canvas #main-menu)
   ========================================================================== */

/* 1. Desktop ---------------------------------------------------------------- */
#header .header-main { border-bottom: 1px solid rgba(255, 255, 255, .17); }
#header.transparent .header-wrapper:not(.stuck) .header-bg-color {
	background: linear-gradient(180deg, rgba(0, 0, 0, .52), transparent) !important;
}
#header .header-main .container { padding: 0 clamp(24px, 4vw, 68px); }
#header, #header .nav > li > a, #header .header-button .button { font-family: var(--ag-font); }

/* Logo: official AndGain Asia logo (horizontal, white) – Customizer › Header › Logo */
#header #logo { width: auto !important; }
#header #logo img { width: auto !important; height: 44px !important; max-height: none; }
#header .ag-brand { margin-left: -14px; white-space: nowrap; font-size: 19px; letter-spacing: -.03em; font-weight: 700; color: #fff; }
#header .ag-brand b { color: var(--ag-red); }

/* Menu links: spacing comes from Theme Options › Header › Main Menu
   (Nav Spacing / Nav Height / Uppercase). Only the type is set here. */
#header .header-nav-main > li.menu-item > a {
	font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #fff; opacity: .7;
}
/* As in the original: no "current page" highlight – links turn red on hover only */
#header .header-nav-main > li.menu-item.active > a,
#header .header-nav-main > li.menu-item.current-menu-item > a { opacity: .7; color: #fff; }
#header .header-nav-main > li.menu-item > a:hover { opacity: 1; color: var(--ag-red); }

.ag-lang { display: flex; align-items: center; gap: 7px; font-size: 10px; letter-spacing: .1em; font-weight: 800; color: #fff; }
#header .header-nav-main .ag-lang { margin-left: 22px; }
.ag-lang span { color: var(--ag-red); padding: 5px 2px; border-bottom: 1px solid var(--ag-red); }
.ag-lang a { padding: 5px 2px; opacity: .62; color: #fff; }
.ag-lang a:hover { opacity: 1; color: #fff; }

/* CTA: divider line + space before the text */
#header .header-nav-main .ag-header-cta {
	display: inline-block; margin-left: 22px; padding: 0 0 0 28px; line-height: 19px;
	border-left: 1px solid rgba(255, 255, 255, .35);
	font-size: 12px; font-weight: 700; letter-spacing: 0; color: #fff;
}
#header .header-nav-main .ag-header-cta:hover { color: var(--ag-red); }
#header .ag-header-cta:after { content: "↗"; color: var(--ag-red); margin-left: 8px; }

/* 2. Scrolled ----------------------------------------------------------------- */
#header .header-wrapper.stuck { box-shadow: none; }
#header .header-wrapper.stuck .header-bg-color {
	background: rgba(8, 8, 8, .94) !important; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}

/* 3. Mobile header ------------------------------------------------------------- */
#header .mobile-nav li.html_topbar_left { display: flex !important; align-items: center; }
#header .mobile-nav li.html_topbar_right { display: flex !important; align-items: center; margin-right: 6px; }
#header .mobile-nav .ag-lang { margin-left: 0; gap: 10px; font-size: 9px; }

/* Hamburger: two thin lines, turns into an X while the menu is open */
#header [data-open="#main-menu"] { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; color: #fff; }
/* Flatsome hides the clicked trigger (.current-lightbox-clicked: opacity 0, translateX) – keep it visible as the close (X) button */
#header [data-open="#main-menu"], #header [data-open="#main-menu"].current-lightbox-clicked { opacity: 1 !important; transform: none !important; visibility: visible !important; }
#header [data-open="#main-menu"] .icon-menu { position: relative; width: 21px; height: 8px; font-size: 0; }
#header [data-open="#main-menu"] .icon-menu:before,
#header [data-open="#main-menu"] .icon-menu:after {
	content: ""; position: absolute; left: 0; width: 100%; height: 1px; background: #fff; transition: transform .3s ease;
}
#header [data-open="#main-menu"] .icon-menu:before { top: 0; }
#header [data-open="#main-menu"] .icon-menu:after { bottom: 0; }
html.has-off-canvas #header [data-open="#main-menu"] .icon-menu:before { transform: translateY(3.5px) rotate(45deg); }
html.has-off-canvas #header [data-open="#main-menu"] .icon-menu:after { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 849px) {
	#header .header-main, #header.transparent .header-main { height: 52px; }
	#header #logo img { height: 34px !important; }
	#header .ag-brand { margin-left: -4px; font-size: 18px; }
	#header .header-main .container { padding: 0 22px; }
}
@media (max-width: 700px) {
	#header .header-main .container { padding: 0 15px; }
	#header #logo img { height: 30px !important; }
	#header .ag-brand { margin-left: -6px; font-size: 15px; letter-spacing: -.03em; }
}

/* 4. Mobile menu overlay ------------------------------------------------------- */
/* Keep the header (brand, language, X) above the overlay while it is open */
html.has-off-canvas #header { z-index: 1044; }
html.has-off-canvas #header .header-bg-color { background: transparent !important; }
html.has-off-canvas #header .header-main { border-bottom-color: transparent; }

.main-menu-overlay.mfp-bg { background: rgba(8, 8, 8, .98); opacity: 1 !important; }
.off-canvas .mfp-close { display: none; }
.off-canvas .mfp-content .mobile-sidebar#main-menu {
	width: 100% !important; max-width: none; height: 100%;
	padding: clamp(82px, 14vh, 145px) clamp(20px, 7vw, 72px) 24px;
	background: transparent; box-shadow: none; color: #fff;
}
.off-canvas .mfp-content { width: 100% !important; max-width: none; background: transparent !important; box-shadow: none; }
.off-canvas-left .mfp-content { transform: none !important; }
.off-canvas-left.mfp-ready .mfp-content, .off-canvas-left .mfp-content { opacity: 1; }

#main-menu .sidebar-menu { padding: 0; }
#main-menu .nav-sidebar { display: flex; flex-direction: column; border-top: 1px solid rgba(255, 255, 255, .25); }
#main-menu .nav-sidebar > li { margin: 0; border: 0 !important; }
#main-menu .nav-sidebar > li.menu-item > a {
	display: flex; align-items: center; justify-content: space-between;
	padding: 17px 0; border-bottom: 1px solid rgba(255, 255, 255, .16);
	font-family: var(--ag-font); font-size: clamp(21px, 4vw, 32px); font-weight: 800; letter-spacing: -.035em;
	text-transform: none; color: #fff;
}
#main-menu .nav-sidebar > li.menu-item > a:after { content: "↗"; color: var(--ag-red); font-size: 15px; }
#main-menu .nav-sidebar > li.menu-item.active > a, #main-menu .nav-sidebar > li.menu-item.current-menu-item > a { color: #fff; }
#main-menu .nav-sidebar > li.menu-item > a:hover { color: var(--ag-red); }

#main-menu .nav-sidebar > li.html { display: block; padding: 0; border: 0; }
#main-menu .ag-header-cta {
	display: flex; align-items: center; justify-content: space-between; width: 100%;
	margin: 28px 0 0; padding: 18px 19px; background: #fff; color: #111;
	font-family: var(--ag-font); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
}
#main-menu .ag-header-cta:after { content: "↗"; color: var(--ag-red); }

@media (max-width: 480px) {
	.off-canvas .mfp-content .mobile-sidebar#main-menu { padding: 82px 20px 24px; }
	#main-menu .nav-sidebar > li.menu-item > a { padding: 14px 0; font-size: 22px; }
	#main-menu .ag-header-cta { margin-top: 18px; padding: 15px 16px; }
}
