/* =========================================================
   Phu Tung (KhoiAuto) - main.css
   Port nguyên màu sắc / typography / kích thước từ Additional CSS
   của theme Flatsome cũ + code mới cho header/footer/off-canvas
   để thay thế Flatsome (không dùng page builder).
   ========================================================= */

/* ---------- 1. Design tokens (giữ nguyên từ Flatsome) ---------- */
:root {
	--primary-color: #7d0101;
	--secondary-color: #5e0101;
	--success-color: #ff0000;
	--alert-color: #b20000;
	--text-color: #1d1515;
	--link-color: #7d0101;
	--link-hover-color: #8a1818;
	--header-top-bg: #000000;
	--header-main-bg: #ffffff;
	--zalo-blue: #0068ff;
	--body-bg: #ffffff;
	--footer-bg: #020101;
	--container-width: 1250px;
	--header-height: 91px;
	--header-height-mobile: 70px;
	--header-height-stuck: 70px;
	--offcanvas-width: 300px;
	--offcanvas-cart-width: 360px;
	--font-main: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, sans-serif;
	--font-alt: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
	background-color: var(--body-bg);
	color: var(--text-color);
	font-family: var(--font-main);
	font-size: 115%;
}

@media screen and (max-width: 549px) {
	html, body { font-size: 105%; }
}

body {
	font-weight: 400;
}

h1, h2, h3, h4, h5, h6, .heading-font {
	font-family: var(--font-main);
	font-weight: 700;
	color: var(--text-color);
	text-transform: none;
}

a { color: var(--link-color); }
a:hover { color: var(--link-hover-color); }

.alt-font {
	font-family: var(--font-alt);
	font-weight: 400;
}

button, .button, .nav > li > a, .links > li > a, .section-title span,
h3.widget-title, span.widget-title, .breadcrumbs {
	text-transform: none;
}

.container, .row, .container-width {
	max-width: var(--container-width);
	margin-left: auto;
	margin-right: auto;
	padding-left: 15px;
	padding-right: 15px;
	box-sizing: border-box;
}

.row.row-collapse { max-width: 1220px; }
.row.row-small { max-width: 1242.5px; }
.row.row-large { max-width: 1280px; }

/* ẩn nút "Cập nhật giỏ hàng" mặc định của WooCommerce (auto-update qua AJAX) */
button[name="update_cart"] { display: none; }

/* nhãn phổ biến trong menu (không dùng hiện tại nhưng giữ để tương thích nội dung cũ) */
.label-new.menu-item > a:after { content: "Mới"; }
.label-hot.menu-item > a:after { content: "Nổi bật"; }
.label-sale.menu-item > a:after { content: "Giảm giá"; }
.label-popular.menu-item > a:after { content: "Phổ biến"; }

/* ---------- 2. Reset khung Astra để nhường chỗ cho header/footer tự code ---------- */
#ast-mobile-header, .ast-header-break-point, .site-header.ast-header-break-point { display: none !important; }
.ast-container { max-width: var(--container-width); }

/* ---------- 3. Header ----------
   Header dùng NGUYÊN VĂN CSS gốc "khoiauto-header.css" của theme Flatsome cũ
   (nạp trực tiếp từ /wp-content/themes/phutungdoxe/assets/ - xem
   phutung_enqueue_legacy_css() trong functions.php), không viết lại bằng tay,
   để đảm bảo khớp 100% màu sắc/kích thước/bo góc với bản gốc. Toàn bộ class
   .ka-header-exact / .ka-top-exact / .ka-main-exact / .ka-logo-exact /
   .ka-vertical-exact / .ka-search-exact / .ka-hotline-exact / .ka-zalo-exact
   được style bởi file đó. Phần dưới đây CHỈ LÀ những điều chỉnh nhỏ cần thiết
   vì kiến trúc menu mobile của mình khác bản gốc (off-canvas dùng chung 1 nút
   cho cả desktop/mobile, thay vì dropdown hover + menu mobile riêng của
   Flatsome). */
.site-header { position: relative; z-index: 500; }

/* Bản gốc ẩn nút "DANH MỤC" (.ka-vertical-exact) dưới 900px vì Flatsome có
   một hamburger menu mobile RIÊNG nằm ngoài header này. Theme mình không có
   cơ chế đó - nút DANH MỤC là cách DUY NHẤT mở menu, nên phải giữ hiển thị. */
@media (max-width: 900px) {
	.ka-vertical-exact { display: block !important; }
}

/* ---------- 4. Off-canvas panels (menu mobile / giỏ hàng / tìm kiếm) ---------- */
.offcanvas-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.55);
	z-index: 900;
	display: none;
}
body.offcanvas-open .offcanvas-overlay { display: block; }

.offcanvas-panel {
	position: fixed;
	top: 0;
	bottom: 0;
	background: #ffffff;
	z-index: 950;
	box-shadow: 0 0 24px rgba(0,0,0,.25);
	transition: transform .3s ease;
	overflow-y: auto;
}
.offcanvas-panel-inner { padding: 20px; position: relative; }
.offcanvas-close {
	position: absolute;
	top: 10px;
	right: 10px;
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: var(--text-color);
}

.offcanvas-left {
	left: 0;
	width: var(--offcanvas-width);
	max-width: 85vw;
	transform: translateX(-100%);
}
body.offcanvas-open .offcanvas-left.is-active { transform: translateX(0); }

.offcanvas-right {
	right: 0;
	width: var(--offcanvas-width);
	max-width: 85vw;
	transform: translateX(100%);
}
.offcanvas-right.offcanvas-cart { width: var(--offcanvas-cart-width); }
body.offcanvas-open .offcanvas-right.is-active { transform: translateX(0); }

.offcanvas-top {
	left: 0;
	right: 0;
	top: 0;
	height: auto;
	transform: translateY(-100%);
}
body.offcanvas-open .offcanvas-top.is-active { transform: translateY(0); }

.nav-sidebar.nav-vertical { list-style: none; margin: 40px 0 0; padding: 0; }
.nav-sidebar .menu-item-mobile { border-bottom: 1px solid #eee; position: relative; }
.nav-sidebar .menu-item-mobile > a { display: block; padding: 12px 30px 12px 0; color: var(--text-color); font-weight: 700; }
.nav-sidebar-toggle {
	position: absolute;
	right: 0;
	top: 4px;
	width: 32px;
	height: 32px;
	background: none;
	border: none;
	font-size: 18px;
	cursor: pointer;
}
.nav-sidebar-sub { list-style: none; margin: 0 0 8px; padding: 0 0 0 12px; display: none; }
.menu-item-mobile.is-open > .nav-sidebar-sub { display: block; }
.nav-sidebar-sub li a { display: block; padding: 8px 0; color: var(--text-color); font-weight: 400; }

.cart-toggle-inline {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	background: none;
	border: none;
	padding: 12px 30px 12px 0;
	font-family: var(--font-main);
	font-weight: 700;
	font-size: 15px;
	color: var(--text-color);
	cursor: pointer;
	text-align: left;
}
.cart-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	background: var(--alert-color);
	color: #ffffff;
	border-radius: 50%;
	font-size: 11px;
	font-weight: 700;
}

.offcanvas-cart-title { margin-top: 30px; }
.widget_shopping_cart_content .woocommerce-mini-cart { list-style: none; margin: 0; padding: 0; }
.widget_shopping_cart_content .woocommerce-mini-cart-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid #eee; position: relative; }
.widget_shopping_cart_content img { width: 60px; height: auto; }
.widget_shopping_cart_content .total { font-weight: 700; margin-top: 14px; }
.widget_shopping_cart_content .buttons { display: flex; gap: 10px; margin-top: 14px; }
.widget_shopping_cart_content .buttons a {
	flex: 1;
	text-align: center;
	padding: 10px;
	border-radius: 4px;
	font-weight: 700;
}
.widget_shopping_cart_content a.wc-forward.checkout { background: var(--primary-color); color: #fff; }
.widget_shopping_cart_content a.wc-forward:not(.checkout) { background: #f1f1f1; color: var(--text-color); }

/* ---------- 5. Footer ---------- */
.site-footer {
	background-color: var(--footer-bg);
	color: #ffffff;
	padding-top: 40px;
}
.site-footer a { color: #dcdcdc; }
.site-footer a:hover { color: #ffffff; }
.footer-inner {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 30px;
	padding-bottom: 30px;
}
@media (max-width: 849px) {
	.footer-inner { grid-template-columns: 1fr; }
}
.footer-heading {
	color: #ffffff;
	font-size: 16px;
	margin-bottom: 14px;
	text-transform: uppercase;
}
.footer-col p { margin: 0 0 8px; font-size: 13px; line-height: 1.6; color: #cfcfcf; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col ul li { margin-bottom: 8px; font-size: 14px; }
.footer-badge { max-width: 140px; height: auto; margin-top: 14px; }
.footer-bottom {
	border-top: 1px solid rgba(255,255,255,.12);
	padding: 16px 0;
	text-align: center;
}
.footer-bottom p { margin: 0; font-size: 12px; color: #a8a8a8; }

/* ---------- 6. Product grid / box-image (giữ đúng bề rộng ảnh sản phẩm) ---------- */
@media screen and (min-width: 550px) {
	.products .box-vertical .box-image { min-width: 247px !important; width: 247px !important; }
}
