/* ttl-variation-buttons.css — đi kèm ttl-variation-buttons.js (v1.3, 2026-09-10). Gỡ: xoá cùng file JS/PHP. */

/* ẩn phần tử gốc nhưng vẫn giữ trong DOM/form */
.ttl-var-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	overflow: hidden !important;
	pointer-events: none !important;
}
.ttl-price-hidden { display: none !important; }

/* ---------- khối chọn dưới tiêu đề ---------- */
.ttl-var-hero {
	margin: 4px 0 22px;
}
.ttl-var-hero-label {
	font-size: 14px;
	font-weight: 600;
	color: #555;
	margin-bottom: 8px;
	text-transform: none;
}
.ttl-var-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}
/* selector đủ mạnh để thắng kiểu button của Woodmart (nền xám, chữ hoa, căn giữa) */
.ttl-var-hero button.ttl-var-card,
.ttl-var-hero button.ttl-var-card:focus {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 3px;
	min-width: 190px;
	min-height: 0;
	height: auto;
	margin: 0;
	padding: 14px 44px 12px 18px;
	border: 2px solid #dcdcdc;
	border-radius: 12px;
	background: #fff;
	background-image: none;
	box-shadow: none;
	color: #333;
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	text-align: left;
	cursor: pointer;
	transition: border-color .15s, background .15s, box-shadow .15s;
}
.ttl-var-hero button.ttl-var-card:hover {
	border-color: #a9cf6a;
	background: #fff;
	color: #333;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}
.ttl-var-card:focus-visible {
	outline: 3px solid rgba(131, 183, 53, .45);
	outline-offset: 2px;
}
.ttl-var-hero button.ttl-var-card.is-active,
.ttl-var-hero button.ttl-var-card.is-active:hover {
	border-color: #83b735;
	background: #f4faea;
	box-shadow: inset 0 0 0 1px #83b735;
}
.ttl-var-card-name {
	display: block;
	text-transform: none;
	letter-spacing: 0;
	font-size: 18px;
	font-weight: 700;
	color: #222;
}
.ttl-var-card-price {
	display: block;
	text-transform: none;
	letter-spacing: 0;
	font-size: 20px;
	font-weight: 700;
	color: #83b735;
}
.ttl-var-card-stock {
	display: block;
	text-transform: none;
	letter-spacing: 0;
	font-weight: 400;
	font-size: 12px;
	color: #777;
	margin-top: 2px;
}
.ttl-var-card-stock.is-out { color: #c0392b; }
.ttl-var-card.is-out { opacity: .55; }
.ttl-var-card-check {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #83b735;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
	opacity: 0;
	transform: scale(.6);
	transition: opacity .15s, transform .15s;
}
.ttl-var-card.is-active .ttl-var-card-check {
	opacity: 1;
	transform: scale(1);
}
/* chưa chọn: khẽ nhắc bằng viền vàng nhạt cho cả khối */
.ttl-var-hero:not(.has-choice) button.ttl-var-card { border-color: #e6c75a; }

/* trong form: khi khối chọn đã lên trên, ẩn giá biến thể trùng (thẻ và dòng tóm tắt đã có giá), giữ mô tả biến thể */
.ttl-hero-mode .woocommerce-variation-price { display: none !important; }
.ttl-hero-mode .woocommerce-variation-description { margin-bottom: 10px; }

/* ---------- dòng "Bạn đang chọn" + nút mua ---------- */
.ttl-var-summary {
	margin: 4px 0 12px;
	padding: 10px 14px;
	border-left: 4px solid #83b735;
	background: #f4faea;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
	color: #333;
}
.ttl-var-summary.is-empty {
	border-left-color: #e0a800;
	background: #fff8e1;
}
.ttl-var-summary strong { color: #222; }
.ttl-var-summary-price { font-weight: 700; color: #83b735; }
.ttl-var-sep { color: #aaa; margin: 0 2px; }
.ttl-var-change {
	margin-left: 6px;
	text-decoration: underline;
	color: #555;
	white-space: nowrap;
}
.ttl-var-change:hover { color: #83b735; }
.single_add_to_cart_button.ttl-has-choice { white-space: normal; line-height: 1.3; }
button.ttl-disabled, .ttl-disabled { opacity: .45 !important; cursor: not-allowed !important; pointer-events: none; }

/* ---------- nút mua: hàng 1 = số lượng + thêm giỏ, Buy now xuống hàng riêng full width khi hẹp ---------- */
.ttl-hero-mode .woocommerce-variation-add-to-cart {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 8px;
}
.ttl-hero-mode .woocommerce-variation-add-to-cart .quantity { flex: 0 0 auto; margin: 0; }
.ttl-hero-mode .woocommerce-variation-add-to-cart .single_add_to_cart_button { flex: 1 1 200px; min-width: 0; margin: 0; }
.ttl-hero-mode .woocommerce-variation-add-to-cart > button[type="submit"]:not(.single_add_to_cart_button) { flex: 0 0 auto; margin: 0; }

/* ---------- mobile ---------- */
@media (max-width: 767px) {
	.ttl-var-hero { margin: 2px 0 18px; }
	.ttl-var-hero-label { font-size: 15px; margin-bottom: 8px; }
	.ttl-var-cards {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
	.ttl-var-hero button.ttl-var-card {
		min-width: 0;
		width: 100%;
		padding: 12px 34px 10px 14px;
		border-radius: 10px;
	}
	.ttl-var-card-name { font-size: 17px; }
	.ttl-var-card-price { font-size: 18px; }
	.ttl-var-card-stock-more { display: none; }
	.ttl-var-card-check { top: 8px; right: 8px; width: 20px; height: 20px; line-height: 20px; font-size: 12px; }

	.ttl-var-summary { font-size: 13.5px; padding: 9px 12px; }
	.ttl-hero-mode .woocommerce-variation-add-to-cart .single_add_to_cart_button { flex: 1 1 0; font-size: 13px; padding-left: 10px; padding-right: 10px; }
	.ttl-hero-mode .woocommerce-variation-add-to-cart > button[type="submit"]:not(.single_add_to_cart_button) { flex: 1 1 100%; }
}
/* thẻ rất hẹp (điện thoại nhỏ): giá xuống cỡ vừa để không tràn */
@media (max-width: 360px) {
	.ttl-var-card-price { font-size: 16px; }
	.ttl-var-card-name { font-size: 16px; }
}
