/**
 * Scan-mode toggle control.
 *
 * Two placements share one look: under the WBW filter panel on Playtest
 * Cards archives, and above add-to-cart on a Playtest Cards product page.
 * The control ships hidden and is revealed by scan-toggle.js, so it never
 * flashes into view on a page where it does not apply.
 */

.pcs-scan-toggle[hidden] {
	display: none;
}

.pcs-scan-toggle {
	margin: 0 0 1.25rem;
}

.pcs-scan-toggle__label {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	cursor: pointer;
	margin: 0;
	font-weight: 600;
	line-height: 1.3;
}

/* The real checkbox stays focusable and screen-reader visible, but is
   drawn by the track/thumb below. */
.pcs-scan-toggle__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.pcs-scan-toggle__track {
	flex: 0 0 auto;
	position: relative;
	width: 2.4rem;
	height: 1.3rem;
	border-radius: 1rem;
	background: rgba(0, 0, 0, 0.28);
	transition: background 0.18s ease;
}

.pcs-scan-toggle__thumb {
	position: absolute;
	top: 0.15rem;
	left: 0.15rem;
	width: 1rem;
	height: 1rem;
	border-radius: 50%;
	/* Parchment, not white, to stay on the site palette. */
	background: #f9dfbe;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
	transition: transform 0.18s ease;
}

.pcs-scan-toggle__input:checked + .pcs-scan-toggle__track {
	background: #b4762a;
}

.pcs-scan-toggle__input:checked + .pcs-scan-toggle__track .pcs-scan-toggle__thumb {
	transform: translateX(1.1rem);
}

.pcs-scan-toggle__input:focus-visible + .pcs-scan-toggle__track {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.pcs-scan-toggle__hint {
	margin: 0.4rem 0 0;
	font-size: 0.8em;
	line-height: 1.35;
	opacity: 0.75;
}

/* Sits in the filter column, which collapses on mobile — keep the control
   in the normal flow underneath rather than floating it, so it can never
   overlap WBW's collapse handle or the tile grid below. */
.pcs-scan-toggle--global {
	padding-top: 1rem;
	border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.pcs-scan-toggle--product {
	margin-top: 1rem;
}

/**
 * Containers built around square vendor photos, holding a 5:7 scan.
 *
 * The variation picker's thumbnail box is a 48px square with object-fit:
 * cover, which is exactly right for a square photo and slices the top and
 * bottom off a card face. Only elements actually showing a scan are
 * switched to `contain`, so a variation with no scan keeps filling its box
 * as before.
 *
 * The selector mirrors astra-child's own
 * (.woocommerce .woovr-variation-radio .woovr-variation-image img in
 * main.min.css) with the attribute added. !important is required because
 * that rule declares `object-fit: cover !important` — an important
 * declaration can only be outranked by another one, so specificity alone
 * loses no matter how it is written. It is answering an !important here,
 * not reaching for one.
 */
.woocommerce .woovr-variation-radio .woovr-variation-image img[data-pcs-scan-active] {
	object-fit: contain !important;
}
