/*
 * AGTEK — header, mega menu, drawer, footer (toàn site).
 * Bố cục/khoảng cách/cỡ chữ tham chiếu store.dji.com (đo getComputedStyle 25/09/2026), mã viết mới, nhận diện AGTEK.
 */
:root {
	--dj-font: "Open Sans", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--dj-text: #3b3e40;
	--dj-head: rgba(0, 0, 0, .85);
	--dj-muted: rgba(0, 0, 0, .65);
	--dj-sub: #6c7073;
	--dj-line: rgba(0, 0, 0, .06);
	--dj-line-2: #e6e8eb;
	--dj-bg: #f0f1f2;
	--dj-soft: #f7f9fa;
	--dj-card: #f5f5f5;
	--dj-blue: #0060ef;
	--dj-blue-soft: #eef3fe;
	--dj-black: #222;
	--dj-red: #e02020;
	--dj-orange: #c2570c;
	--dj-wrap: 1200px;
	--dj-gutter: 32px;
}
@media (max-width: 767px) { :root { --dj-gutter: 16px; } }

/* Font toàn site (thay Quicksand của Flatsome). Nội dung sản phẩm cũ giữ font riêng trong template cũ. */
body.ag-site, body.ag-site h1, body.ag-site h2, body.ag-site h3, body.ag-site h4, body.ag-site h5, body.ag-site h6,
body.ag-site .heading-font, body.ag-site button, body.ag-site input, body.ag-site select, body.ag-site textarea { font-family: var(--dj-font); }
body.ag-site { color: var(--dj-text); }

.ag-hwrap, .ag-fwrap { max-width: calc(var(--dj-wrap) + 2 * var(--dj-gutter)); margin: 0 auto; padding: 0 var(--dj-gutter); }
.ag-i { display: inline-block; vertical-align: middle; flex: 0 0 auto; }

/* ---------- Header ---------- */
.ag-header { position: relative; z-index: 200; background: #fff; font-family: var(--dj-font); }
.ag-header a { text-decoration: none; }
.ag-utility { position: relative; z-index: 2; background: var(--dj-soft); font-size: 12px; line-height: 18px; color: var(--dj-muted); } /* trên thanh menu chính (trang chủ: thanh menu position absolute) để dropdown "Thêm" không bị che */
.ag-utility__inner { display: flex; align-items: center; justify-content: space-between; height: 40px; }
.ag-utility__links, .ag-utility__contact { display: flex; align-items: center; gap: 0; }
.ag-utility__links { align-self: stretch; }
.ag-utility a, .ag-utility button { color: var(--dj-muted); font-size: 12px; padding: 0 12px; background: none; border: 0; margin: 0; line-height: 18px; min-height: 0; text-transform: none; letter-spacing: 0; font-weight: 400; cursor: pointer; }
.ag-utility__links > a:first-child { padding-left: 0; }
.ag-utility__links > a + a, .ag-utility__links > a + .ag-utility__more { border-left: 1px solid var(--dj-line-2); }
.ag-utility__contact a { display: inline-flex; align-items: center; gap: 6px; padding-right: 0; }
.ag-utility__contact .ag-i { width: 14px; height: 14px; }
.ag-utility a:hover, .ag-utility button:hover { color: #000; }
/* Vùng rê chuột cao bằng cả thanh tiện ích và danh sách bám sát đáy vùng đó — không có khe hở giữa nút và danh sách (khe hở làm
   dropdown đóng rồi chuột rơi xuống menu chính, mở mega menu). */
.ag-utility__more { position: relative; display: flex; align-items: center; align-self: stretch; }
.ag-utility__more .ag-i { width: 12px; height: 12px; margin-left: 2px; }
.ag-utility__more ul { position: absolute; top: calc(100% - 4px); left: 0; z-index: 10; min-width: 160px; margin: 0; padding: 8px 0; list-style: none; background: #fff; border-radius: 4px; box-shadow: 0 4px 16px rgba(0, 0, 0, .12); }
.ag-utility__more li { margin: 0; }
.ag-utility__more ul a { display: block; padding: 8px 16px; }

.ag-bar { position: relative; background: #fff; border-bottom: 1px solid var(--dj-line); }
.ag-bar__inner { display: flex; align-items: center; height: 64px; }
.ag-logo { display: flex; align-items: center; flex: 0 0 auto; margin-right: 48px; }
.ag-logo__img { height: 32px; width: auto; max-width: 150px; object-fit: contain; }
.ag-nav { flex: 1 1 auto; min-width: 0; height: 100%; }
.ag-nav__list { display: flex; height: 100%; margin: 0; padding: 0; list-style: none; }
.ag-nav__item { margin: 0 32px 0 0; height: 100%; display: flex; }
.ag-nav__link {
	display: flex; align-items: center; height: 64px; padding: 0; margin: 0; background: none; border: 0; border-bottom: 2px solid transparent;
	font-size: 14px; line-height: 20px; font-weight: 400; color: var(--dj-head); white-space: nowrap; cursor: pointer; text-transform: none; letter-spacing: 0; min-height: 0;
}
.ag-nav__link:hover, .ag-nav__item.is-open > .ag-nav__link, .ag-nav__item.is-current > .ag-nav__link { color: #000; border-bottom-color: #000; }
.ag-bar__tools { display: flex; align-items: center; gap: 20px; margin-left: 24px; }
.ag-bar__icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; margin: 0; background: none; border: 0; color: var(--dj-head); cursor: pointer; min-height: 0; }
.ag-bar__icon .ag-i { width: 22px; height: 22px; }
.ag-bar__badge { position: absolute; top: -4px; right: -6px; min-width: 8px; height: 8px; border-radius: 4px; background: var(--dj-blue); }
.ag-bar__burger { display: none; margin-right: 12px; }

/* Mega menu */
.ag-mega { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-top: 1px solid var(--dj-line); max-height: calc(100vh - 110px); overflow-y: auto; box-shadow: 0 16px 24px rgba(0, 0, 0, .06); }
.ag-mega__inner { position: relative; display: flex; gap: 40px; padding-top: 32px; padding-bottom: 40px; }
.ag-mega__close { position: absolute; top: 24px; right: var(--dj-gutter); width: 32px; height: 32px; padding: 0; margin: 0; background: none; border: 0; color: #000; cursor: pointer; min-height: 0; }
.ag-mega__close .ag-i { width: 24px; height: 24px; }
.ag-mega__rail { flex: 0 0 260px; }
.ag-mega__rail ul { list-style: none; margin: 0 0 16px; padding: 0; }
.ag-mega__rail li { margin: 0; }
.ag-mega__group { margin: 0 0 8px; font-size: 12px; line-height: 18px; color: var(--dj-sub); }
.ag-mega__series { display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin: 0 -12px; border-radius: 4px; color: var(--dj-head); font-size: 14px; }
.ag-mega__series img { width: 48px; height: 36px; object-fit: contain; }
.ag-mega__series.is-active, .ag-mega__series:hover { background: var(--dj-soft); color: #000; }
.ag-mega__extra a { display: block; padding: 6px 0; font-size: 14px; color: var(--dj-head); }
.ag-mega__all { display: inline-flex; align-items: center; gap: 2px; margin-top: 8px; font-size: 14px; color: var(--dj-blue); }
.ag-mega__all .ag-i { width: 14px; height: 14px; }
.ag-mega__panels { flex: 1 1 auto; min-width: 0; padding-right: 48px; }
.ag-mega__head { display: flex; align-items: baseline; gap: 16px; margin: 0 0 16px; }
.ag-mega__head span { font-size: 16px; font-weight: 600; color: var(--dj-head); }
.ag-mega__head a { display: inline-flex; align-items: center; font-size: 14px; color: var(--dj-text); }
.ag-mega__head .ag-i { width: 14px; height: 14px; }
.ag-mega__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ag-mega__hero, .ag-mega__tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; padding: 16px; background: var(--dj-card); color: var(--dj-head); text-align: center; }
.ag-mega__hero { grid-row: span 2; padding: 24px; }
.ag-mega__hero img { width: 100%; max-height: 260px; object-fit: contain; margin: auto 0 16px; }
.ag-mega__hero strong { font-size: 18px; font-weight: 400; }
.ag-mega__hero small { font-size: 12px; color: var(--dj-sub); }
.ag-mega__tile img { width: 100%; height: 120px; object-fit: contain; margin: auto 0 8px; }
.ag-mega__tile span:not(.ag-mega__arrow) { font-size: 12px; line-height: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ag-mega__tile--all { justify-content: center; }
/* Mỗi dòng: từng model (máy chính) + phụ kiện — như mega menu store.dji.com. Model đầu: ô lớn + 5 phụ kiện + "Xem tất cả";
   model sau: hàng 5 ô (máy + phụ kiện). */
.ag-mega__model + .ag-mega__model { margin-top: 32px; }
.ag-mega__model:not(.is-first) .ag-mega__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: none; }
.ag-mega__model:not(.is-first) .ag-mega__tile { min-height: 200px; }
.ag-mega__rail .ag-mega__group { margin: 16px 0 8px; list-style: none; }
.ag-mega__rail li.ag-mega__group:first-child { margin-top: 0; }
/* Xổ xuống: JS đổi chiều cao 0 → nội dung (0,3s) như store.dji.com; nội dung hiện dần. */
.ag-mega.is-animating { overflow: hidden; transition: height .3s ease; }
.ag-mega__inner { animation: ag-mega-in .3s ease both; }
@keyframes ag-mega-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ag-mega.is-animating { transition: none; } .ag-mega__inner { animation: none; } }
.ag-mega__arrow { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; background: #333; color: #fff; align-items: center; justify-content: center; margin-bottom: 4px; }
.ag-mega__arrow .ag-i { width: 18px; height: 18px; }
.ag-mega__hero:hover strong, .ag-mega__tile:hover span:not(.ag-mega__arrow) { color: var(--dj-blue); }
.ag-mega__cols { display: flex; flex-wrap: wrap; gap: 24px 64px; padding-right: 48px; }
.ag-mega__col ul { list-style: none; margin: 0; padding: 0; }
.ag-mega__col li { margin: 0; }
.ag-mega__col a, .ag-mega__link { display: block; padding: 6px 0; font-size: 14px; color: var(--dj-head); }
.ag-mega__col a:hover { color: var(--dj-blue); }
.ag-mega-backdrop { position: fixed; inset: 0; top: auto; z-index: -1; background: rgba(0, 0, 0, .35); }

/* Search */
/* Tìm kiếm như store.dji.com: ô nhập nằm ngay trong thanh menu 64px (che các mục menu), gợi ý trong bảng nổi 592px bên dưới. */
.ag-search { position: absolute; left: 0; right: 0; top: 0; z-index: 5; height: 100%; background: #fff; }
.ag-search > .ag-hwrap { position: relative; height: 100%; }
.ag-search__form { height: 100%; }
.ag-search__results { position: absolute; left: 50%; top: calc(100% + 16px); width: 592px; max-width: calc(100vw - 32px); max-height: calc(100vh - 180px); overflow-y: auto; transform: translateX(-50%); background: #fff; padding: 16px 0 !important; box-shadow: 0 4px 24px rgba(0, 0, 0, .12); }
.ag-search__results:empty { display: none; }
.ag-search__form { display: flex; align-items: center; gap: 12px; max-width: 592px; margin: 0 auto; padding: 4px 0; }
/* Ô tìm kiếm như store.dji.com: không viền, không bóng, không outline, chữ 16px. Flatsome đặt viền + box-shadow cho
   input[type=search] (và :focus) và nạp sau file này → dùng id để thắng. */
#ag-search-input, #ag-search-input:focus, #ag-search-input:hover { flex: 1 1 auto; height: 48px; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; outline: none; background: transparent; font-size: 16px; line-height: 24px; color: var(--dj-head); -webkit-appearance: none; appearance: none; }
#ag-search-input::placeholder { color: rgba(0, 0, 0, .45); }
#ag-search-input::-webkit-search-cancel-button, #ag-search-input::-webkit-search-decoration { -webkit-appearance: none; }
.ag-search__close { background: none; border: 0; padding: 4px; margin: 0; cursor: pointer; min-height: 0; color: #000; }
.ag-search__results { list-style: none; margin: 0; }
.ag-search__results li { margin: 0; }
.ag-search__results a { display: flex; align-items: center; gap: 12px; padding: 8px 32px; color: var(--dj-head); font-size: 14px; line-height: 20px; }
.ag-search__results a:hover, .ag-search__results a:focus { background: var(--dj-soft); color: var(--dj-head); outline: none; }
.ag-search__results img { width: 44px; height: 44px; object-fit: contain; background: var(--dj-card); }
.ag-search__results .ag-search__price { margin-left: auto; font-size: 13px; color: var(--dj-sub); white-space: nowrap; }
.ag-search__results .ag-search__type { font-size: 11px; color: var(--dj-sub); text-transform: uppercase; letter-spacing: .04em; }

/* Drawer (mobile) */
.ag-drawer { position: fixed; inset: 0; z-index: 2147483000; /* trên nút Zalo/gọi nổi của plugin */ background: #fff; overflow-y: auto; font-family: var(--dj-font); }
.ag-drawer__head { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 var(--dj-gutter); border-bottom: 1px solid var(--dj-line); }
.ag-drawer__nav ul { list-style: none; margin: 0; padding: 0; }
.ag-drawer__nav li { margin: 0; }
.ag-drawer__nav > ul > li { border-bottom: 1px solid var(--dj-line); }
.ag-drawer__nav summary, .ag-drawer__link { display: flex; align-items: center; justify-content: space-between; padding: 16px var(--dj-gutter); font-size: 16px; color: var(--dj-head); list-style: none; cursor: pointer; text-decoration: none; }
.ag-drawer__nav summary::-webkit-details-marker { display: none; }
.ag-drawer__nav details[open] summary .ag-i { transform: rotate(180deg); }
.ag-drawer__nav details ul { padding: 0 var(--dj-gutter) 12px; }
.ag-drawer__nav details a { display: block; padding: 10px 16px; font-size: 14px; color: var(--dj-text); text-decoration: none; }
.ag-drawer__all { color: var(--dj-blue) !important; }
.ag-drawer__utility { padding: 16px 0 32px !important; background: var(--dj-soft); }
.ag-drawer__utility a { display: flex; justify-content: space-between; align-items: center; padding: 12px var(--dj-gutter); font-size: 14px; color: var(--dj-text); text-decoration: none; }
body.ag-drawer-open { overflow: hidden; }

@media (max-width: 1279px) {
	.ag-nav__item { margin-right: 20px; }
	.ag-logo { margin-right: 28px; }
}
@media (max-width: 1199px) {
	.ag-utility, .ag-nav { display: none; }
	.ag-header { position: sticky; top: 0; }
	body.admin-bar .ag-header { top: 46px; }
	.ag-bar__inner { height: 56px; }
	.ag-bar__burger { display: inline-flex; }
	.ag-logo { margin: 0 auto 0 0; }
	.ag-logo__img { height: 28px; }
	.ag-bar__tools { gap: 16px; }
	.ag-bar__account { display: none; }
	.ag-search { position: absolute; top: 0; height: 56px; }
	.ag-search__results { position: fixed; left: 0; right: 0; top: 56px; bottom: 0; width: auto; max-width: none; max-height: none; transform: none; box-shadow: none; border-top: 1px solid var(--dj-line); }
}

/* Trang chủ có hero tràn màn hình (body.ag-home-overlay): thanh menu chính trong suốt đè lên hero, chữ/icon/logo trắng;
   rê chuột, focus, mở mega menu hoặc ô tìm kiếm → trở lại nền trắng (như store.dji.com). Chỉ desktop — mobile giữ header dính. */
@media (min-width: 1200px) {
	body.ag-home-overlay .ag-bar { position: absolute; left: 0; right: 0; top: 100%; background: transparent; border-bottom-color: transparent; transition: background-color .2s, border-color .2s; }
	body.ag-home-overlay .ag-bar:not(:hover):not(:focus-within):not(:has(.ag-nav__item.is-open)):not(:has(.ag-search:not([hidden]))) .ag-nav__link,
	body.ag-home-overlay .ag-bar:not(:hover):not(:focus-within):not(:has(.ag-nav__item.is-open)):not(:has(.ag-search:not([hidden]))) .ag-bar__icon { color: #fff; }
	body.ag-home-overlay .ag-bar:not(:hover):not(:focus-within):not(:has(.ag-nav__item.is-open)):not(:has(.ag-search:not([hidden]))) .ag-logo__img { filter: brightness(0) invert(1); }
	body.ag-home-overlay .ag-bar:not(:hover):not(:focus-within):not(:has(.ag-nav__item.is-open)):not(:has(.ag-search:not([hidden]))) .ag-nav__item.is-current > .ag-nav__link { border-bottom-color: transparent; }
	body.ag-home-overlay .ag-bar:hover, body.ag-home-overlay .ag-bar:focus-within, body.ag-home-overlay .ag-bar:has(.ag-nav__item.is-open), body.ag-home-overlay .ag-bar:has(.ag-search:not([hidden])) { background: #fff; border-bottom-color: var(--dj-line); }
}

/* ---------- Footer ---------- */
.ag-footer { background: #fff; color: var(--dj-text); font-family: var(--dj-font); font-size: 12px; line-height: 18px; border-top: 1px solid var(--dj-line); }
.ag-footer a { color: var(--dj-sub); text-decoration: none; }
.ag-footer a:hover { color: #000; }
/* Dải dịch vụ chân trang như store.dji.com: 3 cột bằng nhau, icon 48px, chữ 14/24 giữa, liên hệ là link xanh, kẻ dưới */
.ag-footer__usps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 48px 0; border-bottom: 1px solid var(--dj-line-2); text-align: center; }
.ag-footer__usps li { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ag-footer__usps img { width: 48px; height: 48px; }
.ag-footer__usps p { margin: 0; font-size: 14px; line-height: 24px; color: var(--dj-text); }
.ag-footer__usps a { color: var(--dj-blue); }
.ag-footer__usps a.ag-footer__usp-link { color: var(--dj-text); }
.ag-footer__usps a.ag-footer__usp-link:hover { color: var(--dj-blue); }
.ag-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px; padding: 72px 0 48px; }
.ag-footer__col { margin: 0; }
.ag-footer__col summary, .ag-footer__title { display: flex; justify-content: space-between; align-items: center; margin: 0 0 16px; font-size: 12px; font-weight: 600; color: var(--dj-text); list-style: none; cursor: default; }
.ag-footer__col summary::-webkit-details-marker { display: none; }
.ag-footer__col summary .ag-i { display: none; }
.ag-footer__col ul { list-style: none; margin: 0; padding: 0; }
.ag-footer__col li { margin: 0 0 8px; line-height: 24px; }
.ag-footer__contact { grid-column: span 2; max-width: 360px; }
.ag-footer__contact p { margin: 0 0 8px; color: var(--dj-sub); line-height: 20px; }
.ag-footer__brand { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 16px 0; border-bottom: 1px solid var(--dj-line-2); }
.ag-footer__logo img { height: 24px; width: auto; filter: grayscale(1); opacity: .8; }
.ag-footer__company, .ag-footer__social, .ag-footer__legal ul { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
.ag-footer__company li, .ag-footer__social li, .ag-footer__legal li { margin: 0; }
.ag-footer__company a { font-size: 12px; }
.ag-footer__social { margin-left: auto; gap: 16px; }
.ag-footer__social .ag-i { width: 18px; height: 18px; }
.ag-footer__legal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px; padding: 20px 0 40px; color: var(--dj-sub); }
.ag-footer__legal p { margin: 0; }
.ag-footer__legal li + li::before { content: "·"; margin-right: 8px; color: var(--dj-sub); }
.ag-footer__legal ul { gap: 8px; }

@media (max-width: 767px) {
	.ag-footer__usps { grid-template-columns: 1fr; gap: 24px; padding: 32px 0; }
	.ag-footer__cols { display: block; padding: 16px 0; }
	.ag-footer__col { border-bottom: 1px solid var(--dj-line-2); }
	.ag-footer__col summary { padding: 16px 0; margin: 0; cursor: pointer; font-size: 14px; }
	.ag-footer__col summary .ag-i { display: inline-block; }
	.ag-footer__col[open] summary .ag-i { transform: rotate(180deg); }
	.ag-footer__col ul { padding-bottom: 12px; }
	.ag-footer__contact { padding: 16px 0; border: 0; }
	.ag-footer__title { font-size: 14px; }
	.ag-footer__social { margin-left: 0; }
}

/* Ẩn phần tử header/footer Flatsome còn sót (nếu plugin nào đó in ra) */
body.ag-site #header.header, body.ag-site .footer-wrapper:not(.ag-footer) { display: none; }

/* Flatsome tô link bằng biến --fs-experimental-link-color (rê chuột: #1c75bc) và nạp sau file này → trong header, footer,
   drawer, cửa hàng: link giữ màu chữ như store.dji.com (color: currentColor = kế thừa); hiệu ứng rê chuột riêng của từng
   thành phần (vd tên SP chuyển xanh) vẫn giữ vì selector cụ thể hơn. */
.ag-header, .ag-footer, .ag-drawer, .ag-store { --fs-experimental-link-color: currentColor; --fs-experimental-link-color-hover: currentColor; }
/* currentColor ở thuộc tính color = màu phần tử cha → link có màu riêng bị ngả màu khi rê chuột: khoá lại. */
.ag-header a.ag-bar__icon:hover { color: #000; }
.ag-header a.ag-mega__hero:hover, .ag-header a.ag-mega__tile:hover, .ag-drawer a.ag-drawer__link:hover { color: var(--dj-head); }
.ag-header a.ag-mega__all:hover { color: var(--dj-blue); }
/* Link trong đoạn văn nội dung vẫn phải nhận ra được: xanh DJI, gạch chân khi rê chuột. */
.ag-store .ag-seo-content a, .ag-store .ag-content a, .ag-store .ag-faq a { color: var(--dj-blue); }
.ag-store .ag-seo-content a:hover, .ag-store .ag-content a:hover, .ag-store .ag-faq a:hover { color: var(--dj-blue); text-decoration: underline; }

/* "Tách nền trắng" ảnh SP trên ô nền xám như store.dji.com: multiply làm điểm ảnh trắng hoà vào màu nền (không sửa file ảnh). */
.ag-mega__hero img, .ag-mega__tile img, .ag-mega__series img, .ag-search__results img, .ag-navicons__img { mix-blend-mode: multiply; }

/* Thanh toán: header tối giản như checkout store.dji.com — chỉ logo (ẩn thanh tiện ích, menu, công cụ). */
body.ag-checkout-page .ag-utility, body.ag-checkout-page .ag-nav, body.ag-checkout-page .ag-bar__tools, body.ag-checkout-page .ag-bar__burger { display: none !important; }
body.ag-checkout-page .ag-bar__inner { height: 56px; }
body.ag-checkout-page .ag-footer__usps, body.ag-checkout-page .ag-footer__cols { display: none; }
body.ag-checkout-page #button-contact-vr { display: none; }
