/* CHXN component: quick view — centered modal opened by a variable
   product's shop/category (or home, related products...) card "Chọn tùy
   chọn" button, filled in via AJAX (modules/quick-view.js,
   business-logic.php's "chxn_quick_view" handler). Uses WooCommerce's own
   native variation <select> dropdowns rather than the single product
   page's custom swatch-button build (modules/product-gallery.js's
   setupVariationSwatches()), which is wired specifically to ".single-
   product form.variations_form" at page load, not to content an AJAX call
   injects into an arbitrary page later — plain selects keep this
   self-contained without depending on that page-specific script. */

.chxn-quickview-overlay {
	position: fixed;
	inset: 0;
	background: rgba(13, 30, 22, .5);
	z-index: 950;
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility 0s linear .2s;
}
.chxn-quickview {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(.96);
	width: 560px;
	max-width: 92vw;
	max-height: 86vh;
	overflow-y: auto;
	background: var(--chxn-card);
	border-radius: 20px;
	z-index: 951;
	opacity: 0;
	visibility: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
	transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
body.chxn-quickview-open .chxn-quickview-overlay {
	opacity: 1;
	visibility: visible;
	transition: opacity .2s ease;
}
body.chxn-quickview-open .chxn-quickview {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, -50%) scale(1);
	transition: opacity .2s ease, transform .2s ease;
}
body.chxn-quickview-open {
	overflow: hidden;
}
.chxn-quickview-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 0;
	background: var(--chxn-bg);
	color: var(--chxn-ink-2);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}
.chxn-quickview-close:hover {
	background: var(--chxn-line);
	color: var(--chxn-ink);
}

.chxn-quickview-content {
	display: flex;
	gap: 22px;
	padding: 30px;
	min-height: 180px;
}
/* content is emptied while the AJAX call is in flight — a plain spinner
   fills that gap instead of a blank flash of white. */
body.chxn-quickview-loading .chxn-quickview-content {
	align-items: center;
	justify-content: center;
}
body.chxn-quickview-loading .chxn-quickview-content::before {
	content: "";
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid var(--chxn-line);
	border-top-color: var(--chxn-green);
	animation: chxn-quickview-spin .7s linear infinite;
}
@keyframes chxn-quickview-spin {
	to { transform: rotate(360deg); }
}

.chxn-quickview-media {
	flex: 0 0 180px;
}
.chxn-quickview-media img {
	width: 100%;
	height: 180px;
	object-fit: cover;
	border-radius: 14px;
	border: 1px solid var(--chxn-line);
	display: block;
}
.chxn-quickview-body {
	flex: 1;
	min-width: 0;
}
.chxn-quickview-title {
	display: block;
	font-size: 17px;
	font-weight: 800;
	color: var(--chxn-ink);
	text-decoration: none;
	line-height: 1.3;
}
.chxn-quickview-title:hover {
	color: var(--chxn-green-d);
}
.chxn-quickview-price {
	margin-top: 8px;
	font-size: 15px;
	font-weight: 800;
	color: var(--chxn-red);
}
.chxn-quickview-price del {
	color: var(--chxn-ink-2);
	font-weight: 400;
	font-size: 13px;
	margin-right: 6px;
}
.chxn-quickview-price ins {
	text-decoration: none;
}

.chxn-quickview-body table.variations {
	width: 100%;
	margin: 16px 0 0;
	position: relative;
}
.chxn-quickview-body table.variations tbody,
.chxn-quickview-body table.variations tr,
.chxn-quickview-body table.variations th,
.chxn-quickview-body table.variations td {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
}
.chxn-quickview-body table.variations tr + tr {
	margin-top: 10px;
}
.chxn-quickview-body table.variations th.label {
	text-align: left;
	font-size: 13px;
	font-weight: 700;
	color: var(--chxn-ink);
	margin-bottom: 6px;
}
.chxn-quickview-body table.variations select {
	width: 100%;
	box-sizing: border-box;
	border: 1.5px solid var(--chxn-line);
	border-radius: var(--chxn-radius-input);
	padding: 10px 12px;
	font-size: 13.5px;
	font-family: inherit;
	background: var(--chxn-card);
	color: var(--chxn-ink);
}
/* variation swatch buttons (modules/quick-view.js's setupVariationSwatches(),
   same look as the single product page's own "Chọn quy cách" build in
   modules/product-gallery.js) — the native <select> above is hidden by
   that same script once these render, kept in the DOM only so WooCommerce's
   own "wc-add-to-cart-variation.js" still has a real element to read/set. */
.chxn-quickview-body .chxn-variant-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 4px 0 0;
}
.chxn-quickview-body .chxn-variant-swatch {
	position: relative;
	border: 1.5px solid var(--chxn-line);
	background: var(--chxn-card);
	color: var(--chxn-ink);
	border-radius: 11px !important;
	padding: 8px 30px 8px 12px;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	display: block;
	white-space: normal;
	text-transform: none;
}
.chxn-quickview-body .chxn-variant-swatch:hover {
	border-color: var(--chxn-ink-2);
}
.chxn-quickview-body .chxn-variant-swatch.is-selected {
	border-color: var(--chxn-green);
	background: var(--chxn-green-l);
	color: var(--chxn-green-d);
}
.chxn-quickview-body .chxn-variant-swatch-label {
	display: block;
	font-weight: 700;
	font-size: 12px;
	line-height: 1.3;
	white-space: normal;
	max-width: 160px;
}
.chxn-quickview-body .chxn-variant-swatch-price {
	display: block;
	font-size: 12px;
	color: var(--chxn-red);
	font-weight: 700;
	margin-top: 2px;
}
.chxn-quickview-body .chxn-variant-swatch-badge {
	position: absolute;
	top: -8px;
	right: -5px;
	background: var(--chxn-red);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	padding: 2px 5px;
	border-radius: 6px;
}
.chxn-quickview-body .reset_variations {
	position: absolute;
	top: 0;
	right: 0;
	display: inline-block;
	font-size: 12px;
	color: var(--chxn-ink-2);
	margin-top: 0;
}
.chxn-quickview-body .woocommerce-variation-price {
	margin-top: 12px;
	font-size: 15px;
	font-weight: 800;
	color: var(--chxn-red);
}
.chxn-quickview-body .woocommerce-variation-price del {
	color: var(--chxn-ink-2);
	font-weight: 400;
	font-size: 13px;
	margin-right: 6px;
}
.chxn-quickview-body .stock.out-of-stock {
	margin-top: 14px;
	font-size: 13px;
	color: var(--chxn-red);
}
.chxn-quickview-body .woocommerce-variation-add-to-cart {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 16px;
}
.chxn-quickview-body .quantity {
	display: flex;
	align-items: center;
	border: 1.5px solid var(--chxn-green);
	background: var(--chxn-green-l);
	border-radius: var(--chxn-radius-pill);
	overflow: hidden;
	height: 42px;
	margin: 0;
}
.chxn-quickview-body .quantity .qty {
	width: 32px;
	height: 40px;
	padding: 0;
	border: 0;
	background: none;
	text-align: center;
	font-weight: 800;
	font-size: 14px;
	color: var(--chxn-green-d);
	-moz-appearance: textfield;
}
.chxn-quickview-body .quantity .qty::-webkit-inner-spin-button,
.chxn-quickview-body .quantity .qty::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
/* "−"/"+" stepper buttons (modules/quick-view.js's setupQuantitySteppers(),
   inserted around the number input the same way modules/product-gallery.js
   already does on the single product page — that script never runs here
   since it's scoped to ".single-product", so quick view builds its own). */
.chxn-quickview-body .chxn-qty-btn {
	flex: none;
	width: 30px;
	height: 42px;
	border: 0;
	background: none;
	color: var(--chxn-green-d);
	font-weight: 800;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	font-family: inherit;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.chxn-quickview-body .chxn-qty-btn:hover {
	background: var(--chxn-green);
	color: #fff;
}
/* base.css's site-wide "button{border-radius:var(--chxn-radius-pill)
   !important}" reset otherwise wins over a plain (non-!important) value
   here, same as every other real <button>/<input type=submit> on the site
   needing a different shape. */
.chxn-quickview-body .single_add_to_cart_button.button {
	flex: 1 1 auto;
	background: var(--chxn-green) !important;
	border-color: var(--chxn-green) !important;
	border-radius: var(--chxn-radius-pill) !important;
	color: #fff;
	font-weight: 700;
	font-size: 14.5px;
	padding: 12px 20px;
	text-transform: none;
	cursor: pointer;
}
.chxn-quickview-body .single_add_to_cart_button.button:hover {
	background: var(--chxn-green-d) !important;
}
.chxn-quickview-body .single_add_to_cart_button.disabled {
	opacity: .5;
	cursor: not-allowed;
}

@media (max-width: 560px) {
	.chxn-quickview-content {
		flex-direction: column;
		padding: 26px;
	}
	.chxn-quickview-media {
		flex: none;
	}
	.chxn-quickview-media img {
		height: auto;
		aspect-ratio: 1 / 1;
	}
}
