/* ==========================================================================
   MaxCover — header viết lại từ đầu (quyết định D4).
   Không kế thừa markup hay CSS của theme cũ. Toàn bộ selector prefix .mc-.
   Layout bằng CSS Grid. Breakpoint desktop 1000px.
   ========================================================================== */

.mc-topbar {
	background: var(--mc-navy-deep);
	color: #cbd5e1;
	font-size: 13px;
	text-align: center;
	padding: 7px 0;
}

.mc-topbar a {
	color: #fff;
	text-decoration: none;
}

.mc-header {
	position: relative;
	background: var(--mc-white);
	box-shadow: 0 2px 16px rgba(12, 30, 64, .08);
	z-index: 900;
}

.mc-header-bar {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 24px;
	min-height: var(--mc-header-h);
}

.mc-brand {
	display: flex;
	align-items: center;
}

.mc-brand a {
	display: flex;
	align-items: center;
	text-decoration: none;
}

.mc-brand img {
	display: block;
	max-height: 45px;
	width: auto;
}

.mc-brand-text {
	font-size: 21px;
	font-weight: 800;
	color: var(--mc-navy);
	letter-spacing: -.3px;
}

/* --- Desktop nav -------------------------------------------------------- */
.mc-nav {
	display: none;
}

.mc-nav-list {
	display: flex;
	align-items: center;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mc-nav-list > li {
	position: relative;
}

.mc-nav-list > li > a {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	font-size: 15px;
	line-height: 1;
	color: var(--mc-navy);
	text-decoration: none;
	padding: 14px 13px;
	white-space: nowrap;
	background: none;
	border: none;
	cursor: pointer;
	font-family: inherit;
}

.mc-nav-list > li > a::after {
	content: '';
	position: absolute;
	left: 13px;
	right: 13px;
	bottom: 6px;
	height: 2px;
	background: var(--mc-blue);
	transform: scaleX(0);
	transition: transform .22s ease;
}

.mc-nav-list > li > a:hover::after,
.mc-nav-item-open > a::after {
	transform: scaleX(1);
}

.mc-nav-caret {
	transition: transform .22s ease;
	flex: 0 0 auto;
}

.mc-nav-item-open > a .mc-nav-caret {
	transform: rotate(180deg);
}

/* --- Mega panel ---------------------------------------------------------
   Bo cuc theo ban HTML da chot: panel rong ~70em, cot trai co the chua
   nhieu NHOM xep chong (Personal Insurance + Insurance by Industry),
   cot promo la anh 4:3 co gach vang duoi anh roi tieu de canh giua.
   -------------------------------------------------------------------------- */
.mc-mega {
	position: absolute;
	top: 100%;
	left: 0;
	display: none;
	grid-template-columns: repeat(var(--mc-mega-cols, 3), minmax(190px, 1fr));
	width: max-content;
	max-width: min(58em, calc(100vw - 40px));
	min-width: 560px;
	background: var(--mc-white);
	border-radius: 0 0 var(--mc-radius-lg) var(--mc-radius-lg);
	box-shadow: 0 18px 48px rgba(12, 30, 64, .16);
	padding: 0;
	margin: 0;
	list-style: none;
	overflow: hidden;
}

/* Cot promo hep hon cot link — anh chi la minh hoa, khong phai nhan vat chinh. */
.mc-mega:has(> .mc-mega-promo) {
	grid-template-columns: repeat(calc(var(--mc-mega-cols, 3) - 1), minmax(200px, 1fr)) minmax(210px, .8fr);
}

.mc-nav-item-open > .mc-mega {
	display: grid;
}

/*
 * Panel neo theo thanh nav chu khong theo tung muc: neo theo muc thi panel
 * rong 70em cua "About Maxcover" hay "Contact" se tran ra ngoai man hinh.
 * Ban HTML goc cung dat panel bat dau o mep trai vung nav.
 */
.mc-nav {
	position: relative;
}

.mc-nav-list > li {
	position: static;
}

.mc-mega {
	left: 0;
	right: auto;
}

.mc-mega-col {
	padding: 30px;
	list-style: none;
}

.mc-mega-icon {
	display: block;
	color: var(--mc-blue);
	line-height: 0;
	margin: 0 0 14px;
}

.mc-mega-links .mc-mega-col-title,
.mc-mega-links .mc-mega-group-title,
.mc-mega-col > .mc-mega-col-title,
.mc-mega-col-title,
.mc-mega-group-title {
	display: block;
	font-weight: 700;
	font-size: 15px;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	color: var(--mc-navy);
	text-decoration: none;
	margin: 0 0 12px;
	padding: 0;
}

.mc-mega-links .mc-mega-col-title:hover,
.mc-mega-links .mc-mega-group-title:hover,
.mc-mega-col-title:hover,
.mc-mega-group-title:hover {
	color: var(--mc-blue);
}

/* Nhom thu hai tro di trong cung mot cot can khoang cach voi nhom truoc. */
.mc-mega-group {
	list-style: none;
}

.mc-mega-group + .mc-mega-group {
	margin-top: 30px;
}

.mc-mega-links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mc-mega-links a {
	display: block;
	font-weight: 400;
	font-size: 15px;
	line-height: 1.35;
	color: #172a4c;
	text-decoration: none;
	padding: 6px 0;
}

.mc-mega-links a:hover {
	color: var(--mc-blue);
}

/* "See All" co dau cong tron dang truoc, dung nhu ban goc. */
.mc-mega-links .mc-mega-seeall a {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: var(--mc-blue);
	margin-top: 4px;
}

.mc-mega-links .mc-mega-seeall a::before {
	content: "";
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	border-radius: 50%;
	background:
		linear-gradient(var(--mc-white), var(--mc-white)) center / 7px 1.5px no-repeat,
		linear-gradient(var(--mc-white), var(--mc-white)) center / 1.5px 7px no-repeat,
		var(--mc-blue);
}

/* Cot promo — anh + gach vang + tieu de canh giua, tu metabox nav menu item. */
.mc-mega-promo {
	padding: 0;
	list-style: none;
	background: var(--mc-bg-soft);
}

.mc-mega-promo a {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
}

.mc-mega-promo-media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	max-height: 160px;
	background: var(--mc-bg-soft);
	border-bottom: 3px solid var(--mc-gold);
}

.mc-mega-promo-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .6s ease;
}

.mc-mega-promo a:hover .mc-mega-promo-media img {
	transform: scale(1.06);
}

.mc-mega-promo-title {
	font-weight: 700;
	font-size: 15px;
	line-height: 1.3;
	color: var(--mc-navy);
	text-align: center;
	margin: 0;
	padding: 14px 18px 0;
}

.mc-mega-promo a:hover .mc-mega-promo-title {
	color: var(--mc-blue);
}

.mc-mega-promo-desc {
	font-size: 13px;
	line-height: 1.45;
	color: var(--mc-muted);
	text-align: center;
	margin: 0;
	padding: 5px 18px 18px;
}

/* --- Hotline + CTA + lang ---------------------------------------------- */
.mc-header-actions {
	display: flex;
	align-items: center;
	gap: 14px;
}

.mc-hotline {
	display: none;
	align-items: center;
	gap: 6px;
	font-weight: 700;
	font-size: 15px;
	line-height: 1;
	color: var(--mc-navy);
	text-decoration: none;
	padding: 8px 10px;
	white-space: nowrap;
}

.mc-hotline:hover {
	color: var(--mc-blue);
}

.mc-header-cta {
	display: none;
}

/* --- Mobile ------------------------------------------------------------- */
.mc-burger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: transparent;
	border: none;
	cursor: pointer;
	color: var(--mc-navy);
	padding: 0;
}

.mc-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: 88vw;
	max-width: 380px;
	background: var(--mc-white);
	transform: translateX(100%);
	transition: transform .3s cubic-bezier(.4, 0, .2, 1);
	z-index: 9999;
	overflow-y: auto;
	padding: 18px 20px 40px;
}

.mc-drawer.is-open {
	transform: translateX(0);
}

.mc-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.mc-drawer-close {
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: var(--mc-navy);
	cursor: pointer;
	padding: 6px 10px;
}

.mc-drawer-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(2, 19, 82, .5);
	opacity: 0;
	pointer-events: none;
	transition: opacity .3s ease;
	z-index: 9998;
}

.mc-drawer-backdrop.is-open {
	opacity: 1;
	pointer-events: auto;
}

.mc-drawer-list,
.mc-drawer-sub {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mc-drawer-list a {
	display: block;
	padding: 13px 4px;
	font-weight: 600;
	font-size: 15.5px;
	color: var(--mc-navy);
	text-decoration: none;
	border-bottom: 1px solid var(--mc-line);
}

.mc-drawer-toggle {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	background: none;
	border: none;
	border-bottom: 1px solid var(--mc-line);
	padding: 13px 4px;
	font-weight: 700;
	font-size: 15.5px;
	color: var(--mc-navy);
	cursor: pointer;
	font-family: inherit;
	text-align: left;
}

.mc-drawer-toggle .mc-nav-caret {
	flex: 0 0 auto;
}

.mc-drawer-toggle[aria-expanded="true"] .mc-nav-caret {
	transform: rotate(180deg);
}

.mc-drawer-sub {
	display: none;
	padding-left: 14px;
}

.mc-drawer-sub.is-open {
	display: block;
}

.mc-drawer-sub a {
	font-weight: 500;
	font-size: 14.5px;
}

.mc-drawer-cta {
	margin-top: 18px;
}

.mc-drawer-lang {
	margin-top: 16px;
}

body.mc-drawer-lock {
	overflow: hidden;
}

/* --- Desktop breakpoint ------------------------------------------------- */
@media (min-width: 1000px) {
	.mc-nav {
		display: block;
	}

	.mc-hotline {
		display: inline-flex;
	}

	.mc-header-cta {
		display: inline-flex;
	}

	.mc-burger {
		display: none;
	}

	.mc-drawer,
	.mc-drawer-backdrop {
		display: none;
	}
}

/* ==========================================================================
   Sticky header. Bản HTML gốc để thanh header position:fixed thông qua CSS
   của theme cũ; phần override đó đã bị loại nên dựng lại ở đây bằng sticky.
   ========================================================================== */
.mc-header {
	position: sticky;
	top: 0;
}

/* Topbar cuộn đi, chỉ thanh menu dính lại. */
.mc-topbar {
	position: relative;
	z-index: 901;
}

/* Thu gọn khi cuộn — khớp data-header-resize="1" của bản gốc. */
.mc-header.is-stuck {
	box-shadow: 0 4px 20px rgba(12, 30, 64, .14);
}

.mc-header.is-stuck .mc-header-bar {
	min-height: 66px;
}

.mc-header.is-stuck .mc-brand img {
	max-height: 36px;
}

.mc-header .mc-header-bar,
.mc-header .mc-brand img {
	transition: min-height .22s ease, max-height .22s ease;
}

/* admin bar không được đè lên header dính. */
.admin-bar .mc-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .mc-header {
		top: 46px;
	}
}

/* --------------------------------------------------------------------------
   Header tren mobile: logo sat le trai, toggle ngon ngu + burger sat le phai,
   ca ba canh giua theo chieu doc.
   -------------------------------------------------------------------------- */
@media (max-width: 999px) {
	.mc-header-bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		min-height: 62px;
		padding-top: 8px;
		padding-bottom: 8px;
	}

	.mc-brand {
		display: flex;
		align-items: center;
		margin-right: auto;
	}

	.mc-brand img {
		display: block;
		max-height: 34px;
		width: auto;
	}

	.mc-header-actions {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		gap: 10px;
		margin-left: auto;
	}

	/* Hotline + nut CTA chuyen vao drawer tren mobile. */
	.mc-header-actions .mc-hotline,
	.mc-header-actions .mc-cta-btn {
		display: none;
	}

	.lang-switch-item {
		margin: 0;
	}

	.mc-burger {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 auto;
		width: 40px;
		height: 40px;
		padding: 0;
		margin: 0;
		background: transparent;
		border: none;
		cursor: pointer;
	}

	/* Dau trang cua drawer: logo trai, nut dong phai. */
	.mc-drawer-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
	}

	.mc-drawer-head .mc-brand img {
		max-height: 30px;
	}
}
