/**
 * Resin Kit Calculator — front end styles.
 * Everything is scoped to .rkc and driven by custom properties,
 * so a theme can restyle the widget by overriding the variables only.
 */

.rkc {
	--rkc-ink: #17191c;
	--rkc-muted: #6b7280;
	--rkc-line: #d9d5cc;
	--rkc-surface: #ffffff;
	--rkc-panel: #f3f1ec;
	--rkc-accent: #e8a33d;
	--rkc-accent-ink: #17191c;
	--rkc-success: #1f7a4d;
	--rkc-error: #b3261e;
	--rkc-radius: 10px;
	--rkc-gap: 20px;

	box-sizing: border-box;
	color: var(--rkc-ink);
	background: var(--rkc-surface);
	border: 1px solid var(--rkc-line);
	border-radius: var(--rkc-radius);
	padding: clamp(18px, 3vw, 32px);
	margin: 0 0 28px;
	font-size: 16px;
	line-height: 1.45;
}

.rkc *,
.rkc *::before,
.rkc *::after {
	box-sizing: inherit;
}

/* ---------- Head ---------- */

.rkc__head {
	margin-bottom: 24px;
}

.rkc__title {
	margin: 0 0 6px;
	font-size: clamp(1.25rem, 2.4vw, 1.6rem);
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.rkc__intro {
	margin: 0;
	color: var(--rkc-muted);
	max-width: 60ch;
}

/* ---------- Layout ---------- */

.rkc__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
	gap: clamp(20px, 3vw, 36px);
	align-items: start;
}

@media (max-width: 782px) {
	.rkc__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------- Form ---------- */

.rkc__field + .rkc__field {
	margin-top: 18px;
}

.rkc__label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rkc-muted);
}

.rkc__input,
.rkc__select {
	width: 100%;
	max-width: 100%;
	padding: 12px 14px;
	font: inherit;
	color: var(--rkc-ink);
	background: var(--rkc-surface);
	border: 1px solid var(--rkc-line);
	border-radius: 8px;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rkc__select {
	background-image: linear-gradient(45deg, transparent 50%, var(--rkc-ink) 50%),
		linear-gradient(135deg, var(--rkc-ink) 50%, transparent 50%);
	background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 14px) calc(50% + 2px);
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	padding-right: 40px;
}

.rkc__input:focus,
.rkc__select:focus,
.rkc__check input:focus-visible,
.rkc__button:focus-visible {
	outline: 2px solid var(--rkc-ink);
	outline-offset: 2px;
}

.rkc__input-wrap {
	position: relative;
}

.rkc__input-wrap .rkc__input {
	padding-right: 52px;
	font-variant-numeric: tabular-nums;
}

.rkc__unit {
	position: absolute;
	top: 50%;
	right: 14px;
	transform: translateY(-50%);
	color: var(--rkc-muted);
	font-size: 0.9rem;
	pointer-events: none;
}

.rkc__field--check {
	margin-top: 22px;
	padding-top: 20px;
	border-top: 1px solid var(--rkc-line);
}

.rkc__check {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	cursor: pointer;
}

.rkc__check input {
	margin: 3px 0 0;
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	accent-color: var(--rkc-ink);
}

.rkc__check small {
	display: block;
	color: var(--rkc-muted);
	font-size: 0.85rem;
}

/* ---------- Basket ---------- */

.rkc__basket {
	background: var(--rkc-panel);
	border-radius: var(--rkc-radius);
	padding: 20px;
}

.rkc__basket-head h3 {
	margin: 0;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.rkc__coverage {
	display: block;
	margin-top: 4px;
	font-size: 0.8rem;
	color: var(--rkc-muted);
	font-variant-numeric: tabular-nums;
}

.rkc__lines {
	list-style: none;
	margin: 16px 0 0;
	padding: 0;
}

.rkc__line {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 12px 0;
	border-top: 1px solid var(--rkc-line);
}

.rkc__thumb {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 6px;
	overflow: hidden;
	background: var(--rkc-surface);
	border: 1px solid var(--rkc-line);
}

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

.rkc__line-body {
	flex: 1 1 auto;
	min-width: 0;
}

.rkc__line-name {
	display: block;
	font-weight: 600;
	line-height: 1.25;
}

.rkc__line-meta {
	display: block;
	font-size: 0.82rem;
	color: var(--rkc-muted);
	font-variant-numeric: tabular-nums;
}

.rkc__line-total {
	flex: 0 0 auto;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.rkc__empty {
	margin: 16px 0 0;
	padding: 14px;
	border: 1px dashed var(--rkc-line);
	border-radius: 8px;
	color: var(--rkc-muted);
	font-size: 0.9rem;
}

.rkc__empty[hidden] {
	display: none;
}

.rkc__total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 2px solid var(--rkc-ink);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.rkc__total strong {
	font-size: 1.5rem;
	letter-spacing: -0.01em;
	text-transform: none;
	font-variant-numeric: tabular-nums;
}

.rkc__button {
	display: block;
	width: 100%;
	margin-top: 16px;
	padding: 14px 18px;
	font: inherit;
	font-weight: 700;
	color: var(--rkc-accent-ink);
	background: var(--rkc-accent);
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	transition: filter 0.15s ease, opacity 0.15s ease;
}

.rkc__button:hover:not(:disabled) {
	filter: brightness(0.94);
}

.rkc__button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.rkc__feedback {
	margin: 12px 0 0;
	font-size: 0.88rem;
}

.rkc__feedback:empty {
	display: none;
}

.rkc__feedback.is-success {
	color: var(--rkc-success);
}

.rkc__feedback.is-error {
	color: var(--rkc-error);
}

.rkc__note {
	margin: 14px 0 0;
	font-size: 0.78rem;
	color: var(--rkc-muted);
}

@media (prefers-reduced-motion: reduce) {
	.rkc * {
		transition: none !important;
	}
}
