/*
 * Plugin C frontend — quote calculator card.
 *
 * All colors and radii reference tokens.css custom properties exposed by the
 * child theme (see CLAUDE.md §5). No hard-coded values here.
 */

.pm-quote {
	background: var(--pm-color-surface);
	border: 1px solid var(--pm-color-border);
	border-radius: var(--pm-radius-md);
	padding: 24px 24px 20px;
	box-shadow: var(--pm-shadow-sm);
	font-family: var(--pm-font-sans);
	color: var(--pm-color-ink);
	display: flex;
	flex-direction: column;
	gap: 18px;
}

/* Heading row — title left, live values right (revealed after calc). */
.pm-quote__head {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
}

.pm-quote__title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--pm-color-ink);
}

.pm-quote__subtitle {
	margin: 4px 0 0;
	font-size: 13px;
	font-weight: 400;
	color: var(--pm-color-muted);
}

.pm-quote__minqty,
.pm-quote__colorname {
	color: var(--pm-color-muted);
}

.pm-quote__head-right {
	text-align: right;
}

.pm-quote__price {
	margin: 0;
	font-size: 22px;
	font-weight: 800;
	color: var(--pm-color-ink);
	letter-spacing: -0.01em;
}

.pm-quote__price .pm-quote__each {
	font-size: 14px;
	font-weight: 500;
	color: var(--pm-color-muted);
	margin-left: 2px;
}

.pm-quote__subtotal {
	margin: 2px 0 0;
	font-size: 13px;
	color: var(--pm-color-muted);
}

/* Field groups (Enter Qty, No. of Colors) */
.pm-quote__group + .pm-quote__group {
	margin-top: 4px;
}

.pm-quote__group-title {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 700;
	color: var(--pm-color-ink);
	text-transform: none;
}

.pm-quote__inputs {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.pm-quote__field {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}

.pm-quote__field-label {
	font-size: 12px;
	font-weight: 500;
	color: var(--pm-color-muted);
	letter-spacing: 0.02em;
}

/* Inputs */
.pm-quote__qty {
	width: 60px;
	height: 44px;
	padding: 8px 0;
	font-size: 18px;
	font-weight: 600;
	font-family: inherit;
	color: var(--pm-color-ink);
	background: var(--pm-color-input-bg);
	border: 1px solid transparent;
	border-radius: var(--pm-radius-md);
	text-align: center;
	-moz-appearance: textfield;
	transition: border-color 120ms ease, background-color 120ms ease;
}

.pm-quote__qty::-webkit-outer-spin-button,
.pm-quote__qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.pm-quote__qty::placeholder {
	color: var(--pm-color-placeholder);
	font-weight: 500;
}

.pm-quote__qty:focus {
	outline: none;
	border-color: var(--pm-color-accent);
	background: var(--pm-color-surface);
}

/* Custom select wrapper */
.pm-quote__select {
	position: relative;
	display: inline-block;
}

.pm-quote__colors {
	min-width: 132px;
	height: 44px;
	padding: 8px 36px 8px 16px;
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.2;
	color: var(--pm-color-ink);
	background: var(--pm-color-input-bg);
	border: 1px solid transparent;
	border-radius: var(--pm-radius-md);
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	cursor: pointer;
	transition: border-color 120ms ease, background-color 120ms ease;
}

.pm-quote__colors:focus {
	outline: none;
	border-color: var(--pm-color-accent);
	background: var(--pm-color-surface);
}

/* Caret */
.pm-quote__select::after {
	content: "";
	position: absolute;
	right: 12px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--pm-color-ink);
	border-bottom: 2px solid var(--pm-color-ink);
	transform: translateY(-65%) rotate(45deg);
	pointer-events: none;
}

/* CTA */
.pm-quote__cta,
.pm-quote__cta:hover,
.pm-quote__cta:focus,
.pm-quote__cta:active {
	color: var(--pm-color-surface);
	text-decoration: none;
}

.pm-quote__cta {
	width: 100%;
	height: 52px;
	margin: 4px 0 0;
	padding: 0 16px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0.01em;
	background: var(--pm-color-ink);
	border: 0;
	border-radius: var(--pm-radius-md);
	cursor: pointer;
	transition: background-color 120ms ease, transform 60ms ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.pm-quote__cta:hover {
	background: var(--pm-color-ink-hover);
}

.pm-quote__cta:active {
	background: var(--pm-color-ink-hover);
	transform: translateY(1px);
}

.pm-quote__cta:focus {
	outline: 0;
}

.pm-quote__cta:focus-visible {
	outline: 2px solid var(--pm-color-accent);
	outline-offset: 2px;
}

.pm-quote__cta[disabled],
.pm-quote__cta[disabled]:hover {
	background: var(--pm-color-disabled);
	cursor: not-allowed;
}

.pm-quote__cta-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-top-color: var(--pm-color-surface);
	border-radius: 50%;
	animation: pm-quote-spin 0.8s linear infinite;
}

@keyframes pm-quote-spin {
	to { transform: rotate(360deg); }
}

.pm-quote__cta.is-loading .pm-quote__cta-label {
	display: none;
}

.pm-quote__disclaimer {
	margin: 4px 0 0;
	font-size: 12px;
	color: var(--pm-color-muted);
}

/* Upsell card (shown after Calculate when next tier is cheaper). */
.pm-quote__upsell {
	margin: 8px 0 0;
	padding: 14px 16px;
	background: var(--pm-color-surface-soft);
	border-radius: var(--pm-radius-sm);
}

.pm-quote__upsell-title {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 700;
}

.pm-quote__upsell-list {
	margin: 0;
	padding-left: 1.4em;
	list-style: disc;
	font-size: 13px;
	color: var(--pm-color-ink);
}

/* Inline validation surface (e.g. below-MOQ messages). */
.pm-quote__error {
	margin: 4px 0 0;
	padding: 10px 12px;
	background: var(--pm-color-danger-soft);
	border-left: 3px solid var(--pm-color-danger);
	border-radius: var(--pm-radius-sm);
	font-size: 13px;
	color: var(--pm-color-danger);
}

/* Mobile (≤ 600px) — make qty inputs slightly larger for touch and let the
   side-color dropdowns wrap onto two columns. */
@media (max-width: 600px) {
	.pm-quote {
		padding: 18px 16px 16px;
	}
	.pm-quote__head {
		flex-direction: column;
	}
	.pm-quote__qty {
		width: 56px;
		height: 48px;
	}
	.pm-quote__colors {
		width: 100%;
		min-width: 0;
	}
	.pm-quote__inputs--sides .pm-quote__field {
		flex: 1 1 calc(50% - 14px);
		min-width: 0;
	}
}
