/**
 * JINCHI GLOBAL B2B 2.6.13 — per-variation FOB tiers.
 * Edit labels in JINCHI Settings (see README). Do not change --jc-logo / #7EBDFD.
 */

/* Prevent a flash of the parent (mixed) price table on variable products
   until jc-variation-tiers.js marks the block ready. */
.product-type-variable .jc-b2b table.jc-tiers,
.product-type-variable .jc-b2b .jc-por,
.product-type-variable .jc-b2b .jc-moq,
.product-type-variable .jc-b2b .jc-qty,
.product-type-variable .jc-b2b .jc-qty__warn {
	display: none;
}
.product-type-variable .jc-b2b.is-tiers-ready table.jc-tiers { display: table; }
.product-type-variable .jc-b2b.is-tiers-ready .jc-moq { display: block; }
.product-type-variable .jc-b2b.is-tiers-ready .jc-qty { display: flex; }
.product-type-variable .jc-b2b.is-tiers-ready .jc-qty__warn { display: block; }
.product-type-variable .jc-b2b.is-tiers-ready .jc-por { display: block; }

.jc-size-picker {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	margin: 0 0 14px;
}
.jc-size-picker__label {
	flex: 0 0 100%;
	margin: 0;
	color: var(--jc-heading, #1D2A31);
	font-size: 14px;
	font-weight: 600;
}
.jc-size-picker__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	width: 100%;
}
.jc-size-picker__list > li {
	display: block;
	margin: 0;
	padding: 0;
	min-width: 0;
	list-style: none;
}
.jc-size-picker__list > li::marker {
	content: none;
	display: none;
}
.jc-size-picker .jc-chip {
	cursor: pointer;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	justify-content: center;
	border: 1px solid var(--jc-border, #D9E0E6);
	background: var(--jc-bg, #fff);
	color: var(--jc-text, #1D2A31);
	font: inherit;
	font-size: 13.5px;
	font-weight: 500;
}
.jc-size-picker .jc-chip.is-active {
	border-color: var(--jc-brand, #1A64B3);
	background: var(--jc-brand, #1A64B3);
	color: #fff;
}

.jc-tiers-prompt {
	margin: 0 0 12px;
	padding: 12px 14px;
	border-radius: 8px;
	border: 1px solid #7EBDFD;
	border-left: 4px solid #7EBDFD;
	background: var(--jc-tint, #EAF4FF);
	color: var(--jc-heading, #1D2A31);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.45;
}

/* Empty states stay out of view (no placeholder copy). */
.jc-b2b .jc-tiers[hidden],
.jc-b2b .jc-moq[hidden],
.jc-b2b .jc-por[hidden],
.jc-b2b .jc-qty[hidden],
.jc-b2b .jc-qty__warn[hidden],
.jc-b2b .jc-tiers-prompt[hidden],
.jc-b2b .jc-size-picker[hidden] {
	display: none !important;
}

/* Terms line sits above the table (display:flex on <caption> falls into the
   table body in Chromium). Same type style as the live .jc-tiers caption. */
.jc-tiers-wrap { margin: 4px 0 0; }
.jc-tiers-head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	column-gap: 16px;
	row-gap: 4px;
	padding: 0 0 6px;
	color: var(--jc-muted, #4A5A64);
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: .04em;
	text-align: left;
	text-transform: uppercase;
}
.jc-tiers-head .jc-tiers__hint {
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	padding-left: 0;
}
.jc-b2b .jc-tiers-wrap[hidden],
.jc-b2b .jc-tiers-head[hidden] { display: none !important; }
.product-type-variable .jc-b2b .jc-tiers-wrap { display: none; }
.product-type-variable .jc-b2b.is-tiers-ready .jc-tiers-wrap { display: block; }
.product-type-variable .jc-b2b.is-tiers-ready .jc-tiers-wrap[hidden] { display: none !important; }

/* .jc-b2b is reused as a hook on .jc60-info; do not paint the old B2B card
   around the whole info column (title, spec box and buttons). */
.jc60-info.jc-b2b,
.jc60-info.jc-b2b.jc-scope {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
}

/* --------------------------------------------------------------------------
   jc60 product page (v2.6.0 layout): picker lives in the Sizes row,
   prices live in .jc60-spec__tiers. Keep the look inside the spec box.
   -------------------------------------------------------------------------- */
.jc-has-variation-tiers .jc60-spec__sizes-slot { display: none; }
.jc60-info.is-tiers-ready .jc60-spec__sizes-slot { display: block; }
.jc60-info.is-tiers-ready .jc60-spec__sizes-text { display: none !important; }

.jc60-spec__row--sizes {
	display: block;
	align-items: start;
	padding-top: 10px;
	padding-bottom: 10px;
}
.jc60-spec__row--sizes dt {
	margin: 0 0 8px;
}
.jc60-spec__row--sizes dd {
	font-weight: 500;
}
.jc60-spec .jc-size-picker,
.jc60-spec .jc-size-picker--in-spec {
	margin: 0;
}
.jc60-spec .jc-size-picker__label[hidden] { display: none !important; }
.jc60-spec .jc-size-picker__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	width: 100%;
	list-style: none;
}
.jc60-spec .jc-size-picker .jc-chip {
	font-size: 13px;
	min-height: 32px;
	padding: 5px 11px;
	border-radius: 8px;
	border: 1px solid var(--jc-border, #D9E0E6);
	white-space: nowrap;
	background: #fff;
	color: var(--jc60-ink, #0f2742);
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	justify-content: center;
}

.jc60-spec .jc-size-picker .jc-chip.is-active,
.jc60-spec .jc-size-picker .jc-chip.is-active:hover,
.jc60-spec .jc-size-picker .jc-chip.is-active:focus {
	border-color: var(--jc-brand, #1A64B3);
	background: var(--jc-brand, #1A64B3);
	color: #fff;
}

/* Unselected chips use a subtle gray border, not the #7EBDFD outline.
   The selected chip stays the solid filled brand state. */
.jc-b2b--variable .jc-size-picker .jc-chip:not(.is-active),
.jc60-spec .jc-size-picker .jc-chip:not(.is-active) {
	border: 1px solid var(--jc-border, #D9E0E6);
	background: #fff;
	color: var(--jc60-ink, #0f2742);
}

.jc60-spec__tiers:empty { margin: 0; }
.jc60-info.is-tiers-ready .jc60-spec__tiers {
	margin-top: 12px;
}
.jc60-spec__tiers .jc-tiers-prompt {
	margin: 0;
	padding: 12px 14px;
	border-radius: 8px;
	border: 1px solid #7EBDFD;
	border-left: 4px solid #7EBDFD;
	background: var(--jc60-light, #EAF4FF);
	color: var(--jc60-ink, #0f2742);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.45;
}
.jc60-spec__tiers .jc-moq {
	margin: 0 0 10px;
	color: var(--jc60-ink, #0f2742) !important;
	font-size: 14.5px;
}
.jc60-spec__tiers .jc-tiers-wrap {
	margin: 0 0 8px;
}
.jc60-spec__tiers .jc-tiers-head {
	color: var(--jc60-muted, #5b6b7b);
}
.jc60-spec__tiers table.jc-tiers {
	width: 100%;
	margin: 0;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
}
.jc60-spec__tiers .jc-qty {
	margin: 12px 0 0;
	color: var(--jc60-ink, #0f2742);
}
.jc60-spec__tiers .jc-qty input {
	background: #fff;
	border-color: var(--jc60-line, #dde7f2);
}
.jc60-spec__tiers .jc-qty__warn { margin: 8px 0 0; }

/* Hide a leftover parent "Price on request" in the specifications box.
   A selected variation with no _jc_tiers still uses .jc-por--variation. */
.jc-has-variation-tiers .jc60-spec .jc-por,
.product-type-variable.jc-has-variation-tiers .jc60-spec .jc-por {
	display: none !important;
}
.jc-has-variation-tiers .jc60-info.is-tiers-ready .jc60-spec__tiers .jc-por--variation:not([hidden]),
.product-type-variable.jc-has-variation-tiers .jc60-info.is-tiers-ready .jc60-spec__tiers .jc-por--variation:not([hidden]),
.product-type-variable .jc-b2b.is-tiers-ready .jc-por--variation:not([hidden]) {
	display: block !important;
}
.jc60-spec__tiers .jc-por--variation {
	margin: 8px 0 0;
	font-weight: 600;
}

@media (max-width: 767px) {
	.jc60-spec__row--sizes { padding-top: 8px; }
	.jc60-spec .jc-size-picker__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.jc60-spec .jc-size-picker .jc-chip {
		font-size: 12.5px;
		min-height: 30px;
		padding: 4px 8px;
		white-space: nowrap;
	}
	.jc60-spec__tiers .jc-tiers-prompt {
		padding: 10px 12px;
		font-size: 14.5px;
	}
	.jc60-spec__tiers .jc-tiers-head {
		font-size: 11.5px;
	}
	.jc60-spec__tiers .jc-qty {
		flex-wrap: wrap;
	}
}
