/* Comparison Table - defaults follow comparison_table_component.html; every
   color / size is a CSS variable the widget's Style controls override. */
.xtool-cmp {
	--xcmp-bg: #faf8f5;
	--xcmp-featured-bg: #fdf4ec;
	--xcmp-featured-line: rgba(255, 237, 213, .9);
	--xcmp-line: #eae6e1;
	--xcmp-border: #ede8e1;
	--xcmp-radius: 24px;
	--xcmp-accent: #f97316;
	--xcmp-cross: #a3a3a3;
	--xcmp-check: #ea580c;
	--xcmp-hover: rgba(245, 245, 245, .6);
	--xcmp-label-w: 20%;
	--xcmp-col-min: 190px;
	--xcmp-icon-box: 40px;
	--xcmp-icon-size: 18px;
	--xcmp-card-gap: 16px;
	--xcmp-card-w: 86%;
	position: relative;
	color: #1f2937;
}

.xtool-cmp,
.xtool-cmp *,
.xtool-cmp *::before,
.xtool-cmp *::after { box-sizing: border-box; }

/* ─── Desktop table ─── */
.xtool-cmp__shell {
	overflow-x: auto;
	overflow-y: hidden;
	border: 1px solid var(--xcmp-border);
	border-radius: var(--xcmp-radius);
	background: var(--xcmp-bg);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	outline: none;
}
.xtool-cmp__grid {
	display: grid;
	grid-template-columns: var(--xcmp-tracks, var(--xcmp-label-w) repeat(var(--xcmp-cols, 4), minmax(var(--xcmp-col-min), 1fr)));
	min-width: 100%;
}
.xtool-cmp__row { display: contents; }

.xtool-cmp__cell {
	min-width: 0;
	padding: 24px;
	border-bottom: 1px solid var(--xcmp-line);
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--xcmp-cell-bg, var(--xcmp-bg));
	transition: background-color .15s ease;
}
.xtool-cmp__cell.is-featured {
	background: var(--xcmp-featured-bg);
	border-left: 1px solid var(--xcmp-featured-line);
}
.xtool-cmp__row--cta .xtool-cmp__cell { border-bottom: 0; }

/* Gradient background for the featured column: one absolutely-positioned
   layer spanning the column's grid area (absolute = no effect on cell
   auto-placement), behind the now-transparent featured cells. */
.xtool-cmp--featured-layer .xtool-cmp__grid { position: relative; isolation: isolate; }
.xtool-cmp__featured-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--xcmp-featured-bg); }
.xtool-cmp--featured-layer .xtool-cmp__cell.is-featured { background: transparent; }
/* Only while the table actually scrolls sideways does the pinned column
   slide over other cells and need an opaque fill (solid featured color).
   is-scrollable is set by the widget's JS. */
.xtool-cmp--featured-layer.xtool-cmp--pin-featured.is-scrollable .xtool-cmp__featured-bg { display: none; }
.xtool-cmp--featured-layer.xtool-cmp--pin-featured.is-scrollable .xtool-cmp__cell.is-featured { background: var(--xcmp-featured-bg); }

/* Stand Out: the featured layer reaches above and below the table. The
   shell must stop clipping for that, so its corners can no longer hide
   square cell backgrounds - cells go transparent (the shell paints the
   table background). While the table scrolls sideways it falls back to a
   normal, clipped column. */
.xtool-cmp--pop { padding-top: var(--xcmp-pop, 0px); padding-bottom: var(--xcmp-pop, 0px); }
.xtool-cmp--pop:not(.is-scrollable) { --xcmp-cell-bg: transparent; }
.xtool-cmp--pop:not(.is-scrollable) .xtool-cmp__shell { overflow: visible; }
.xtool-cmp--pop:not(.is-scrollable) .xtool-cmp__featured-bg {
	top: calc(-1 * var(--xcmp-pop, 0px) - 1px);
	bottom: calc(-1 * var(--xcmp-pop, 0px) - 1px);
	border-radius: var(--xcmp-pop-radius, 24px);
}

.xtool-cmp--hover .xtool-cmp__row:not(.xtool-cmp__row--head):not(.xtool-cmp__row--cta):hover .xtool-cmp__cell:not(.is-featured) {
	background: var(--xcmp-hover);
}

/* Label column stays pinned while the columns scroll sideways. */
.xtool-cmp__cell--label {
	position: sticky;
	left: 0;
	z-index: 2;
}
.xtool-cmp.is-scrollable .xtool-cmp__cell--label {
	box-shadow: 8px 0 14px -10px rgba(30, 24, 20, .18);
}

.xtool-cmp__cell--head,
.xtool-cmp__cell--corner {
	position: relative;
	align-items: flex-end;
	padding-bottom: 32px;
}

.xtool-cmp__label {
	color: #a3a3a3;
	font-size: 12px;
	line-height: 1.4;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.xtool-cmp__icon {
	width: var(--xcmp-icon-box);
	height: var(--xcmp-icon-box);
	border-radius: 12px;
	display: grid;
	place-items: center;
	margin-bottom: 16px;
	background: #f5f5f4;
	color: #525252;
	border: 1px solid rgba(0, 0, 0, .05);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	font-size: var(--xcmp-icon-size);
	flex: 0 0 auto;
}
.xtool-cmp__icon svg { width: var(--xcmp-icon-size); height: var(--xcmp-icon-size); fill: currentColor; }
.is-featured > div > .xtool-cmp__icon,
.xtool-cmp__mini.is-featured .xtool-cmp__icon,
.xtool-cmp__card.is-featured .xtool-cmp__icon {
	background: var(--xcmp-accent);
	color: #fff;
	border-color: transparent;
	box-shadow: 0 2px 6px rgba(249, 115, 22, .3);
}

.xtool-cmp__title {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--xcmp-title, #171717);
}
/* Colors come from CSS variables (set by the Style controls), so the
   normal-column color controls can never override the featured column. */
.is-featured .xtool-cmp__title { color: var(--xcmp-featured-title, #ea580c); }
.xtool-cmp--title-grad .is-featured .xtool-cmp__title {
	display: inline-block;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}
.xtool-cmp__subtitle { margin-top: 4px; color: var(--xcmp-subtitle, #737373); font-size: 12px; line-height: 1.4; }
.is-featured .xtool-cmp__subtitle { color: var(--xcmp-featured-subtitle, #525252); }

/* "Recommended" tab hanging from the top edge of the featured header. */
.xtool-cmp__badge {
	position: absolute;
	top: 0;
	right: 24px;
	padding: 4px 12px;
	border-radius: 0 0 8px 8px;
	background: var(--xcmp-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .03em;
	text-transform: uppercase;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.xtool-cmp__value { color: var(--xcmp-value, #525252); font-size: 14px; font-weight: 500; line-height: 1.45; }
.is-featured .xtool-cmp__value { color: var(--xcmp-featured-value, #171717); font-weight: 700; }

.xtool-cmp__mark { flex: 0 0 auto; display: inline-flex; width: 16px; height: 16px; }
.xtool-cmp__mark svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.xtool-cmp__mark.is-cross { color: var(--xcmp-cross); }
.xtool-cmp__mark.is-check { color: var(--xcmp-check); }
.xtool-cmp__mark.is-check svg { stroke-width: 2.5; }

.xtool-cmp__btn {
	position: relative;
	isolation: isolate;
	width: 100%;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid #d4d4d4;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: #404040;
	background: rgba(255, 255, 255, .7);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	transition: transform .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.xtool-cmp__btn:hover { background-color: #fff; border-color: #a3a3a3; color: #171717; }
/* Hover gradient overlay: gradients can't transition, so the hover one fades in on top via opacity. */
.xtool-cmp__btn::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	border-radius: inherit;
	opacity: 0;
	transition: opacity .4s ease;
	pointer-events: none;
}
.xtool-cmp__btn:hover::before,
.xtool-cmp__btn:focus-visible::before { opacity: 1; }
.xtool-cmp__btn-text { position: relative; z-index: 1; }
.xtool-cmp__btn:active { transform: scale(.95); }
.xtool-cmp__btn.is-featured {
	border-color: var(--xcmp-accent);
	background: var(--xcmp-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .02em;
	box-shadow: 0 4px 12px rgba(249, 115, 22, .25);
}
.xtool-cmp__btn.is-featured:hover { filter: brightness(.93); color: #fff; }

/* With many columns the featured column stays pinned on the right while
   the middle scrolls, so the option being promoted is always visible. */
.xtool-cmp--pin-featured .xtool-cmp__cell.is-featured {
	position: sticky;
	right: 0;
	z-index: 2;
}
.xtool-cmp--pin-featured.is-scrollable:not(.is-end) .xtool-cmp__cell.is-featured {
	box-shadow: -10px 0 16px -12px rgba(30, 24, 20, .22);
}

/* Fade on the right edge while more columns are hidden to the right. */
.xtool-cmp::after {
	content: "";
	position: absolute;
	top: 1px;
	bottom: 1px;
	right: 1px;
	width: 56px;
	border-radius: 0 var(--xcmp-radius) var(--xcmp-radius) 0;
	background: linear-gradient(to right, rgba(250, 248, 245, 0), var(--xcmp-bg));
	pointer-events: none;
	opacity: 0;
	transition: opacity .2s ease;
}
.xtool-cmp.is-scrollable:not(.is-end):not(.xtool-cmp--pin-featured)::after { opacity: 1; }

/* ─── Mobile views (hidden until the breakpoint) ─── */
.xtool-cmp__compare,
.xtool-cmp__cards,
.xtool-cmp__dots { display: none; }

/* Compare: tabs + two cards side by side. */
.xtool-cmp__compare-heading {
	margin-bottom: 8px;
	color: #a3a3a3;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
}
.xtool-cmp__tabs {
	display: grid;
	grid-template-columns: repeat(var(--xcmp-tab-cols, 3), minmax(0, 1fr));
	gap: 8px;
	margin-bottom: 16px;
	padding: 6px;
	border-radius: 16px;
	background: rgba(229, 229, 229, .6);
}
.xtool-cmp__tab {
	-webkit-appearance: none !important;
	appearance: none !important;
	margin: 0 !important;
	padding: 8px 10px !important;
	border: 0 !important;
	border-radius: 12px !important;
	background: transparent !important;
	box-shadow: none !important;
	color: #525252 !important;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: background-color .2s ease, color .2s ease;
}
.xtool-cmp__tab:hover { color: #171717 !important; }
.xtool-cmp__tab.is-active {
	background: #fff !important;
	color: #171717 !important;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .06) !important;
}
.xtool-cmp__tab:focus-visible { outline: 2px solid var(--xcmp-accent); outline-offset: 2px; }

.xtool-cmp__pair {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 12px;
	align-items: stretch;
}
.xtool-cmp__pair-slot { display: flex; min-width: 0; }
.xtool-cmp__pair-slot > .xtool-cmp__mini { flex: 1 1 auto; }
.xtool-cmp__mini[hidden] { display: none !important; }

.xtool-cmp__mini {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 16px;
	border: 1px solid #e5e5e5;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	min-width: 0;
}
.xtool-cmp__mini.is-featured {
	border: 2px solid rgba(254, 215, 170, .8);
	background: var(--xcmp-featured-bg);
	box-shadow: 0 4px 10px rgba(0, 0, 0, .06);
}
.xtool-cmp__mini .xtool-cmp__badge {
	top: -12px;
	right: 12px;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 10px;
}
.xtool-cmp__mini .xtool-cmp__icon { width: 36px; height: 36px; margin-bottom: 12px; }
.xtool-cmp__mini .xtool-cmp__title { font-size: 16px; }
.xtool-cmp__mini .xtool-cmp__subtitle { font-size: 11px; }
.xtool-cmp__mini-rows { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; flex: 1 1 auto; }
.xtool-cmp__mini-row .xtool-cmp__label { display: block; font-size: 10px; }
.xtool-cmp__mini.is-featured .xtool-cmp__label { color: rgba(194, 65, 12, .8); }
.xtool-cmp__mini-val { display: flex; align-items: flex-start; gap: 6px; margin-top: 2px; }
.xtool-cmp__mini-val .xtool-cmp__mark { width: 14px; height: 14px; margin-top: 2px; }
.xtool-cmp__mini-val .xtool-cmp__value { font-size: 12px; }
.xtool-cmp__mini-action { margin-top: 24px; padding-top: 12px; border-top: 1px solid #f5f5f5; }
.xtool-cmp__mini.is-featured .xtool-cmp__mini-action { border-top-color: #ffedd5; }
.xtool-cmp__mini .xtool-cmp__btn { min-height: 38px; padding: 0 8px; border-radius: 12px; font-size: 11px; }
.xtool-cmp__mini .xtool-cmp__btn.is-featured { font-size: 12px; }

/* Line rows up across the two compare cards: both cards share the pair's
   row tracks via subgrid, so a row that wraps on one side makes the same
   row taller on the other side too. Browsers without subgrid simply keep
   the normal (unaligned) layout above. */
@supports (grid-template-rows: subgrid) {
	.xtool-cmp--align .xtool-cmp__pair {
		grid-template-rows: auto repeat(var(--xcmp-rows, 5), auto) auto;
		row-gap: 0;
		align-items: stretch;
	}
	.xtool-cmp--align .xtool-cmp__pair-slot,
	.xtool-cmp--align .xtool-cmp__mini {
		display: grid;
		grid-row: 1 / -1;
		grid-template-rows: subgrid;
		row-gap: 0;
	}
	.xtool-cmp--align .xtool-cmp__mini[hidden] { display: none !important; }
	.xtool-cmp--align .xtool-cmp__mini-head { grid-row: 1; }
	.xtool-cmp--align .xtool-cmp__mini-rows { display: contents; }
	.xtool-cmp--align .xtool-cmp__mini-row { padding-top: 16px; }
	.xtool-cmp--align .xtool-cmp__mini-row:first-child { padding-top: 24px; }
	.xtool-cmp--align .xtool-cmp__mini-action { grid-row: -2 / -1; align-self: end; }
}

/* Stack / swipe cards. */
.xtool-cmp__card {
	overflow: hidden;
	border: 1px solid var(--xcmp-line);
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
.xtool-cmp__card.is-featured { border: 2px solid rgba(254, 215, 170, .8); background: var(--xcmp-featured-bg); }
.xtool-cmp__card-head { position: relative; padding: 20px; display: flex; gap: 14px; align-items: center; }
.xtool-cmp__card-head .xtool-cmp__icon { margin: 0; }
.xtool-cmp__card-head .xtool-cmp__badge { top: 0; right: 16px; }
.xtool-cmp__card-row {
	display: grid;
	grid-template-columns: minmax(80px, 38%) 1fr;
	gap: 14px;
	padding: 14px 20px;
	border-top: 1px solid var(--xcmp-line);
	align-items: center;
}
.xtool-cmp__card-row .xtool-cmp__label { font-size: 10px; }
.xtool-cmp__card-val { display: flex; align-items: center; gap: 8px; }
.xtool-cmp__card-action { padding: 16px 20px 20px; border-top: 1px solid var(--xcmp-line); }

.xtool-cmp__dots { justify-content: center; gap: 7px; margin-top: 14px; }
.xtool-cmp__dot { width: 7px; height: 7px; border-radius: 50%; background: #d4d4d4; transition: background-color .2s ease, width .2s ease; }
.xtool-cmp__dot.is-active { width: 18px; border-radius: 4px; background: var(--xcmp-accent); }

.xtool-cmp--m-swipe .xtool-cmp__cards {
	gap: var(--xcmp-card-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 4px;
	align-items: stretch;
}
.xtool-cmp--m-swipe .xtool-cmp__cards::-webkit-scrollbar { display: none; }
.xtool-cmp--m-swipe .xtool-cmp__card { flex: 0 0 var(--xcmp-card-w); scroll-snap-align: start; }
.xtool-cmp--m-stack .xtool-cmp__cards { gap: var(--xcmp-card-gap); }

@media (max-width: 1024px) {
	.xtool-cmp--bp-tablet:not(.xtool-cmp--m-table) .xtool-cmp__shell,
	.xtool-cmp--bp-tablet:not(.xtool-cmp--m-table)::after { display: none; }
	.xtool-cmp--bp-tablet.xtool-cmp--m-compare .xtool-cmp__compare { display: block; }
	.xtool-cmp--bp-tablet.xtool-cmp--m-stack .xtool-cmp__cards { display: grid; }
	.xtool-cmp--bp-tablet.xtool-cmp--m-swipe .xtool-cmp__cards,
	.xtool-cmp--bp-tablet.xtool-cmp--m-swipe .xtool-cmp__dots { display: flex; }
}
@media (max-width: 767px) {
	.xtool-cmp--bp-mobile:not(.xtool-cmp--m-table) .xtool-cmp__shell,
	.xtool-cmp--bp-mobile:not(.xtool-cmp--m-table)::after { display: none; }
	.xtool-cmp--bp-mobile.xtool-cmp--m-compare .xtool-cmp__compare { display: block; }
	.xtool-cmp--bp-mobile.xtool-cmp--m-stack .xtool-cmp__cards { display: grid; }
	.xtool-cmp--bp-mobile.xtool-cmp--m-swipe .xtool-cmp__cards,
	.xtool-cmp--bp-mobile.xtool-cmp--m-swipe .xtool-cmp__dots { display: flex; }
	.xtool-cmp__card-row { padding: 14px 16px; }
	.xtool-cmp__card-head { padding: 18px 16px; }
}
@media (min-width: 640px) {
	.xtool-cmp__pair { gap: 16px; }
	.xtool-cmp__mini { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
	.xtool-cmp__btn,
	.xtool-cmp__cell,
	.xtool-cmp__tab { transition: none; }
}
