/* Jewelry Product Options – Frontend (WCBoost-inspired) */

.jpo-variation-row {
	margin-bottom: 1.25em;
}

.jpo-variation-row__label {
	display: block;
	margin-bottom: 0.5em;
	font-weight: 600;
	font-size: 0.875rem;
	color: #111;
}

.jpo-variation-row__selected {
	font-weight: 500;
	color: #666;
}

.jpo-variation-swatches__inner > select {
	display: none !important;
}

.jpo-linked-variations__select {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.jpo-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: var(--jpo-swatch-gap, 10px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.jpo-swatches--ring-size,
.jpo-swatches--carat {
	display: grid;
	grid-template-columns: repeat(var(--jpo-grid-cols, 6), minmax(0, 1fr));
}

.jpo-swatch {
	appearance: none;
	border: none;
	background: #fff;
	cursor: pointer;
	padding: 0;
	line-height: 1.2;
	transition: box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.jpo-swatch:hover,
.jpo-swatch:focus-visible {
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
	outline: none;
}

.jpo-swatch.is-selected,
.jpo-swatch.selected {
	box-shadow: 0 0 0 2px var(--jpo-selected-border, #000);
}

.jpo-swatch.is-disabled,
.jpo-swatch.disabled {
	opacity: var(--jpo-disabled-opacity, 0.35);
	cursor: not-allowed;
	position: relative;
}

.jpo-swatch.is-disabled::after,
.jpo-swatch.disabled::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: calc(100% + 6px);
	height: 2px;
	background: #e53935;
	transform: translate(-50%, -50%) rotate(-45deg);
	border-radius: 1px;
	pointer-events: none;
}

.jpo-swatch--text {
	min-width: var(--jpo-swatch-size, 44px);
	min-height: 44px;
	width: auto;
	height: auto;
	border-radius: var(--jpo-text-radius, 4px);
	padding: 0.65em 1.15em;
	font-size: 0.875rem;
	font-weight: 600;
	color: #222;
	background: #fff;
}

.jpo-swatch--carat {
	min-height: 44px;
	padding: 0.65em 1.15em;
	font-size: 0.875rem;
	font-weight: 600;
	border-radius: var(--jpo-text-radius, 4px);
	color: #222;
	background: #fff;
}

.jpo-swatch__label {
	display: inline-block;
	line-height: 1.2;
}

.jpo-variation-swatches--text_buttons .jpo-swatch--text.selected,
.jpo-variation-swatches--text_buttons .jpo-swatch--text.is-selected {
	background: rgba(0, 0, 0, 0.06);
}

.jpo-swatch--color,
.jpo-swatch--metal {
	width: var(--jpo-swatch-size, 44px);
	height: var(--jpo-swatch-size, 44px);
	border-radius: var(--jpo-border-radius, 50%);
	background: var(--jpo-swatch-bg, #ccc);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.jpo-swatch--metal .jpo-swatch__label {
	font-size: 0.75rem;
	font-weight: 700;
	color: #111;
	text-shadow: 0 0 3px rgba(255, 255, 255, 0.95);
	max-width: 92%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.jpo-swatch--shape {
	width: var(--jpo-swatch-size, 44px);
	height: var(--jpo-swatch-size, 44px);
	border-radius: var(--jpo-text-radius, 4px);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px;
}

.jpo-swatch__icon {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.jpo-linked-variations__mount {
	margin-bottom: 1em;
}

/* Sticky bar uses pointer-events:none until active — keep swatches clickable */
.glozin-sticky-add-to-cart.pe-none .jpo-linked-variations__mount,
.glozin-sticky-add-to-cart.pe-none .jpo-variation-swatches,
.glozin-sticky-add-to-cart.pe-none .jpo-swatch {
	pointer-events: auto;
}

.glozin-sticky-atc__variations .jpo-linked-variations__mount {
	margin-bottom: 0.75rem;
}

.jpo-variation-swatches--metal_selector .jpo-swatches--metal {
	gap: 8px;
}

.jpo-variation-swatches--metal_selector .jpo-swatch--metal {
	width: 56px;
	height: 56px;
}

.jpo-variation-swatches--metal_selector .jpo-swatch--metal .jpo-swatch__label {
	font-size: 0.8125rem;
	line-height: 1.15;
	text-align: center;
	white-space: normal;
	display: block;
	overflow: visible;
	text-overflow: unset;
	-webkit-line-clamp: unset;
	-webkit-box-orient: unset;
}

/* ── Glozin / WooCommerce theme compatibility ── */

.single-product div.product table.variations .jpo-variation-row__label,
.single-product div.product table.variations .jpo-variation-row__selected {
	display: none;
}

.single-product div.product table.variations .jpo-swatch,
.glozin-sticky-add-to-cart .jpo-swatch {
	font-family: inherit;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.single-product div.product table.variations .jpo-swatch--text,
.single-product div.product table.variations .jpo-swatch--carat {
	padding: 0 20px;
	min-height: 44px;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--gz-color-base, #111);
	background: #fff !important;
}

.single-product div.product table.variations .jpo-swatch--text:hover:not(.disabled):not(.is-disabled),
.single-product div.product table.variations .jpo-swatch--carat:hover:not(.disabled):not(.is-disabled),
.single-product div.product table.variations .jpo-swatch--text.is-selected,
.single-product div.product table.variations .jpo-swatch--text.selected,
.single-product div.product table.variations .jpo-swatch--carat.is-selected,
.single-product div.product table.variations .jpo-swatch--carat.selected {
	background-color: var(--gz-color-dark, #111) !important;
	color: var(--gz-color-light, #fff) !important;
	box-shadow: 0 0 0 2px var(--gz-color-dark, #111);
}

.single-product div.product table.variations .jpo-swatch--text:hover .jpo-swatch__label,
.single-product div.product table.variations .jpo-swatch--carat:hover .jpo-swatch__label,
.single-product div.product table.variations .jpo-swatch--text.is-selected .jpo-swatch__label,
.single-product div.product table.variations .jpo-swatch--carat.is-selected .jpo-swatch__label {
	color: inherit;
}

.single-product div.product table.variations .jpo-swatch--metal,
.glozin-sticky-add-to-cart .jpo-swatch--metal {
	background-color: var(--jpo-swatch-bg, #ccc) !important;
}

.single-product div.product table.variations .jpo-swatch--metal:hover:not(.disabled):not(.is-disabled),
.glozin-sticky-add-to-cart .jpo-swatch--metal:hover:not(.disabled):not(.is-disabled) {
	background-color: var(--jpo-swatch-bg, #ccc) !important;
	filter: brightness(0.92);
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
}

.single-product div.product table.variations .jpo-swatch--metal.is-selected,
.single-product div.product table.variations .jpo-swatch--metal.selected,
.glozin-sticky-add-to-cart .jpo-swatch--metal.is-selected,
.glozin-sticky-add-to-cart .jpo-swatch--metal.selected {
	box-shadow: 0 0 0 2px var(--jpo-selected-border, #000);
}

.single-product div.product table.variations .jpo-swatch--color,
.glozin-sticky-add-to-cart .jpo-swatch--color {
	background: var(--jpo-swatch-bg, #ccc) !important;
}

.single-product div.product table.variations .jpo-swatch--color:hover:not(.disabled):not(.is-disabled),
.glozin-sticky-add-to-cart .jpo-swatch--color:hover:not(.disabled):not(.is-disabled) {
	background: var(--jpo-swatch-bg, #ccc) !important;
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
}

/* Info cards */
.jpo-info-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
	gap: 12px;
	margin: 1em 0 1.5em;
}

.jpo-info-card {
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	padding: 12px;
	text-align: center;
	background: #fafafa;
}

.jpo-info-card__label {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #666;
	margin-bottom: 4px;
}

.jpo-info-card__value {
	display: block;
	font-size: 1rem;
	font-weight: 600;
	color: #111;
}
