/**
 * MOO-style variation UI — cards, compact pink pills, quantity table.
 * body.wc-cpus-moo-variations is added on applicable variable products.
 */

body.wc-cpus-moo-variations {
	--wc-cpus-accent: #e91e8c;
	--wc-cpus-pill-border: #d1d5db;
}

/* ThemeREX / TRX Addons: hide native attribute buttons if anything slips past PHP (MOO uses pills only). */
body.wc-cpus-moo-variations form.variations_form .trx_addons_attrib_extended,
body.wc-cpus-moo-variations table.variations td.value .trx_addons_attrib_extended {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	overflow: hidden !important;
	margin: 0 !important;
	padding: 0 !important;
	pointer-events: none !important;
}

/* Remove theme/accordion “dropdown” chevrons & stray bullets beside attribute titles */
body.wc-cpus-moo-variations table.variations th.label::before,
body.wc-cpus-moo-variations table.variations th.label::after,
body.wc-cpus-moo-variations table.variations th.label label::before,
body.wc-cpus-moo-variations table.variations th.label label::after {
	content: none !important;
	display: none !important;
}

body.wc-cpus-moo-variations table.variations th.label label {
	background-image: none !important;
	background: none !important;
	padding-inline-end: 0 !important;
}

body.wc-cpus-moo-variations table.variations th.label svg,
body.wc-cpus-moo-variations table.variations th.label .elementor-menu-toggle,
body.wc-cpus-moo-variations table.variations th.label [class*="chevron"],
body.wc-cpus-moo-variations table.variations th.label [class*="arrow"],
body.wc-cpus-moo-variations table.variations th.label .variation-toggle-icon {
	display: none !important;
}

body.wc-cpus-moo-variations table.variations th.label {
	list-style: none !important;
}

/*
 * Printy / ThemeREX: `.select_container` uses ::before (strip) + ::after (Fontello chevron).
 * Applies to native dropdowns and to hidden quantity selects — hide for the whole form so
 * Elementor / non-table variation markup is covered too.
 */
body.wc-cpus-moo-variations form.variations_form .select_container::before,
body.wc-cpus-moo-variations form.variations_form .select_container::after,
body.wc-cpus-moo-variations form.variations_form .select_container:before,
body.wc-cpus-moo-variations form.variations_form .select_container:after {
	content: none !important;
	display: none !important;
	width: 0 !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	font-size: 0 !important;
	line-height: 0 !important;
}

body.wc-cpus-moo-variations form.variations_form .select_container select {
	padding-right: 0.85rem !important;
}

body.wc-cpus-moo-variations.single-product form.variations_form.cart table.variations,
body.wc-cpus-moo-variations .elementor-widget-woocommerce-add-to-cart form.variations_form.cart table.variations {
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	max-width: 100%;
	margin-bottom: 0;
}

body.wc-cpus-moo-variations.single-product form.variations_form.cart table.variations tbody tr,
body.wc-cpus-moo-variations .elementor-widget-woocommerce-add-to-cart form.variations_form.cart table.variations tbody tr {
	display: block;
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 0.85rem 1rem 1rem;
	margin: 0 0 0.65rem;
	background: #fff;
}

body.wc-cpus-moo-variations.single-product form.variations_form.cart table.variations tbody tr th.label,
body.wc-cpus-moo-variations .elementor-widget-woocommerce-add-to-cart form.variations_form.cart table.variations tbody tr th.label {
	display: block;
	width: 100%;
	padding: 0 0 0.45rem !important;
	border: 0;
	text-align: left;
	font-weight: 700;
	font-size: 0.9rem;
	color: #111;
}

body.wc-cpus-moo-variations.single-product form.variations_form.cart table.variations tbody tr td.value,
body.wc-cpus-moo-variations .elementor-widget-woocommerce-add-to-cart form.variations_form.cart table.variations tbody tr td.value {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0;
	padding: 0 !important;
	border: 0;
	box-sizing: border-box;
}

.wc-cpus-var-cards-wrap {
	display: block;
	width: 100%;
}

.wc-cpus-var-pills__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.45rem;
	row-gap: 0.35rem;
}

/* Unselected: white + visible gray border. Selected: pink (border matches fill). */
.wc-cpus-var-pill:not(.is-selected):not([aria-pressed="true"]) {
	display: inline-flex;
	align-items: center;
	gap: 0.28rem;
	margin: 0;
	padding: 0.22rem 0.55rem;
	border: 1px solid var(--wc-cpus-pill-border, #d1d5db) !important;
	border-radius: 999px;
	background: #fff !important;
	color: #111 !important;
	font: inherit;
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.25;
	cursor: pointer;
	box-sizing: border-box;
	box-shadow: none;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wc-cpus-var-pill:hover:not(:disabled):not(.is-selected):not([aria-pressed="true"]) {
	border-color: #9ca3af !important;
	color: #000 !important;
}

.wc-cpus-var-pill.is-selected,
.wc-cpus-var-pill[aria-pressed="true"] {
	background: var(--wc-cpus-accent, #e91e8c) !important;
	border-color: var(--wc-cpus-accent, #e91e8c) !important;
	color: #fff !important;
	font-weight: 700;
	padding: 0.22rem 0.55rem;
	box-shadow: none;
}

.wc-cpus-var-pill.is-selected .wc-cpus-var-pill__title,
.wc-cpus-var-pill[aria-pressed="true"] .wc-cpus-var-pill__title {
	color: #fff !important;
	font-weight: 700;
}

.wc-cpus-var-pill--rich {
	min-width: 0;
}

.wc-cpus-var-pill__media {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 5px;
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.08);
}

.wc-cpus-var-pill.is-selected .wc-cpus-var-pill__media,
.wc-cpus-var-pill[aria-pressed="true"] .wc-cpus-var-pill__media {
	border-color: rgba(255, 255, 255, 0.5);
}

.wc-cpus-var-pill__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wc-cpus-var-pill__media--color {
	border: 1px solid rgba(0, 0, 0, 0.12);
}

.wc-cpus-var-pill__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: left;
	min-width: 0;
}

.wc-cpus-var-pill__desc {
	font-size: 0.68rem;
	color: #6b7280;
	margin-top: 0.06rem;
}

.wc-cpus-var-pill.is-selected .wc-cpus-var-pill__desc,
.wc-cpus-var-pill[aria-pressed="true"] .wc-cpus-var-pill__desc {
	color: rgba(255, 255, 255, 0.9) !important;
}

.wc-cpus-quantity-pending-msg {
	display: none;
	margin: 0.5rem 0 0;
	font-size: 0.9rem;
	color: #6b7280;
}

.wc-cpus-quantity-wrap--pending .wc-cpus-quantity-pending-msg {
	display: block;
}

.wc-cpus-quantity-wrap--pending .wc-cpus-quantity-table-wrap {
	display: none !important;
}

.wc-cpus-quantity-table-wrap {
	width: 100%;
	margin-top: 0.35rem;
}

/* Undo responsive “stacked” table hacks from themes — keep a real grid */
.wc-cpus-quantity-table {
	display: table !important;
	width: 100% !important;
}

.wc-cpus-quantity-table thead {
	display: table-header-group !important;
}

.wc-cpus-quantity-table tbody {
	display: table-row-group !important;
}

.wc-cpus-quantity-table tr {
	display: table-row !important;
}

.wc-cpus-quantity-table th,
.wc-cpus-quantity-table td {
	display: table-cell !important;
	vertical-align: middle !important;
}

.wc-cpus-quantity-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	table-layout: fixed;
}

.wc-cpus-quantity-table thead th {
	padding: 0.45rem 0.5rem;
	text-align: left;
	font-weight: 700;
	color: #111;
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
}

.wc-cpus-quantity-table thead th.wc-cpus-quantity-table__th-each,
.wc-cpus-quantity-table thead th.wc-cpus-quantity-table__th-pack {
	text-align: right;
}

.wc-cpus-quantity-table thead th.wc-cpus-quantity-table__th-radio {
	width: 2.25rem;
}

.wc-cpus-quantity-table thead th.wc-cpus-quantity-table__th-num {
	width: 4rem;
}

.wc-cpus-quantity-table tbody td.wc-cpus-quantity-table__pack {
	color: var(--wc-cpus-accent, #e91e8c);
	font-weight: 700;
}

.wc-cpus-quantity-table tbody td {
	padding: 0.4rem 0.5rem;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
}

.wc-cpus-quantity-table tbody td.wc-cpus-quantity-table__each,
.wc-cpus-quantity-table tbody td.wc-cpus-quantity-table__pack {
	text-align: right;
}

.wc-cpus-quantity-table__num-label {
	font-weight: 500;
	cursor: pointer;
	margin: 0;
}

.wc-cpus-quantity-table tbody tr:last-child td {
	border-bottom: 0;
}

.wc-cpus-quantity-table tbody tr:nth-child(even) {
	background: #fafafa;
}

.wc-cpus-quantity-table__pack-prices,
.wc-cpus-quantity-table__pack-prices .price,
.wc-cpus-quantity-table__pack .woocommerce-Price-amount {
	margin: 0;
	font-weight: 700;
	color: var(--wc-cpus-accent, #e91e8c) !important;
}

.wc-cpus-quantity-table__each {
	font-variant-numeric: tabular-nums;
	color: #111;
}

.wc-cpus-quantity-table__radio input[type='radio'],
.wc-cpus-quantity-table__radio .wc-cpus-quantity-radios__input {
	position: static !important;
	opacity: 1 !important;
	width: 1.1rem !important;
	height: 1.1rem !important;
	min-width: 1.1rem !important;
	margin: 0 0.15rem 0 0 !important;
	vertical-align: middle !important;
	clip: auto !important;
	clip-path: none !important;
	overflow: visible !important;
	accent-color: var(--wc-cpus-accent, #e91e8c);
	-webkit-appearance: auto !important;
	appearance: auto !important;
}

.wc-cpus-quantity-table__row--recommended {
	background: #fdf2f8 !important;
	box-shadow: inset 3px 0 0 var(--wc-cpus-accent, #e91e8c);
}

.wc-cpus-quantity-table__rec-badge {
	display: inline-block;
	margin-left: 0.4rem;
	padding: 0.1rem 0.5rem;
	font-size: 0.65rem;
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	white-space: nowrap;
	color: #fff;
	background: var(--wc-cpus-accent, #e91e8c);
	border-radius: 999px;
	vertical-align: middle;
}

/* Four columns: radio | quantity | each | total (--with-each; legacy --flat no longer hides Each) */
.wc-cpus-quantity-table--with-each,
.wc-cpus-quantity-table--flat {
	border-radius: 0;
	table-layout: fixed !important;
	width: 100% !important;
}

.wc-cpus-quantity-table--with-each thead th,
.wc-cpus-quantity-table--flat thead th {
	background: #fff;
	color: #374151;
	font-weight: 600;
	font-size: 0.8rem;
}

.wc-cpus-quantity-table--with-each thead th::before,
.wc-cpus-quantity-table--with-each thead th::after,
.wc-cpus-quantity-table--flat thead th::before,
.wc-cpus-quantity-table--flat thead th::after {
	content: none !important;
	display: none !important;
}

.wc-cpus-quantity-table--with-each thead th.wc-cpus-quantity-table__th-radio,
.wc-cpus-quantity-table--flat thead th.wc-cpus-quantity-table__th-radio {
	width: 2.75rem;
	min-width: 2.75rem;
	max-width: 3rem;
	text-align: center !important;
	padding-left: 0.5rem !important;
	padding-right: 0.25rem !important;
}

.wc-cpus-quantity-table--with-each thead th.wc-cpus-quantity-table__th-num,
.wc-cpus-quantity-table--flat thead th.wc-cpus-quantity-table__th-num {
	width: 28%;
	text-align: left !important;
}

.wc-cpus-quantity-table--with-each thead th.wc-cpus-quantity-table__th-each,
.wc-cpus-quantity-table--flat thead th.wc-cpus-quantity-table__th-each {
	width: 22%;
	text-align: right !important;
}

.wc-cpus-quantity-table--with-each thead th.wc-cpus-quantity-table__th-pack,
.wc-cpus-quantity-table--flat thead th.wc-cpus-quantity-table__th-pack {
	width: auto;
	min-width: 6.5rem;
	text-align: right !important;
	padding-right: 0.75rem !important;
}

.wc-cpus-quantity-table--with-each tbody tr:nth-child(even),
.wc-cpus-quantity-table--flat tbody tr:nth-child(even) {
	background: #fff;
}

.wc-cpus-quantity-table--with-each tbody td,
.wc-cpus-quantity-table--flat tbody td {
	border-bottom: 1px solid #ececec;
}

.wc-cpus-quantity-table--with-each tbody td.wc-cpus-quantity-table__radio,
.wc-cpus-quantity-table--flat tbody td.wc-cpus-quantity-table__radio {
	width: 2.75rem;
	min-width: 2.75rem;
	text-align: center !important;
	vertical-align: middle !important;
	padding-left: 0.5rem !important;
	padding-right: 0.25rem !important;
}

.wc-cpus-quantity-table--with-each tbody td.wc-cpus-quantity-table__num,
.wc-cpus-quantity-table--flat tbody td.wc-cpus-quantity-table__num {
	text-align: left !important;
	vertical-align: middle !important;
	padding-right: 0.5rem !important;
}

.wc-cpus-quantity-table--with-each tbody td.wc-cpus-quantity-table__each,
.wc-cpus-quantity-table--flat tbody td.wc-cpus-quantity-table__each {
	text-align: right !important;
	vertical-align: middle !important;
	font-variant-numeric: tabular-nums;
}

.wc-cpus-quantity-table--with-each tbody td.wc-cpus-quantity-table__pack,
.wc-cpus-quantity-table--flat tbody td.wc-cpus-quantity-table__pack {
	text-align: right !important;
	vertical-align: middle !important;
	padding-left: 0.4rem !important;
	padding-right: 0.75rem !important;
}

.wc-cpus-quantity-table--with-each .wc-cpus-quantity-table__pack-prices,
.wc-cpus-quantity-table--flat .wc-cpus-quantity-table__pack-prices {
	display: block;
	text-align: right !important;
}

.wc-cpus-variation-table--compact {
	width: 100%;
	margin-top: 1rem;
	border-collapse: collapse;
	font-size: 0.875rem;
}

.wc-cpus-variation-table--compact th,
.wc-cpus-variation-table--compact td {
	padding: 0.4rem 0.5rem;
	border: 1px solid #e5e7eb;
}

.wc-cpus-variation-table--compact thead th {
	background: #f9fafb;
	font-weight: 600;
	text-align: left;
}
