/* KA Product Configurator — frontend styles (theme-agnostic defaults). */

.kapc-configurator {
	margin: 0 0 1.5em;
	max-width: 640px;
}

.kapc-field {
	margin: 0 0 1.1em;
	position: relative;
}

.kapc-hidden {
	display: none !important;
}

.kapc-disabled {
	opacity: 0.5;
	pointer-events: none;
}

/* Headlines --------------------------------------------------------------- */
.kapc-headline {
	display: flex;
	align-items: center;
	gap: 0.6em;
	margin: 1.4em 0 0.8em;
	padding-bottom: 0.35em;
	border-bottom: 2px solid rgba(0, 0, 0, 0.08);
	font-size: 1.15em;
}

.kapc-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.7em;
	height: 1.7em;
	border-radius: 50%;
	background: #222;
	color: #fff;
	font-size: 0.8em;
	flex: 0 0 auto;
}

/* Messages ---------------------------------------------------------------- */
.kapc-type-message .kapc-message-content {
	background: #f4f6f8;
	border-left: 3px solid #7a8a99;
	padding: 0.7em 1em;
	font-size: 0.92em;
	border-radius: 0 4px 4px 0;
}

/* Labels & inputs ---------------------------------------------------------- */
.kapc-label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3em;
}

.kapc-req {
	color: #c0392b;
}

.kapc-desc {
	margin: 0 0 0.4em;
	font-size: 0.85em;
	opacity: 0.75;
}

.kapc-field .kapc-input {
	width: 100%;
	max-width: 320px;
	padding: 0.5em 0.7em;
	border: 1px solid #cfd4d9;
	border-radius: 4px;
	box-sizing: border-box;
}

.kapc-type-textarea .kapc-input {
	max-width: 100%;
}

.kapc-minmax {
	display: block;
	margin-top: 0.25em;
	font-size: 0.8em;
	opacity: 0.7;
}

.kapc-field-error {
	display: block;
	color: #c0392b;
	font-size: 0.85em;
	margin-top: 0.25em;
	min-height: 0;
}

.kapc-has-error .kapc-input,
.kapc-has-error .kapc-choices {
	border-color: #c0392b;
}

/* Choice grids (radio swatches + product choices) --------------------------- */
.kapc-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.kapc-choice {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 10px;
	border: 2px solid #e0e4e8;
	border-radius: 6px;
	cursor: pointer;
	min-width: 92px;
	max-width: 140px;
	text-align: center;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	position: relative;
	background: #fff;
}

.kapc-choice:hover {
	border-color: #9aa4ae;
}

.kapc-choice input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.kapc-choice:has(input:checked) {
	border-color: #222;
	box-shadow: 0 0 0 1px #222;
}

/* :has() fallback via JS-free trick isn't possible; modern browsers only.
   For older browsers the radio itself stays usable via keyboard. */

.kapc-choice-img img {
	display: block;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 4px;
}

.kapc-choice-title {
	font-size: 0.85em;
	line-height: 1.25;
}

.kapc-choice-price {
	font-size: 0.85em;
	font-weight: 600;
}

.kapc-choice-off {
	opacity: 0.4;
	pointer-events: none;
	filter: grayscale(1);
}

.kapc-choices-products .kapc-choice {
	min-width: 130px;
	max-width: 180px;
}

.kapc-choices-products .kapc-choice-img img {
	width: 96px;
	height: 96px;
}

/* Checkbox ------------------------------------------------------------------ */
.kapc-checkbox-wrap {
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
	background: #f8f9fa;
	border: 1px solid #e0e4e8;
	border-radius: 6px;
	padding: 0.7em 0.9em;
}

.kapc-checkbox-wrap input {
	margin-top: 0.25em;
}

/* Price box ------------------------------------------------------------------ */
.kapc-messages:empty {
	display: none;
}

.kapc-msg-error {
	background: #fdecea;
	border-left: 3px solid #c0392b;
	color: #922b21;
	padding: 0.55em 0.9em;
	margin: 0 0 0.5em;
	font-size: 0.9em;
	border-radius: 0 4px 4px 0;
}

.kapc-price-box {
	margin: 1.2em 0 1em;
	padding: 0.9em 1.1em;
	background: #f8f9fa;
	border: 1px solid #e0e4e8;
	border-radius: 6px;
}

.kapc-line {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	font-size: 0.88em;
	padding: 0.15em 0;
	opacity: 0.85;
}

.kapc-breakdown:not(:empty) {
	border-bottom: 1px dashed #cfd4d9;
	margin-bottom: 0.5em;
	padding-bottom: 0.5em;
}

.kapc-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-weight: 700;
	font-size: 1.15em;
}

.kapc-price-invalid .kapc-total-amount {
	opacity: 0.4;
}

.kapc-price-note {
	margin-top: 0.3em;
	font-size: 0.8em;
	opacity: 0.7;
}

@media (max-width: 480px) {
	.kapc-choice {
		min-width: calc(33.33% - 10px);
	}
}
