/* ===== Chung ===== */
:root {
	--vxd-navy: #163a70;
	--vxd-navy-dark: #0e2a54;
	--vxd-red: #d32f2f;
}
.vxd-page-title {
	font-size: 28px;
	margin-bottom: 24px;
}
.vxd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 28px;
	border-radius: 6px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	border: none;
	font-size: 15px;
	transition: opacity .15s ease;
}
.vxd-btn:hover { opacity: .88; }
.vxd-btn-primary { background: var(--vxd-navy); color: #fff; }
.vxd-btn-outline { background: transparent; color: #e53935; border: 1px solid #e53935; }
.vxd-btn-consult { background: #fff; color: var(--vxd-navy); border: 1px solid var(--vxd-navy); }
.vxd-btn-block { width: 100%; text-align: center; }

/* ===== Trang sản phẩm (single) ===== */
.vxd-single-product {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 40px;
	max-width: 1100px;
	margin: 30px auto;
	padding: 0 20px;
}
.vxd-gallery,
.vxd-info {
	min-width: 0; /* chặn lỗi grid không co được khi con bên trong có nội dung rộng (vd: dãy thumbnail) */
}
.vxd-gallery-main {
	width: 100%;
	aspect-ratio: 1 / 1;
	background: #f5f5f5;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.vxd-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.vxd-gallery-main.vxd-no-image { color: #999; }
.vxd-gallery-thumbs {
	display: flex;
	gap: 10px;
	margin-top: 12px;
	flex-wrap: wrap;
}
.vxd-thumb {
	width: 70px;
	height: 70px;
	object-fit: cover;
	border-radius: 6px;
	cursor: pointer;
	border: 2px solid transparent;
	opacity: .7;
	flex-shrink: 0;
}
.vxd-thumb.is-active,
.vxd-thumb:hover { border-color: #e53935; opacity: 1; }

.vxd-product-title { font-size: 26px; margin: 0 0 12px; }
.vxd-product-price { font-size: 28px; color: #e53935; font-weight: 700; margin-bottom: 16px; }
.vxd-product-desc {
	color: #444;
	line-height: 1.6;
	margin-bottom: 22px;
	background: #f5f9ff;
	border: 1px solid #cfe0f5;
	border-radius: 10px;
	padding: 20px 10px;
}

.vxd-variant-options {
	display: flex;
	gap: 12px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}
.vxd-variant-option input { position: absolute; opacity: 0; }
.vxd-variant-box {
	display: block;
	border: 2px solid #ddd;
	border-radius: 8px;
	padding: 10px 18px;
	cursor: pointer;
	min-width: 140px;
	text-align: center;
}
.vxd-variant-name { display: block; font-weight: 600; color: #333; }
.vxd-variant-price { display: block; font-size: 14px; color: #999; margin-top: 4px; }
.vxd-variant-option input:checked + .vxd-variant-box {
	border-color: var(--vxd-navy);
	background: #fff;
}
.vxd-variant-option input:checked + .vxd-variant-box .vxd-variant-price {
	color: var(--vxd-navy);
	font-weight: 700;
}

.vxd-qty-addcart { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.vxd-qty-stepper { display: flex; align-items: stretch; border: 1px solid #ddd; border-radius: 6px; overflow: hidden; }
.vxd-qty-btn {
	background: #f5f5f5;
	border: none;
	width: 38px;
	font-size: 18px;
	cursor: pointer;
	color: #333;
}
.vxd-qty-btn:hover { background: #e9e9e9; }
.vxd-qty-input {
	width: 56px;
	padding: 10px 4px;
	border: none;
	border-left: 1px solid #ddd;
	border-right: 1px solid #ddd;
	text-align: center;
	-moz-appearance: textfield;
}
.vxd-qty-input::-webkit-outer-spin-button,
.vxd-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.vxd-btn-addcart svg { flex-shrink: 0; }
#vxd-addcart-message { margin-top: 12px; font-size: 14px; }

.vxd-action-buttons { display: flex; gap: 12px; margin-top: 14px; }
.vxd-action-buttons .vxd-btn { flex: 1; text-align: center; }
.vxd-btn-buynow { background: var(--vxd-red); color: #fff; }

/* ===== Trang danh sách (archive) ===== */
.vxd-archive-wrap { max-width: 1200px; margin: 30px auto; padding: 0 20px; }
.vxd-product-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}
.vxd-product-card {
	display: block;
	text-decoration: none;
	color: inherit;
	border: 1px solid #eee;
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow .15s ease;
}
.vxd-product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.vxd-card-image { aspect-ratio: 1 / 1; background: #f5f5f5; display: flex; align-items: center; justify-content: center; }
.vxd-card-image img { width: 100%; height: 100%; object-fit: cover; }
.vxd-no-image { color: #999; font-size: 13px; }
.vxd-card-body { padding: 14px; }
.vxd-card-title { font-size: 16px; margin: 0 0 8px; }
.vxd-card-price { color: #e53935; font-weight: 700; }
.vxd-pagination { margin-top: 30px; text-align: center; }

/* ===== Giỏ hàng ===== */
.vxd-cart-wrap { max-width: 900px; margin: 30px auto; padding: 0 20px; }
.vxd-cart-table { width: 100%; border-collapse: collapse; }
.vxd-cart-table th, .vxd-cart-table td { padding: 12px; border-bottom: 1px solid #eee; text-align: left; }
.vxd-cart-product { display: flex; align-items: center; gap: 12px; }
.vxd-cart-product img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.vxd-cart-qty { width: 60px; padding: 6px; border-radius: 4px; border: 1px solid #ddd; }
.vxd-cart-remove { background: none; border: none; font-size: 20px; color: #999; cursor: pointer; }
.vxd-cart-remove:hover { color: #e53935; }
.vxd-cart-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }
.vxd-cart-total { font-size: 18px; }
.vxd-empty-cart { margin-bottom: 20px; }

/* ===== Đặt hàng ===== */
.vxd-order-wrap { max-width: 900px; margin: 30px auto; padding: 0 20px; }
.vxd-order-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.vxd-order-summary { background: #fafafa; padding: 20px; border-radius: 8px; }
.vxd-order-summary ul { list-style: none; margin: 0 0 16px; padding: 0; }
.vxd-order-summary li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eee; }
.vxd-order-total { font-size: 17px; text-align: right; }
.vxd-order-form-box form p { margin-bottom: 14px; }
.vxd-order-form-box label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.vxd-order-form-box input, .vxd-order-form-box textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	box-sizing: border-box;
}
#vxd-order-message { margin-bottom: 14px; }
.vxd-msg-success { color: #2e7d32; padding: 10px; background: #edf7ed; border-radius: 6px; }
.vxd-msg-error { color: #c62828; padding: 10px; background: #fdecea; border-radius: 6px; }

/* ===== Hiệu ứng hover card (floatxd1) ===== */
.floatxd1 {
	border-radius: 10px;
	transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
				box-shadow 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	transform: translateY(0) scale(1);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	will-change: transform, box-shadow;
	cursor: pointer;
}
.floatxd1:hover {
	transform: translateY(-10px) scale(1.02);
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15),
				0 8px 16px rgba(0, 0, 0, 0.08);
}

/* ===== Card: ảnh đổi khi hover ===== */
.vxd-card-image { position: relative; aspect-ratio: 1 / 1; background: #f5f5f5; overflow: hidden; }
.vxd-card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vxd-card-img-default { opacity: 1; transition: opacity .35s ease; }
.vxd-card-img-hover { opacity: 0; transition: opacity .35s ease; }
.vxd-product-card:hover .vxd-card-img-default { opacity: 0; }
.vxd-product-card:hover .vxd-card-img-hover { opacity: 1; }

/* ===== Thanh lọc theo dòng xe ===== */
.vxd-filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.vxd-filter-btn {
	padding: 8px 18px;
	border-radius: 20px;
	border: 1px solid #ddd;
	background: #fff;
	cursor: pointer;
	font-size: 14px;
	transition: all .15s ease;
}
.vxd-filter-btn:hover { border-color: #e53935; color: #e53935; }
.vxd-filter-btn.is-active { background: #e53935; border-color: #e53935; color: #fff; }
.vxd-grid-container.is-loading { opacity: .4; pointer-events: none; }
.vxd-grid-empty { grid-column: 1 / -1; text-align: center; color: #999; padding: 30px 0; }

/* ===== Gallery carousel ===== */
.vxd-gallery-main { position: relative; width: 100%; }
.vxd-slides { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: #f5f5f5; }
.vxd-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; }
.vxd-slide.is-active { opacity: 1; }
.vxd-slide img { width: 100%; height: 100%; object-fit: contain; }

.vxd-gallery-thumbs-wrap { position: relative; margin-top: 12px; }
.vxd-gallery-thumbs {
	display: flex;
	flex-wrap: nowrap;
	gap: 10px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
	min-width: 0;
}
.vxd-gallery-thumbs::-webkit-scrollbar { display: none; }

/* ===== Section Mô Tả / Xe Liên Quan ===== */
.vxd-section { max-width: 1100px; margin: 20px auto 0; padding: 0 20px; }
.vxd-section-desc { padding-bottom: 10px; }
.vxd-section h2 { font-size: 20px; margin-bottom: 14px; }
.vxd-content-body { line-height: 1.7; color: #444; }
.vxd-related-products { padding: 0 20px 40px; }

/* ===== Popup Mua Ngay ===== */
.vxd-modal-overlay {
	display: none;
	position: fixed; inset: 0; background: rgba(0,0,0,.5);
	z-index: 9999; align-items: center; justify-content: center; padding: 20px;
}
.vxd-modal-overlay.is-open { display: flex; }
.vxd-modal-box {
	background: #fff; border-radius: 10px; padding: 26px;
	max-width: 420px; width: 100%; position: relative; max-height: 90vh; overflow-y: auto;
}
.vxd-modal-close {
	position: absolute; top: 12px; right: 14px; background: none; border: none;
	font-size: 24px; cursor: pointer; color: #999; line-height: 1;
}
.vxd-modal-close:hover { color: #333; }
.vxd-buynow-product { color: #666; margin-bottom: 14px; }
.vxd-modal-box form p { margin-bottom: 12px; }
.vxd-modal-box label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 14px; }
.vxd-modal-box input, .vxd-modal-box textarea {
	width: 100%; padding: 9px 12px; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box;
}

/* ===== Carousel [xe_carousel] ===== */
.vxd-carousel-wrap { position: relative; }
.vxd-carousel-track {
	display: flex;
	gap: 20px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	min-width: 0;
}
.vxd-carousel-track::-webkit-scrollbar { display: none; }
.vxd-carousel-item {
	flex: 0 0 calc((100% - (var(--vxd-per-row) - 1) * 20px) / var(--vxd-per-row));
	scroll-snap-align: start;
	min-width: 0;
}

/* ===== Nút điều hướng dùng chung: gallery chính / carousel / thumbnail ===== */
.vxd-slide-nav,
.vxd-carousel-nav,
.vxd-thumb-nav {
	position: absolute !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	width: 36px !important;
	height: 36px !important;
	padding: 0 !important;
	border-radius: 50% !important;
	border: none !important;
	background: rgba(0, 0, 0, .5) !important;
	color: #fff !important;
	font-size: 18px !important;
	line-height: 1 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	z-index: 5 !important;
	transition: background .2s ease !important;
}
.vxd-slide-nav:hover,
.vxd-carousel-nav:hover,
.vxd-thumb-nav:hover {
	background: rgba(0, 0, 0, .7) !important;
}
.vxd-slide-prev,
.vxd-carousel-prev,
.vxd-thumb-prev { left: 10px !important; }
.vxd-slide-next,
.vxd-carousel-next,
.vxd-thumb-next { right: 10px !important; }
.vxd-thumb-nav { width: 28px !important; height: 28px !important; font-size: 14px !important; }

/* ===== Icon giỏ hàng header + dropdown ===== */
.vxd-cart-icon-wrap { position: relative; display: inline-block; }
.vxd-cart-icon-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	text-decoration: none;
	padding: 6px;
}
.vxd-cart-badge {
	position: absolute;
	top: -4px;
	right: -6px;
	background: #e53935;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	min-width: 16px;
	height: 16px;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2px;
}
.vxd-cart-badge:empty,
.vxd-cart-badge[data-zero="1"] { display: none; }

.vxd-cart-dropdown {
	position: absolute;
	top: 100%;
	right: 0;
	width: 320px;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(0,0,0,.15);
	padding: 16px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
	z-index: 999;
}
.vxd-cart-icon-wrap:hover .vxd-cart-dropdown,
.vxd-cart-icon-wrap.is-open .vxd-cart-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.vxd-mini-cart-items { max-height: 300px; overflow-y: auto; margin-bottom: 12px; }
.vxd-mini-cart-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.vxd-mini-cart-item:last-child { border-bottom: none; }
.vxd-mini-cart-item img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.vxd-mini-cart-item-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.vxd-mini-cart-item-meta { font-size: 12px; color: #e53935; margin-top: 2px; }
.vxd-mini-cart-empty { color: #999; text-align: center; padding: 20px 0; font-size: 14px; }
.vxd-mini-cart-footer { border-top: 1px solid #eee; padding-top: 12px; }
.vxd-mini-cart-total { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }

/* ===== Responsive ===== */
@media (max-width: 782px) {
	.vxd-single-product { grid-template-columns: 1fr; }
	.vxd-product-grid { grid-template-columns: repeat(2, 1fr); }
	.vxd-order-grid { grid-template-columns: 1fr; }
	.vxd-cart-footer { flex-direction: column; align-items: flex-start; gap: 16px; }
	.vxd-carousel-item { flex-basis: calc((100% - 12px) / 2) !important; }
	.vxd-carousel-nav { width: 32px !important; height: 32px !important; font-size: 16px !important; }
	.vxd-cart-dropdown { width: 280px; right: -10px; }
}
