/* Product page: variation buttons, size buttons, size tabs */

/* Variations table — reset borders from WooCommerce/parent */
.ep-product form.variations_form table.variations {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	border: 0;
}

.ep-product form.variations_form table.variations tbody,
.ep-product form.variations_form table.variations tr,
.ep-product form.variations_form table.variations th,
.ep-product form.variations_form table.variations td {
	border: 0;
	box-shadow: none;
}

.ep-product form.variations_form hr {
	display: none;
	height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	visibility: hidden;
}

/* Variation row: label on top, buttons below */
.ep-variation__row--label th.label {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	white-space: normal;
	padding-right: 0;
	padding-bottom: 0.1rem;
	border: 0;
}

.ep-variation__row--buttons td.value {
	width: 100%;
	max-width: 100%;
	padding-left: 0;
	padding-top: 0;
	border-top: 0;
}

/* Size row: hide label row */
.ep-size__row--label {
	display: none;
}

.ep-size__row--buttons td.value {
	padding-top: 0;
}

/* ── Size system tabs (EU/RU/US/UK) ───────────────────────────────────── */
.ep-size-tabs {
	display: flex;
	border: var(--b);
	width: fit-content;
	margin-bottom: 12px;
}

.ep-size-tabs__tab {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	padding: 8px 14px;
	cursor: pointer;
	border: none;
	border-radius: 0;
	border-right: 1px solid var(--k);
	color: #bbb;
	background: none;
	font-family: var(--enclave-body-font);
	text-align: center;
	transition: all .1s;
	flex: none;
}

.ep-size-tabs__tab:last-child {
	border-right: none;
}

.ep-size-tabs__tab:hover:not(.ep-size-tabs__tab--active) {
	background: var(--g);
	color: var(--k);
}

.ep-size-tabs__tab--active {
	background: var(--k);
	color: var(--w);
}

.ep-size-tabs__tab--active::after {
	display: none;
}

/* ── Size grid ────────────────────────────────────────────────────────── */
.ep-size .ep-size__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	border-left: 1px solid var(--k);
	gap: 0;
	margin: 0;
	margin-bottom: 14px;
}

.ep-size .ep-size__grid > a:nth-child(1),
.ep-size .ep-size__grid > a:nth-child(2),
.ep-size .ep-size__grid > a:nth-child(3),
.ep-size .ep-size__grid > a:nth-child(4) {
	border-top: 1px solid var(--k) !important;
}

/* Одиночная плашка (simple-товар с одним размером) — не растягиваем на 4 колонки */
.ep-size .ep-size__grid--single {
	display: flex;
	flex-wrap: wrap;
}

.ep-size .ep-size__grid--single .ep-variation__btn {
	width: auto;
	min-width: 72px;
	max-width: 160px;
}

.ep-size .ep-size__grid .ep-variation__btn {
	position: relative;
	text-align: center;
	padding: 9px 6px;
	width: auto;
	height: auto;
	border-radius: 0;
	border: 0;
	border-right: 1px solid var(--k);
	border-bottom: 1px solid var(--k);
	background: var(--w);
	transition: all .1s;
	text-decoration: none !important;
}

/* Override default border/bg from base .ep-variation__btn */
.ep-size .ep-size__grid .ep-variation__btn:hover,
.ep-size .ep-size__grid .ep-variation__btn:focus {
	border-top: 0;
	border-left: 0;
	border-bottom: 1px solid var(--k);
	border-right: 1px solid var(--k);
	background: var(--w);
}

.ep-size .ep-size__grid .ep-variation__btn--current,
.ep-size .ep-size__grid .ep-variation__btn--current:hover,
.ep-size .ep-size__grid .ep-variation__btn--current:focus {
	background: var(--k);
	color: var(--w);
	border-color: var(--k);
}

.ep-size .ep-size__grid .ep-variation__btn--disabled {
	opacity: 0.3;
	pointer-events: none;
}

/* Size label inside grid */
.ep-size .ep-size__grid .ep-size__label {
	font-family: var(--enclave-heading-font);
	font-size: 12px;
	display: block;
	line-height: 1.2;
}

/* Size price inside grid */
.ep-size .ep-size__grid .ep-size__price {
	font-size: 11px;
	color: #bbb;
	margin-top: 1px;
	display: block;
	line-height: 1;
}

.ep-size .ep-size__grid .ep-variation__btn--current .ep-size__price,
.ep-size .ep-size__grid .ep-variation__btn--current .ep-size__price .woocommerce-Price-amount,
.ep-size .ep-size__grid .ep-variation__btn--current .ep-size__price bdi {
	color: rgba(255, 255, 255, .4);
}

/* ── Non-size button group (color/material etc.) ──────────────────────── */
.ep-variation__row--buttons:not(.ep-size__row--buttons) .ep-variation__group {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.35rem;
}

/* ── Shared button base (non-size variations) ─────────────────────────── */
.ep-variation__row--buttons:not(.ep-size__row--buttons) .ep-variation__btn {
	position: relative;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 88px;
	height: 40px;
	padding: 0;
	box-sizing: border-box;
	border: 2px solid transparent;
	border-radius: 4px;
	text-decoration: none;
	color: inherit;
	background: #f3f3f3;
	transition: border-color 0.15s, background 0.15s;
	font-size: 12px;
	line-height: 14px;
}

.ep-variation__row--buttons:not(.ep-size__row--buttons) .ep-variation__btn:hover,
.ep-variation__row--buttons:not(.ep-size__row--buttons) .ep-variation__btn:focus {
	border-color: #e2e2e2;
}

.ep-variation__row--buttons:not(.ep-size__row--buttons) .ep-variation__btn--current,
.ep-variation__row--buttons:not(.ep-size__row--buttons) .ep-variation__btn--current:hover,
.ep-variation__row--buttons:not(.ep-size__row--buttons) .ep-variation__btn--current:focus {
	border-color: #1A1A1A;
	background: #1A1A1A;
	color: #fff;
}

.ep-variation__row--buttons:not(.ep-size__row--buttons) .ep-variation__btn--disabled {
	opacity: 0.45;
	border-color: #ededed;
	background: #f3f3f3;
	color: #777;
	pointer-events: none;
	cursor: not-allowed;
}

/* ── Non-size variation label ─────────────────────────────────────────── */
.ep-variation__row--buttons:not(.ep-size__row--buttons) .ep-variation__label {
	font-weight: 400;
	font-size: 12px;
	line-height: 1.2;
}

.ep-variation__row--buttons:not(.ep-size__row--buttons) .ep-variation__btn--current .ep-variation__label {
	color: #fff;
}

/* ── Size price (shared outside grid — fallback) ──────────────────────── */
.ep-size__price {
	font-size: 8px;
	color: #bbb;
	opacity: .9;
	margin-top: 1px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	white-space: nowrap;
	width: 100%;
}

.ep-size__price .woocommerce-Price-amount,
.ep-size__price bdi {
	color: #bbb;
	font-size: 8px;
}

.ep-size__price-new {
	font-size: 11px;
	color: #aaa;
	text-decoration: none;
	font-style: normal;
}

.ep-size__price-old {
	position: absolute;
	top: 0px;
	right: -1px;
	font-size: 10px;
	font-weight: 600;
	color: #e74c3c;
	text-decoration: line-through;
	text-decoration-color: #e74c3c;
	text-decoration-thickness: 2px;
	/* background: #fff; */
	padding: 1px 4px;
	border-radius: 3px;
	line-height: 1;
	white-space: nowrap;
	/* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); */
}

/* Hide decimals in size price */
.ep-size__price .woocommerce-Price-decimal,
.ep-size__price .woocommerce-Price-decimal + span,
.ep-size__price .amount ~ .woocommerce-Price-currencySymbol,
.ep-size__price bdi::after {
	display: none;
}

/* Unavailable size */
.ep-size__price--unavailable {
	display: block;
	width: 100%;
	font-size: 8px;
	font-weight: 500;
	line-height: 1.2;
	color: #666;
	text-align: center;
	white-space: normal;
}

/* Current button: price white */
.ep-size .ep-variation__btn--current .ep-size__price,
.ep-size .ep-variation__btn--current .ep-size__price .woocommerce-Price-amount,
.ep-size .ep-variation__btn--current .ep-size__price .woocommerce-Price-amount.amount,
.ep-size .ep-variation__btn--current .ep-size__price bdi,
.ep-size .ep-variation__btn--current .ep-size__price .woocommerce-Price-currencySymbol {
	color: rgba(255, 255, 255, 0.4);
}

.ep-size .ep-variation__btn--current .ep-size__price--unavailable {
	color: rgba(255, 255, 255, 0.88);
}

.ep-size .ep-variation__btn--current .ep-size__price-new {
	color: rgba(255, 255, 255, 0.9);
}

.ep-size .ep-variation__btn--current .ep-size__price-old {
	color: rgba(255, 255, 255, 0.6);
	background: rgba(0, 0, 0, 0.4);
}

/* One-size (simple product) */
.ep-size--one {
	margin: 1rem 0;
	padding: 12px 14px;
	background: var(--g);
	border: var(--b);
	font-size: 12px;
	color: #888;
	margin-bottom: 14px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ep-size--one .ep-variation__btn {
	display: contents;
	pointer-events: none;
	cursor: default;
	border: 0;
	border-radius: 0;
	background: none;
	color: inherit;
	width: auto;
	height: auto;
	padding: 0;
	text-decoration: none !important;
}

.ep-size--one .ep-size__label {
	font-family: var(--enclave-body-font);
	font-size: 12px;
	font-weight: 500;
	color: var(--k);
}

.ep-size--one .ep-size__price {
	font-size: 11px;
	color: #888;
	margin-left: auto;
}

.ep-size--one .ep-size__price .woocommerce-Price-amount,
.ep-size--one .ep-size__price bdi {
	color: #888;
	font-size: 11px;
}

/* Always show variation cart buttons (before size selection) */
.single-product .single_variation_wrap {
	display: block !important;
}

/* Hidden WooCommerce variation info block (sr-only — bypasses inline display:block from WC JS) */
.ep-product .single_variation_wrap .woocommerce-variation {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	padding: 0;
	margin: -1px;
	border: 0;
}

/* Screen-reader only select */
.ep-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 640px) {
	.ep-product form.variations_form table.variations th.label {
		width: auto;
		min-width: 0;
		white-space: normal;
	}
}
