/**
 * LPX Auto - Quick Order (Đặt hàng nhanh 1-Click) & CRO Trust Badges
 * Tương thích đa theme (Blocksy, Flatsome, Woodmart...)
 */

/* 0. Ẩn nút Thêm vào giỏ hàng và ô số lượng mặc định trên trang sản phẩm */
.woocommerce div.product form.cart .quantity,
.woocommerce div.product form.cart button[name="add-to-cart"],
.woocommerce div.product form.cart .single_add_to_cart_button {
	display: none !important;
}

.woocommerce div.product form.cart .ct-cart-actions {
	display: block !important;
	width: 100% !important;
}

/* 1. Nút MUA NGAY chính */
.lpx-quick-order-btn {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 10px !important;
	width: 100% !important;
	margin: 12px 0 10px !important;
	padding: 13px 18px !important;
	background: linear-gradient(135deg, #f97316 0%, #dc2626 100%) !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 8px !important;
	box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35) !important;
	cursor: pointer !important;
	transition: all 0.25s ease !important;
	text-align: center !important;
	box-sizing: border-box !important;
	text-decoration: none !important;
}

.lpx-quick-order-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45) !important;
	background: linear-gradient(135deg, #ea580c 0%, #b91c1c 100%) !important;
	color: #ffffff !important;
}

.lpx-btn-icon {
	font-size: 20px;
	line-height: 1;
	display: inline-block;
	animation: lpx-bounce 1.5s infinite;
}

@keyframes lpx-bounce {
	0%, 100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.15);
	}
}

.lpx-btn-text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.lpx-btn-text strong {
	font-size: 16px;
	font-weight: 800;
	letter-spacing: 0.5px;
	color: #ffffff !important;
}

.lpx-btn-text small {
	font-size: 11.5px;
	opacity: 0.95;
	font-weight: normal;
	color: #ffffff !important;
	margin-top: 2px;
}

/* 2. Cụm 3 nút tư vấn trực tiếp (Zalo, Messenger, Hotline) */
.lpx-consult-row {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 8px;
	margin: 0 0 14px !important;
	box-sizing: border-box;
}

.lpx-consult-btn {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 6px;
	padding: 9px 4px !important;
	min-height: 40px !important;
	border-radius: 7px !important;
	text-decoration: none !important;
	color: #ffffff !important;
	font-size: 12.5px !important;
	font-weight: 700 !important;
	transition: all 0.2s ease !important;
	box-sizing: border-box !important;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
}

.lpx-consult-btn:hover {
	transform: translateY(-2px);
	filter: brightness(1.08);
	color: #ffffff !important;
}

.lpx-consult-svg {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
}

.lpx-zalo-btn {
	background: #0068ff !important;
}

.lpx-messenger-btn {
	background: linear-gradient(135deg, #00b2ff 0%, #006aff 100%) !important;
}

.lpx-hotline-btn {
	background: #16a34a !important;
}

/* 3. Khối cam kết bán hàng (Trust badges) */
.lpx-conversion-box {
	margin: 14px 0 20px;
	padding: 14px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	box-sizing: border-box;
}

.lpx-highlight-badge {
	margin-bottom: 12px;
	padding: 10px 12px;
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	border-radius: 6px;
	color: #065f46;
}

.lpx-highlight-badge .lpx-badge-text strong {
	color: #047857;
	font-size: 13px;
	letter-spacing: 0.2px;
}

.lpx-highlight-badge .lpx-badge-text span {
	color: #065f46;
	font-size: 12px;
}

.lpx-badge-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px 10px;
}

@media (max-width: 600px) {
	.lpx-badge-grid {
		grid-template-columns: 1fr;
		gap: 8px;
	}
}

.lpx-badge-item {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.lpx-badge-icon {
	font-size: 15px;
	flex-shrink: 0;
	margin-top: 1px;
}

.lpx-badge-text strong {
	display: block;
	font-size: 12px;
	color: #1e293b;
	margin-bottom: 1px;
	line-height: 1.3;
}

.lpx-badge-text span {
	display: block;
	font-size: 11.5px;
	color: #64748b;
	line-height: 1.3;
}

.lpx-badge-text a {
	color: #dc2626;
	text-decoration: underline;
	font-weight: 700;
}

/* 4. Thanh dính đáy màn hình (Sticky Quick Order Bar) */
.lpx-sticky-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 9998;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-top: 1px solid #e2e8f0;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
	padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
	transform: translateY(110%);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	box-sizing: border-box;
}

.lpx-sticky-bar.is-visible {
	transform: translateY(0);
}

.lpx-sticky-bar__inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.lpx-sticky-bar__product {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	flex: 1;
}

.lpx-sticky-bar__thumb {
	width: 48px;
	height: 48px;
	border-radius: 6px;
	object-fit: cover;
	flex-shrink: 0;
	border: 1px solid #e2e8f0;
}

.lpx-sticky-bar__info {
	min-width: 0;
}

.lpx-sticky-bar__title {
	font-size: 13.5px;
	font-weight: 700;
	color: #0f172a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin: 0 0 2px;
}

.lpx-sticky-bar__price {
	font-size: 14px;
	font-weight: 800;
	color: #dc2626;
	display: flex;
	align-items: baseline;
	gap: 6px;
}

.lpx-sticky-bar__price del {
	font-size: 12px;
	color: #94a3b8;
	font-weight: 400;
}

.lpx-sticky-bar__action {
	flex-shrink: 0;
}

.lpx-sticky-bar__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 20px;
	background: linear-gradient(135deg, #f97316 0%, #dc2626 100%);
	color: #ffffff;
	font-weight: 800;
	font-size: 14px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	box-shadow: 0 3px 10px rgba(220, 38, 38, 0.35);
	transition: all 0.2s ease;
	white-space: nowrap;
}

.lpx-sticky-bar__btn:hover {
	transform: scale(1.03);
	color: #ffffff;
}

@media (max-width: 768px) {
	.lpx-sticky-bar__product {
		display: none;
	}
	.lpx-sticky-bar__action {
		width: 100%;
	}
	.lpx-sticky-bar__btn {
		width: 100%;
		padding: 12px;
		font-size: 15px;
		border-radius: 8px;
	}
}

/* 5. Cửa sổ Modal Đặt hàng nhanh 1-Click */
.lpx-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	background: rgba(15, 23, 42, 0.72);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
	animation: lpx-fade-in 0.2s ease;
}

@keyframes lpx-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

.lpx-modal-dialog {
	position: relative;
	width: 100%;
	max-width: 480px;
	max-height: 92vh;
	overflow-y: auto;
	background: #ffffff;
	border-radius: 12px;
	padding: 20px 22px 24px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
	box-sizing: border-box;
	animation: lpx-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lpx-slide-up {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.lpx-modal-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border: 1px solid #e2e8f0;
	background: #f8fafc;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #64748b;
	transition: all 0.2s;
	padding: 0;
	z-index: 2;
}

.lpx-modal-close:hover {
	background: #fee2e2;
	border-color: #fca5a5;
	color: #dc2626;
	transform: rotate(90deg);
}

.lpx-modal-header {
	margin-bottom: 12px;
	padding-right: 36px;
}

.lpx-modal-title {
	font-size: 17px;
	font-weight: 800;
	color: #0f172a;
	line-height: 1.3;
}

.lpx-modal-subtitle {
	font-size: 12px;
	color: #16a34a;
	font-weight: 600;
	margin-top: 3px;
}

/* Tóm tắt sản phẩm trong modal */
.lpx-product-summary {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	margin-bottom: 14px;
}

.lpx-summary-thumb {
	width: 56px;
	height: 56px;
	border-radius: 6px;
	object-fit: cover;
	flex-shrink: 0;
	border: 1px solid #cbd5e1;
	background: #ffffff;
}

.lpx-summary-info {
	min-width: 0;
	flex: 1;
}

.lpx-summary-name {
	font-size: 13px;
	font-weight: 700;
	color: #1e293b;
	line-height: 1.35;
	margin-bottom: 4px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.lpx-summary-price {
	display: flex;
	align-items: baseline;
	gap: 6px;
}

.lpx-price-current {
	font-size: 15px;
	font-weight: 800;
	color: #dc2626;
}

.lpx-price-old {
	font-size: 12px;
	color: #94a3b8;
	text-decoration: line-through;
}

/* Biến thể trong modal */
.lpx-var-box {
	margin-bottom: 14px;
	padding: 10px 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
}

.lpx-var-box-label {
	display: block;
	font-size: 12.5px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 8px;
}

.lpx-var-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.lpx-var-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 11px;
	background: #ffffff;
	border: 1.5px solid #cbd5e1;
	border-radius: 6px;
	cursor: pointer;
	font-size: 12.5px;
	color: #334155;
	transition: all 0.2s ease;
	line-height: 1.2;
}

.lpx-var-pill:hover {
	border-color: #94a3b8;
	background: #f1f5f9;
}

.lpx-var-pill.active {
	border-color: #dc2626 !important;
	background: #fef2f2 !important;
	color: #dc2626 !important;
	box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.lpx-var-pill-name {
	font-weight: 700;
}

.lpx-var-pill-price {
	font-size: 11.5px;
	opacity: 0.85;
}

.lpx-var-pill.out-of-stock {
	opacity: 0.55;
	background: #f1f5f9;
	border-color: #e2e8f0;
	color: #94a3b8;
	cursor: not-allowed;
}

.lpx-var-pill.out-of-stock:hover {
	border-color: #e2e8f0;
	background: #f1f5f9;
}

.lpx-var-pill.out-of-stock .lpx-var-pill-price {
	color: #ef4444;
	font-weight: 600;
}

/* Form đặt hàng */
.lpx-form-row {
	margin-bottom: 12px;
}

.lpx-form-row label {
	display: block;
	font-size: 12.5px;
	font-weight: 700;
	color: #334155;
	margin-bottom: 5px;
}

.lpx-req {
	color: #dc2626;
}

.lpx-form-row input[type="text"],
.lpx-form-row input[type="tel"] {
	width: 100% !important;
	padding: 9px 12px !important;
	font-size: 13.5px !important;
	color: #0f172a !important;
	background: #ffffff !important;
	border: 1.5px solid #cbd5e1 !important;
	border-radius: 6px !important;
	outline: none !important;
	box-sizing: border-box !important;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.lpx-form-row input:focus {
	border-color: #dc2626 !important;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.lpx-field-hint {
	display: block;
	font-size: 11px;
	color: #64748b;
	margin-top: 3px;
	line-height: 1.3;
}

/* Bộ chọn số lượng và tổng tiền */
.lpx-form-row-qty {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
	padding: 9px 12px;
	background: #f1f5f9;
	border-radius: 6px;
}

.lpx-form-row-qty label {
	font-size: 12.5px;
	font-weight: 700;
	color: #334155;
	margin: 0;
}

.lpx-qty-ctrl {
	display: flex;
	align-items: center;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 4px;
	overflow: hidden;
}

.lpx-qty-btn {
	width: 32px;
	height: 32px;
	background: none;
	border: none;
	font-size: 16px;
	font-weight: 700;
	color: #334155;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
	padding: 0;
}

.lpx-qty-btn:hover {
	background: #e2e8f0;
}

.lpx-qty-ctrl input {
	width: 36px !important;
	height: 32px !important;
	border: none !important;
	border-left: 1px solid #cbd5e1 !important;
	border-right: 1px solid #cbd5e1 !important;
	text-align: center !important;
	font-size: 13.5px !important;
	font-weight: 700 !important;
	color: #0f172a !important;
	padding: 0 !important;
	margin: 0 !important;
	background: #ffffff !important;
	-moz-appearance: textfield;
}

.lpx-qty-ctrl input::-webkit-outer-spin-button,
.lpx-qty-ctrl input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.lpx-total-display {
	font-size: 13px;
	color: #475569;
}

.lpx-total-display strong {
	font-size: 16px;
	color: #dc2626;
	font-weight: 800;
}

/* Nút Submit */
.lpx-submit-btn {
	width: 100% !important;
	padding: 13px 18px !important;
	background: linear-gradient(135deg, #f97316 0%, #dc2626 100%) !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 8px !important;
	cursor: pointer !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4) !important;
	transition: all 0.2s ease !important;
	box-sizing: border-box !important;
}

.lpx-submit-btn:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(220, 38, 38, 0.5) !important;
}

.lpx-submit-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none !important;
}

.lpx-btn-main-text {
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.3px;
}

.lpx-btn-sub-text {
	font-size: 11px;
	opacity: 0.95;
	margin-top: 2px;
	font-weight: 400;
}

/* Báo lỗi */
.lpx-error-box {
	background: #fee2e2;
	border: 1px solid #fca5a5;
	color: #991b1b;
	padding: 9px 12px;
	border-radius: 6px;
	font-size: 12.5px;
	margin-bottom: 12px;
	line-height: 1.35;
}

/* Báo thành công */
.lpx-success-box {
	text-align: center;
	padding: 16px 8px;
}

.lpx-success-icon {
	font-size: 48px;
	margin-bottom: 10px;
}

.lpx-success-box h3 {
	font-size: 20px;
	font-weight: 800;
	color: #16a34a;
	margin: 0 0 8px;
}

.lpx-success-box p {
	font-size: 14px;
	color: #334155;
	margin: 0 0 14px;
}

.lpx-success-box p strong {
	color: #dc2626;
	font-size: 16px;
}

.lpx-success-msg {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 12px;
	font-size: 13px;
	color: #475569;
	line-height: 1.5;
	margin-bottom: 12px;
}

.lpx-success-note {
	font-size: 12.5px;
	color: #64748b;
	line-height: 1.45;
	margin-bottom: 20px;
}

.lpx-close-modal-btn {
	padding: 10px 22px;
	background: #0f172a;
	color: #ffffff;
	border: none;
	border-radius: 6px;
	font-weight: 700;
	font-size: 13.5px;
	cursor: pointer;
	transition: background 0.2s;
}

.lpx-close-modal-btn:hover {
	background: #334155;
}

/* 6. Nút chọn nhanh phân loại/phiên bản xe (Swatches/Pills) thay dropdown */
.lpx-visually-hidden {
	position: absolute !important;
	opacity: 0 !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	border: 0 !important;
	clip: rect(0, 0, 0, 0) !important;
	overflow: hidden !important;
	pointer-events: none !important;
}

.lpx-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 6px 0 10px;
}

.lpx-swatch-btn {
	background: #ffffff;
	border: 1.5px solid #cbd5e1;
	border-radius: 8px;
	padding: 8px 16px;
	font-size: 13.5px;
	font-weight: 600;
	color: #334155;
	cursor: pointer;
	transition: all 0.2s ease;
	line-height: 1.4;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.lpx-swatch-btn:hover {
	border-color: #94a3b8;
	background: #f8fafc;
	color: #0f172a;
}

.lpx-swatch-btn.is-active {
	border-color: #d62828;
	color: #d62828;
	background: #fff5f5;
	box-shadow: 0 0 0 1px #d62828;
}

.lpx-swatch-btn.is-active::after {
	content: "✓";
	font-weight: 700;
	font-size: 13px;
	color: #d62828;
}
