/* ot-price-calculator widget styles.
 * Layout parity with the legacy newlook calc-2024 widget, restrained colors
 * per the price owner's taste: text and prices inherit the theme (black),
 * the single accent is the post-facelift primary rgb(96,128,208) from
 * dist.lucifer-v2 (--v-color-primary), applied to the form controls only —
 * buttons are themed globally elsewhere. Typography inherits from the theme;
 * everything is scoped under .otpc. */

.otpc {
	--otpc-primary: rgb(96, 128, 208);
	margin: 0 0 2em;
}

.otpc a {
	color: #f87d4d;
	text-decoration: underline;
}

.otpc-desc {
	margin: 0 0 0.5em;
}

.otpc-unit-price {
	margin: 0 0 0.75em;
	font-weight: 600;
}

/* ---------- Slider (flat skin parity, accent = facelift primary) ---------- */

.otpc-slider {
	position: relative;
	width: 100%;
	margin: 2.6em 0 2.8em;
}

.otpc-slider input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: 8px;
	border-radius: 4px;
	background: #e1e6ec; /* repainted inline with the primary fill gradient */
	outline: none;
	margin: 0;
}

.otpc-slider input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--otpc-primary);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

.otpc-slider input[type="range"]::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--otpc-primary);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

.otpc-bubble {
	position: absolute;
	top: -2.2em;
	transform: translateX(-50%);
	background: var(--otpc-primary);
	color: #fff;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1;
	padding: 0.35em 0.6em;
	border-radius: 3px;
	white-space: nowrap;
	pointer-events: none;
}

.otpc-bubble::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -4px;
	transform: translateX(-50%);
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 4px solid var(--otpc-primary);
}

/* Numbered tick grid (SSR, works with JS disabled) */

.otpc-grid {
	position: relative;
	height: 2em;
	margin: 6px 9px 0; /* half thumb inset so ticks align with thumb centers */
}

.otpc-tick {
	position: absolute;
	top: 0;
	transform: translateX(-50%);
	font-size: 0.8em;
	color: #999;
	text-align: center;
}

.otpc-tick i {
	display: block;
	width: 1px;
	height: 6px;
	margin: 0 auto 2px;
	background: #c5ccd4;
}

/* ---------- md-style checkboxes ---------- */

.otpc-extras {
	list-style: none;
	margin: 0.5em 0 1.5em;
	padding: 0;
}

.otpc-check {
	margin: 0.55em 0;
}

.otpc-check label {
	display: flex;
	align-items: baseline;
	gap: 0.6em;
	cursor: pointer;
	margin: 0;
}

.otpc-check input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.otpc-box {
	flex: 0 0 auto;
	position: relative;
	top: 2px;
	width: 18px;
	height: 18px;
	border: 1px solid #c5ccd4;
	border-radius: 2px;
	background: #fff;
	transition: border-color 0.15s;
}

.otpc-check input:checked + .otpc-box {
	border-color: var(--otpc-primary);
}

.otpc-check input:checked + .otpc-box::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 6px;
	height: 11px;
	border: solid var(--otpc-primary);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.otpc-check input:focus-visible + .otpc-box {
	outline: 2px solid var(--otpc-primary);
	outline-offset: 2px;
}

/* ---------- Total + CTA ---------- */

/* The total floats at the viewport bottom while the user works the controls
 * above it, and docks into its natural place (before the CTA) once scrolled
 * to. position:sticky is NOT an option in this theme — the global
 * .wrapper { overflow: hidden } makes it a scroll container and kills sticky
 * on every page — so JS toggles position:fixed via IntersectionObservers
 * (see calculator.js). Without JS the total simply stays docked. */

.otpc-total {
	font-size: 1.5em;
	font-weight: 600;
	text-align: right;
	padding: 0.35em 0;
}

.otpc-total--stuck {
	position: fixed;
	bottom: 0;
	z-index: 20;
	background: #fff;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.07);
	padding: 0.35em 0.5em;
}

.otpc-total-sentinel {
	height: 1px;
}

.otpc-cta {
	text-align: center;
	margin: 1.5em 0 2em;
}

.otpc-cta a {
	display: inline-block;
	width: 280px;
	max-width: 100%;
	text-align: center;
}

/* ---------- Price table (below the CTA) ---------- */

.otpc-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1.5em;
}

.otpc-table td {
	padding: 0.5em 0.75em;
	border-bottom: 1px solid #e5e5e5;
	text-align: left;
}

.otpc-table td.otpc-price {
	white-space: nowrap;
	font-weight: 600;
	text-align: right;
}

.otpc-updated-at {
	font-size: 0.85em;
	opacity: 0.7;
}
