/**
 * Cool Bear — Configurator panel shell (Q12: configurator-first).
 *
 * The configurator sits in the buy-box column on desktop, full-width on
 * mobile, and is the FIRST interactive element on every PDP after the
 * gallery. Component CSS for individual widgets (spring-rate slider,
 * top-mount picker, swatches, pad-compound) is split into sibling files.
 *
 * JS implementation lives in plan 08-06 (separate agent). This file only
 * provides server-rendered structural CSS — markup interactions degrade
 * gracefully without JS (HTML form submit posts to add-to-cart).
 */

/* -------------------------------------------------------------------------
 *  Outer panel
 * ------------------------------------------------------------------------- */
.cb-configurator {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	padding: var(--wp--preset--spacing--40);
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
	box-shadow: var(--wp--preset--shadow--subtle);
}

@media (min-width: 1024px) {
	.cb-configurator {
		padding: var(--wp--preset--spacing--50);
		gap: var(--wp--preset--spacing--50);
	}
}

.cb-configurator__title {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--text-muted);
	margin: 0 0 var(--wp--preset--spacing--20);
}

/* -------------------------------------------------------------------------
 *  Field group — label + control + helper
 * ------------------------------------------------------------------------- */
.cb-field {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
}

.cb-field__label {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--wp--preset--spacing--30);
	font-weight: 600;
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--body);
}

.cb-field__label-meta {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--text-muted);
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.cb-field__hint {
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--small);
	margin: 0;
	line-height: 1.5;
}

.cb-field__error {
	color: var(--wp--preset--color--destructive);
	font-size: var(--wp--preset--font-size--small);
	margin: 0;
	display: none;
}

.cb-field--has-error .cb-field__error { display: block; }

/* -------------------------------------------------------------------------
 *  Generic input — number / text
 * ------------------------------------------------------------------------- */
.cb-input {
	width: 100%;
	padding: 12px 14px;
	background-color: var(--wp--preset--color--surface-sunken);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 6px;
	color: var(--wp--preset--color--text);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--body);
	transition: border-color 150ms ease, box-shadow 150ms ease;
	min-height: 44px;
}

.cb-input::placeholder { color: var(--wp--preset--color--text-subtle); }

.cb-input:hover { border-color: var(--wp--preset--color--border-strong); }

.cb-input:focus,
.cb-input:focus-visible {
	outline: none;
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 3px var(--wp--preset--color--accent-subtle);
}

.cb-input:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.cb-field--has-error .cb-input {
	border-color: var(--wp--preset--color--destructive);
}

/* Number input — strip browser spinners on touch */
.cb-input[type="number"]::-webkit-outer-spin-button,
.cb-input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.cb-input[type="number"] { -moz-appearance: textfield; }

/* -------------------------------------------------------------------------
 *  Selectable card (radio cards for top-mount, pad compound, etc.)
 * ------------------------------------------------------------------------- */
.cb-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: var(--wp--preset--spacing--20);
}

.cb-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: var(--wp--preset--spacing--30);
	background-color: var(--wp--preset--color--surface-sunken);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 6px;
	cursor: pointer;
	transition: border-color 150ms ease, background-color 150ms ease;
	min-height: 64px;
}

.cb-card input[type="radio"],
.cb-card input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.cb-card:hover { border-color: var(--wp--preset--color--text-muted); }

.cb-card:has(input:checked),
.cb-card[data-checked="true"] {
	border-color: var(--wp--preset--color--accent);
	background-color: var(--wp--preset--color--surface-raised);
	box-shadow: 0 0 0 1px var(--wp--preset--color--accent);
}

.cb-card:has(input:focus-visible),
.cb-card:focus-within {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.cb-card__title {
	font-weight: 600;
	color: var(--wp--preset--color--text);
	font-size: var(--wp--preset--font-size--small);
}

.cb-card__sub {
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--x-small);
	font-family: var(--wp--preset--font-family--mono);
}

.cb-card__price {
	margin-top: auto;
	color: var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
}

/* -------------------------------------------------------------------------
 *  Add-to-cart row — sticky on mobile
 * ------------------------------------------------------------------------- */
.cb-buy-row {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--border);
}

.cb-buy-row__price {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30);
}

.cb-buy-row__amount {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--xl);
	font-weight: 600;
	color: var(--wp--preset--color--text);
	letter-spacing: -0.02em;
}

.cb-buy-row__vat {
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--text-muted);
	font-family: var(--wp--preset--font-family--mono);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.cb-buy-row__cta {
	display: flex;
	gap: var(--wp--preset--spacing--20);
}

.cb-buy-row__add {
	flex: 1;
	min-height: 52px;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--text-on-accent);
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 150ms ease, transform 100ms ease;
}

.cb-buy-row__add:hover { background-color: var(--wp--preset--color--accent-hover); }
.cb-buy-row__add:active { transform: scale(0.99); }
.cb-buy-row__add:disabled {
	background-color: var(--wp--preset--color--surface-raised);
	color: var(--wp--preset--color--text-subtle);
	cursor: not-allowed;
}

.cb-buy-row__qty {
	width: 72px;
	min-height: 52px;
	text-align: center;
	background-color: var(--wp--preset--color--surface-sunken);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 6px;
	color: var(--wp--preset--color--text);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--medium);
}

/* Sticky mobile bar */
@media (max-width: 1023px) {
	.cb-buy-sticky {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 50;
		padding: var(--wp--preset--spacing--30);
		background-color: var(--wp--preset--color--surface);
		border-top: 1px solid var(--wp--preset--color--border);
		box-shadow: 0 -8px 24px -4px rgba(0, 0, 0, 0.5);
		display: flex;
		gap: var(--wp--preset--spacing--20);
		align-items: center;
		transform: translateY(100%);
		transition: transform 240ms ease;
	}

	.cb-buy-sticky[data-visible="true"] { transform: translateY(0); }

	.cb-buy-sticky__price {
		flex: 0 0 auto;
		font-family: var(--wp--preset--font-family--sans);
		font-size: var(--wp--preset--font-size--medium);
		font-weight: 600;
		color: var(--wp--preset--color--text);
	}

	.cb-buy-sticky__add {
		flex: 1;
		min-height: 48px;
		background-color: var(--wp--preset--color--accent);
		color: var(--wp--preset--color--text-on-accent);
		border: none;
		border-radius: 6px;
		font-weight: 600;
	}
}

@media (min-width: 1024px) {
	.cb-buy-sticky { display: none; }
}
