/**
 * POD Kits configurator.
 *
 * Theme-agnostic: body text inherits the surrounding colour and the panel
 * chrome is derived from it, so the configurator reads correctly on light and
 * dark themes without configuration. Selected states use an explicit accent so
 * they always have real contrast rather than relying on a colour we can't know.
 *
 * To rebrand:
 *
 *   .pod-kit { --pk-accent: #c8102e; --pk-accent-contrast: #fff; --pk-radius: 4px; }
 */

.pod-kit {
	--pk-accent: #c8102e;
	--pk-accent-contrast: #ffffff;
	--pk-badge: #0f7b3f;
	--pk-danger: #ff8a80;
	--pk-radius: 10px;
	--pk-gap: 18px;

	/* Neutral greys, upgraded to currentColor-derived values below where
	   color-mix is available. Both cannot be declared together: custom
	   properties accept any token and only fail on substitution, so an
	   unsupported value would break the rule instead of falling back. */
	--pk-line: rgba(128, 128, 128, 0.42);
	--pk-line-soft: rgba(128, 128, 128, 0.24);
	--pk-veil: rgba(128, 128, 128, 0.1);

	margin: 0 0 1.5em;
	color: inherit;
}

@supports (color: color-mix(in srgb, currentColor 24%, transparent)) {
	.pod-kit {
		--pk-line: color-mix(in srgb, currentColor 45%, transparent);
		--pk-line-soft: color-mix(in srgb, currentColor 24%, transparent);
		--pk-veil: color-mix(in srgb, currentColor 7%, transparent);
	}
}

.pod-kit *,
.pod-kit *::before,
.pod-kit *::after {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------------------
   Mode selector
   --------------------------------------------------------------------------- */

.pod-kit-modes {
	border: 0;
	margin: 0 0 var(--pk-gap);
	padding: 0;
}

.pod-kit-modes__legend {
	display: block;
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	margin: 0 0 8px;
	padding: 0;
	text-transform: uppercase;
	color: inherit;
	opacity: 0.75;
}

.pod-kit-modes__track {
	display: grid;
	gap: 8px;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.pod-kit-mode {
	position: relative;
	display: block;
	cursor: pointer;
	margin: 0;
}

.pod-kit-mode input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.pod-kit-mode__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-height: 100%;
	padding: 12px 14px;
	border: 2px solid var(--pk-line-soft);
	border-radius: var(--pk-radius);
	background: var(--pk-veil);
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pod-kit-mode__label {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	font-weight: 700;
	line-height: 1.25;
	color: inherit;
}

.pod-kit-mode__meta {
	font-size: 0.9rem;
	font-variant-numeric: tabular-nums;
	opacity: 0.8;
}

.pod-kit-mode:hover .pod-kit-mode__body {
	border-color: var(--pk-line);
}

.pod-kit-mode input:checked + .pod-kit-mode__body {
	border-color: var(--pk-accent);
	background: var(--pk-accent);
	color: var(--pk-accent-contrast);
}

.pod-kit-mode input:checked + .pod-kit-mode__body .pod-kit-mode__meta {
	opacity: 1;
}

.pod-kit-mode input:focus-visible + .pod-kit-mode__body {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.pod-kit-badge {
	display: inline-block;
	padding: 2px 7px;
	border-radius: 999px;
	background: var(--pk-badge);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.5;
	text-transform: uppercase;
	white-space: nowrap;
}

.pod-kit-badge--inline {
	vertical-align: middle;
	margin-left: 6px;
}

/* ---------------------------------------------------------------------------
   Components
   --------------------------------------------------------------------------- */

.pod-kit-items {
	display: grid;
	gap: 10px;
	margin: 0 0 var(--pk-gap);
}

.pod-kit-item {
	border: 1px solid var(--pk-line-soft);
	border-radius: var(--pk-radius);
	padding: 14px 16px;
	transition: opacity 0.18s ease, border-color 0.18s ease;
}

.pod-kit-item.is-muted {
	opacity: 0.45;
}

.pod-kit-item.is-muted .pod-kit-pills,
.pod-kit-item.is-muted .pod-kit-item__attrs {
	pointer-events: none;
}

.pod-kit-item.is-active {
	border-color: var(--pk-line);
}

.pod-kit-item__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.pod-kit-item__title {
	margin: 0;
	font-size: 1.02rem;
	line-height: 1.3;
	color: inherit;
}

.pod-kit-item__price {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	opacity: 0.8;
}

/* The component's own name. Deliberately not a link: sending someone to the
   individual product page mid-configuration loses their selections. */
.pod-kit-item__name {
	margin: 2px 0 12px;
	font-size: 0.86rem;
	opacity: 0.7;
}

.pod-kit-item__attrs {
	display: grid;
	gap: 12px;
}

.pod-kit-attr__name {
	display: block;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin-bottom: 7px;
	text-transform: uppercase;
	opacity: 0.75;
}

.pod-kit-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.pod-kit-pill {
	position: relative;
	margin: 0;
	cursor: pointer;
}

.pod-kit-pill input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.pod-kit-pill__text {
	display: inline-block;
	min-width: 46px;
	padding: 10px 13px;
	border: 2px solid var(--pk-line-soft);
	border-radius: var(--pk-radius);
	background: var(--pk-veil);
	font-size: 0.92rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	color: inherit;
	transition: border-color 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}

.pod-kit-pill:hover .pod-kit-pill__text {
	border-color: var(--pk-line);
}

.pod-kit-pill input:checked + .pod-kit-pill__text {
	border-color: var(--pk-accent);
	background: var(--pk-accent);
	color: var(--pk-accent-contrast);
}

.pod-kit-pill input:focus-visible + .pod-kit-pill__text {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.pod-kit-pill.is-unavailable {
	cursor: not-allowed;
}

.pod-kit-pill.is-unavailable .pod-kit-pill__text {
	position: relative;
	border-style: dashed;
	background: transparent;
	opacity: 0.45;
}

.pod-kit-pill.is-unavailable .pod-kit-pill__text::after {
	content: "";
	position: absolute;
	left: 8%;
	right: 8%;
	top: 50%;
	height: 2px;
	background: currentColor;
	transform: rotate(-12deg);
}

.pod-kit-item__note:empty {
	display: none;
}

.pod-kit-item__note {
	margin: 8px 0 0;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--pk-danger);
}

/* ---------------------------------------------------------------------------
   Selection preview
   --------------------------------------------------------------------------- */

.pod-kit-preview {
	margin: 0 0 var(--pk-gap);
}

.pod-kit-preview__label {
	display: block;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin-bottom: 8px;
	text-transform: uppercase;
	opacity: 0.75;
}

.pod-kit-preview__row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.pod-kit-preview__item {
	margin: 0;
	width: 84px;
	text-align: center;
}

.pod-kit-preview__item img {
	display: block;
	width: 100%;
	height: 84px;
	object-fit: cover;
	border: 1px solid var(--pk-line-soft);
	border-radius: var(--pk-radius);
	background: #fff;
}

.pod-kit-preview__item figcaption {
	margin-top: 5px;
	font-size: 0.72rem;
	opacity: 0.7;
}

/* ---------------------------------------------------------------------------
   Summary and buy
   --------------------------------------------------------------------------- */

.pod-kit-summary {
	display: grid;
	gap: 12px;
}

.pod-kit-total {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 10px;
}

.pod-kit-total__now {
	font-size: 1.7rem;
	font-weight: 800;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
	color: inherit;
}

.pod-kit-total__compare {
	text-decoration: line-through;
	font-variant-numeric: tabular-nums;
	opacity: 0.6;
}

.pod-kit-total__save {
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--pk-badge);
	color: #fff;
	font-size: 0.8rem;
	font-weight: 700;
}

.pod-kit-buy {
	display: flex;
	align-items: stretch;
	flex-wrap: wrap;
	gap: 10px;
}

.pod-kit-qty .qty {
	width: 5.5em;
	min-height: 46px;
	padding: 8px 10px;
	border: 1px solid var(--pk-line);
	border-radius: var(--pk-radius);
	background: #fff;
	color: #14171f;
	text-align: center;
	font-weight: 700;
}

.pod-kit-submit {
	min-height: 46px;
}

.pod-kit-submit[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

.pod-kit-submit.is-busy {
	cursor: progress;
}

.pod-kit-message {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--pk-danger);
}

.pod-kit-message:not(.is-visible) {
	display: none;
}

/* ---------------------------------------------------------------------------
   Cart grouping
   --------------------------------------------------------------------------- */

.pod-kit-cart-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
}

.pod-kit-cart-badge,
.pod-kit-cart-role {
	display: inline-block;
	padding: 1px 7px;
	border-radius: 999px;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	line-height: 1.6;
	text-transform: uppercase;
}

.pod-kit-cart-badge {
	background: var(--pk-accent, #c8102e);
	color: var(--pk-accent-contrast, #fff);
}

.pod-kit-cart-role {
	border: 1px solid rgba(128, 128, 128, 0.4);
	opacity: 0.85;
}

.pod-kit-cart-qty {
	display: inline-block;
	font-size: 0.85rem;
	white-space: nowrap;
	opacity: 0.7;
}

.pod-kit-cart-linked {
	display: inline-block;
	opacity: 0.45;
}

tr.pod-kit-row--linked > td,
tr.pod-kit-row--linked > th {
	border-top-style: dashed;
}

/* ---------------------------------------------------------------------------
   Motion
   --------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.pod-kit *,
	.pod-kit *::before,
	.pod-kit *::after {
		transition-duration: 0.01ms !important;
	}
}

/* ---------------------------------------------------------------------------
   Pick-one mode
   --------------------------------------------------------------------------- */

.pod-kit-pick__group {
	border: 0;
	margin: 0 0 var(--pk-gap);
	padding: 0;
}

.pod-kit-pick__legend {
	display: block;
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	margin: 0 0 9px;
	padding: 0;
	text-transform: uppercase;
	opacity: 0.75;
}

/* Five across, fixed rather than responsive.
   This was repeat(auto-fill, minmax(104px, 1fr)), which asks for as many 104px
   columns as fit. In a product summary column that only ever answered two, so a
   thirteen-design listing became a very tall stack. minmax(0, 1fr) rather than
   1fr because a bare 1fr floors at min-content, and a long unbroken design name
   would then push the columns wider than the container.

   The extra width this needs lives on .pod-kit--pick, not here, so the control
   row below lines up with it. See the wide pick layout at the end of this file. */
.pod-kit-designs {
	display: grid;
	gap: 6px;
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Phones give the summary the full page width, so the tiles have room to grow
   rather than needing to shrink. Three keeps them tappable. */
@media (max-width: 480px) {
	.pod-kit-designs {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.pod-kit-design {
	position: relative;
	margin: 0;
	cursor: pointer;
}

.pod-kit-design input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.pod-kit-design__body {
	display: block;
	padding: 4px;
	border: 2px solid var(--pk-line-soft);
	border-radius: var(--pk-radius);
	background: var(--pk-veil);
	transition: border-color 0.12s ease;
}

.pod-kit-design__thumb {
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: calc(var(--pk-radius) - 3px);
	overflow: hidden;
	background: #fff;
}

.pod-kit-design__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Clamped to two lines. A safety net rather than the primary fix: the design
   names themselves want to be short, because repeating the garment type on every
   tile of a listing that sells one garment type tells the shopper nothing. Only
   the visual is clipped, so the label a screen reader announces is still the full
   name.

   -webkit-box is not legacy here. Line clamping has no standardised longhand yet
   and every current browser still implements it through these properties. */
.pod-kit-design__name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: 5px;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	overflow-wrap: anywhere;
}

.pod-kit-design:hover .pod-kit-design__body {
	border-color: var(--pk-line);
}

.pod-kit-design input:checked + .pod-kit-design__body {
	border-color: var(--pk-accent);
	box-shadow: inset 0 0 0 2px var(--pk-accent);
}

.pod-kit-design input:focus-visible + .pod-kit-design__body {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.pod-kit-pick__colors,
.pod-kit-pick__attrs {
	margin: 0 0 var(--pk-gap);
}

.pod-kit-pick__attrs .pod-kit-attr + .pod-kit-attr {
	margin-top: 12px;
}

/* ---------------------------------------------------------------------------
   WIDE PICK LAYOUT

   The picker renders inside the product summary, which is the narrower of the
   two columns on a product page. A thirteen-design grid does not belong in it.
   So the whole picker is widened past its column and the controls underneath are
   laid out in one horizontal band: colour, then size, then price and add to cart.

   The extra width lives here, on the picker, rather than on .pod-kit-designs.
   Putting it on the grid alone would make the design tiles double width while the
   controls below stayed single width, and the two would not line up.

   Flex rather than grid on purpose. Colour arrives as either a kit-level block or
   a native product attribute depending on how the version was set up, and the
   block that is not in use is hidden. Hidden elements leave the flex flow
   entirely, so the remaining controls close the gap by themselves instead of
   needing a rule per combination.
   --------------------------------------------------------------------------- */

@media (min-width: 901px) {
	/* 200% suits a theme whose summary column is about half the row. A theme with
	   a wider summary sets --pk-pick-width (100% when the summary is already wide)
	   so the picker does not run past the page edge. */
	.pod-kit--pick {
		width: var(--pk-pick-width, 200%);
		max-width: var(--pk-pick-max-width, none);
	}

	.pod-kit--pick .pod-kit-form {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 16px 24px;
	}

	/* The design grid keeps its own row. */
	.pod-kit--pick .pod-kit-pick__group {
		flex: 1 0 100%;
		margin-bottom: 0;
	}

	/* Kit-level colour, when the version uses separate products per colour. */
	.pod-kit--pick .pod-kit-pick__colors {
		flex: 1 1 200px;
		margin-bottom: 0;
	}

	/* Native attributes. Colour and size arrive as siblings in here, so this
	   becomes a row of its own and each attribute takes a column. */
	.pod-kit--pick .pod-kit-pick__attrs {
		display: flex;
		flex: 3 1 420px;
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 16px 24px;
		margin-bottom: 0;
	}

	.pod-kit--pick .pod-kit-pick__attrs .pod-kit-attr {
		flex: 1 1 190px;
	}

	/* Overrides the stacking margin that applies in the narrow layout, where the
	   attributes sit one above the other. */
	.pod-kit--pick .pod-kit-pick__attrs .pod-kit-attr + .pod-kit-attr {
		margin-top: 0;
	}

	/* Price above the quantity and the button, at the end of the band. */
	.pod-kit--pick .pod-kit-summary {
		flex: 1 1 220px;
	}

	/* Status line drops below the band. order rather than a DOM change, so the
	   markup stays in a sensible reading order for anything not using this CSS. */
	.pod-kit--pick .pod-kit-item__note {
		flex: 1 0 100%;
		order: 99;
		margin: 0;
	}

	/* Six colour names and eleven sizes have to fit in a third of the band each,
	   so the pills come in a little. */
	.pod-kit--pick .pod-kit-pick__attrs .pod-kit-pills {
		gap: 6px;
	}

	/* hidden is a display:none, and the rules above must not resurrect it. */
	.pod-kit--pick .pod-kit-pick__colors[hidden],
	.pod-kit--pick .pod-kit-pick__attrs[hidden] {
		display: none;
	}
}

/* ---------------------------------------------------------------------------
   OWNER-ONLY WARNING

   Rendered on the storefront, visible only to a shop manager. Loud on purpose:
   it appears when the listing is broken for customers and working for the person
   looking at it, which is the one combination nobody catches by testing.
   --------------------------------------------------------------------------- */

.pod-kit-owner-warning {
	margin: 0 0 16px;
	padding: 12px 14px;
	border: 2px dashed #b32d2e;
	border-radius: var(--pk-radius);
	background: #fcf0f1;
	color: #7a1f20;
	font-size: 0.85rem;
	line-height: 1.5;
}

.pod-kit-owner-warning p {
	margin: 0 0 8px;
}

.pod-kit-owner-warning ul {
	margin: 0;
	padding-left: 1.2em;
	list-style: disc;
}

.pod-kit-owner-warning li + li {
	margin-top: 6px;
}

/* ---------------------------------------------------------------------------
   SINGLE-OPTION ATTRIBUTES AND SKU

   An attribute with one value is not a choice, so it is hidden. The SKU line
   matches the rest of the product meta: white label, yellow value.
   --------------------------------------------------------------------------- */
.pod-kit .pod-kit-attr[hidden],
.pod-kit-sku[hidden] {
	display: none !important;
}

.product_meta .pod-kit-sku,
.product_meta .pod-kit-sku .detail-label {
	color: #fff;
}

.product_meta .pod-kit-sku .pod-kit-sku__value {
	color: gold;
}
