/**
 * Màu nút toàn site — giống nút trang chủ (đỏ King Coffee).
 * Chỉ đổi màu, giữ nguyên hình dạng/bo góc của từng plugin.
 * Màu gốc (xanh #1B8057) đến từ Customizer Zilly + cài đặt ShopBuilder; dùng !important vì plugin in CSS inline có !important.
 */
:root {
	--kch-btn-red: #950B18;
	--kch-btn-red-2: #7a0913;
	--kch-btn-ink: #211D1A;
}

/* Biến màu của ShopBuilder: giỏ hàng nổi, mini cart drawer, addon. */
html body {
	--rtsb-drawer-primary: var(--kch-btn-red) !important;
	--rtsb-color-primary: var(--kch-btn-red) !important;
}
html body #rtsb-cart-float-menu { --rtsb-float-bg: var(--kch-btn-red) !important; }

/* ===== Nút chính: nền đỏ, chữ trắng ===== */
html body .woocommerce a.button,
html body .woocommerce button.button,
html body .woocommerce input.button,
html body .woocommerce #respond input#submit,
html body a.button.checkout,
html body .woocommerce-mini-cart__buttons a.checkout,
html body .single_add_to_cart_button,
html body #place_order,
html body .checkout-button,
html body .wc-backward,
html body .woocommerce-form-login__submit,
html body .woocommerce-form-register__submit,
html body .action-cart.add_to_cart_button,
html body .rtsb-action-btn.simple-product,
html body .rtsb-action-btn.add_to_cart_button,
html body a.add_to_cart_button,
html body .rtsb-loadmore-btn,
html body .ff-btn-submit,
html body .wpforms-submit,
html body .wp-block-search__button,
html body .wp-block-button__link,
html body .elementor-button,
html body .widget_search button,
html body .search-form button,
html body .sidebar-widget-area button.btn {
	background-color: var(--kch-btn-red) !important;
	border-color: var(--kch-btn-red) !important;
	color: #fff !important;
}

html body .woocommerce a.button:hover,
html body .woocommerce button.button:hover,
html body .woocommerce input.button:hover,
html body .woocommerce #respond input#submit:hover,
html body a.button.checkout:hover,
html body .woocommerce-mini-cart__buttons a.checkout:hover,
html body .single_add_to_cart_button:hover,
html body #place_order:hover,
html body .checkout-button:hover,
html body .wc-backward:hover,
html body .woocommerce-form-login__submit:hover,
html body .woocommerce-form-register__submit:hover,
html body .action-cart.add_to_cart_button:hover,
html body .rtsb-action-btn.simple-product:hover,
html body .rtsb-action-btn.add_to_cart_button:hover,
html body a.add_to_cart_button:hover,
html body .rtsb-loadmore-btn:hover,
html body .ff-btn-submit:hover,
html body .wpforms-submit:hover,
html body .wp-block-search__button:hover,
html body .wp-block-button__link:hover,
html body .elementor-button:hover,
html body .widget_search button:hover,
html body .search-form button:hover,
html body .sidebar-widget-area button.btn:hover {
	background-color: var(--kch-btn-red-2) !important;
	border-color: var(--kch-btn-red-2) !important;
	color: #fff !important;
}

/* Icon trong nút đi theo màu chữ. */
html body .action-cart.add_to_cart_button *,
html body .rtsb-action-btn.simple-product *,
html body .rtsb-action-btn.add_to_cart_button * {
	color: inherit !important;
}
html body .action-cart.add_to_cart_button svg,
html body .rtsb-action-btn.simple-product svg,
html body .rtsb-action-btn.add_to_cart_button svg {
	fill: currentColor !important;
}

/* ===== Nút phụ ("Xem giỏ hàng"): viền, chữ đậm — như nút outline trang chủ ===== */
html body .woocommerce-mini-cart__buttons a.wc-forward:not(.checkout),
html body .widget_shopping_cart a.button.wc-forward:not(.checkout),
html body .rtsb-minicart-drawer a.button.wc-forward:not(.checkout) {
	background-color: #fff !important;
	border: 1px solid rgba(0, 0, 0, .16) !important;
	color: var(--kch-btn-ink) !important;
}
html body .woocommerce-mini-cart__buttons a.wc-forward:not(.checkout):hover,
html body .widget_shopping_cart a.button.wc-forward:not(.checkout):hover,
html body .rtsb-minicart-drawer a.button.wc-forward:not(.checkout):hover {
	background-color: #fff !important;
	border-color: var(--kch-btn-red) !important;
	color: var(--kch-btn-red) !important;
}

/* Nút đăng nhập / đăng ký: chữ trên 1 dòng (Elementor trang Tài khoản ép width 120px). */
html body .elementor .elementor-element .rtsb-myacount-page .button.button,
html body .woocommerce-form-login__submit,
html body .woocommerce-form-register__submit,
html body .woocommerce-form-login button.button,
html body .woocommerce-form-register button.button {
	white-space: nowrap !important;
	width: auto !important;
	min-width: max-content !important;
	padding-left: 32px !important;
	padding-right: 32px !important;
}

/* Giỏ hàng: ô mã giảm giá + "Áp dụng" + "Cập nhật giỏ hàng" có khoảng cách, tự xuống dòng trên mobile. */
html body .rtsb-cart-table .actions-button-wrapper,
html body .woocommerce-cart-form td.actions .coupon,
html body .rtsb-cart-table .actions .coupon {
	display: flex !important;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px !important;
}
/* Clearfix ::before/::after của WooCommerce thành flex item → thừa khoảng gap ở 2 đầu. */
html body .rtsb-cart-table .actions-button-wrapper::before,
html body .rtsb-cart-table .actions-button-wrapper::after,
html body .woocommerce-cart-form td.actions .coupon::before,
html body .woocommerce-cart-form td.actions .coupon::after,
html body .rtsb-cart-table .actions .coupon::before,
html body .rtsb-cart-table .actions .coupon::after {
	display: none !important;
}
html body .rtsb-cart-table .actions .coupon .input-text,
html body .rtsb-cart-table .actions .coupon .button,
html body .rtsb-cart-table .actions [name="update_cart"],
html body .woocommerce-cart-form td.actions .coupon .input-text,
html body .woocommerce-cart-form td.actions .coupon .button {
	margin: 0 !important;
}
html body .woocommerce-cart-form td.actions > [name="update_cart"] { margin-left: 12px !important; }
@media (max-width: 767px) {
	html body .woocommerce-cart-form td.actions > [name="update_cart"] { margin: 12px 0 0 !important; }
	/* WooCommerce smallscreen đặt input/nút 48% + padding 8px → ô nhập lệch, nút rớt dòng. */
	html body .woocommerce-cart-form td.actions .coupon,
	html body .rtsb-cart-table .actions .coupon {
		flex-wrap: nowrap;
		width: 100% !important;
		padding: 0 !important;
	}
	html body .woocommerce-cart-form td.actions .coupon .input-text,
	html body .rtsb-cart-table .actions .coupon .input-text {
		flex: 1 1 auto;
		width: auto !important;
		min-width: 0;
	}
	html body .woocommerce-cart-form td.actions .coupon .button,
	html body .rtsb-cart-table .actions .coupon .button {
		flex: none;
		width: auto !important;
	}
}

/* Ngăn giỏ hàng mini (ShopBuilder): số lượng, link mã giảm giá, viền tổng tiền → đỏ thay xanh. */
html body .rtsb-minicart-drawer .mini-cart-title .cart-count,
html body .rtsb-drawer-container .mini-cart-title .cart-count { background-color: var(--kch-btn-red) !important; color: #fff !important; }
html body .rtsb-apply-coupon-toggle a,
html body .rtsb-apply-coupon-toggle a font { color: var(--kch-btn-red) !important; border-color: var(--kch-btn-red) !important; }
html body .mini-cart-bottom .cart_totals { border-color: rgba(0, 0, 0, .08) !important; }

/* Nút chia sẻ mạng xã hội (trang sản phẩm). */
html body .rtsb-share-btn { color: var(--kch-btn-red) !important; }
html body .rtsb-share-btn:hover { background-color: var(--kch-btn-red) !important; color: #fff !important; }
html body .rtsb-share-btn svg { fill: currentColor !important; }

/* Nút bị vô hiệu (hết hàng / chưa chọn biến thể) giữ vẻ mờ. */
html body .single_add_to_cart_button.disabled,
html body .woocommerce button.button:disabled,
html body .woocommerce button.button.disabled {
	opacity: .5 !important;
}
