/**
 * Essential Circuit tools module.
 *
 * @package Essential_Circuit
 */

.ec-tools {
	margin-block: var(--ec-section-space-large) 0;
}

.ec-tools__header {
	max-width: 760px;
	margin-bottom: 1.75rem;
}

.ec-tools__header h2 {
	margin: 0.35rem 0 0.7rem;
	color: var(--ec-text);
	font-size: clamp(2rem, 4vw, 3.25rem);
	line-height: 1.08;
}

.ec-tools__header > p:last-child {
	margin: 0;
	color: var(--ec-text-muted);
	font-size: clamp(1rem, 1.5vw, 1.125rem);
	line-height: 1.75;
}

.ec-decision-guide {
	display: grid;
	grid-template-columns: minmax(245px, 0.72fr) minmax(0, 1.75fr);
	gap: 1rem 2rem;
	align-items: center;
	margin-bottom: 1.5rem;
	padding: clamp(1.25rem, 2vw, 1.75rem);
	border: 1px solid var(--ec-border);
	border-radius: var(--ec-panel-radius);
	background: var(--ec-white);
	box-shadow: var(--ec-card-shadow);
}

.ec-decision-guide__heading {
	display: flex;
	gap: 0.9rem;
	align-items: center;
}

.ec-decision-guide__heading > span {
	display: grid;
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	place-items: center;
	border-radius: 14px;
	background: rgba(255, 122, 0, 0.12);
	color: var(--ec-orange);
}

.ec-decision-guide__heading svg {
	width: 25px;
	height: 25px;
	fill: none;
	stroke: currentcolor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.ec-decision-guide__heading h3 {
	margin: 0.2rem 0 0;
	color: var(--ec-text);
	font-size: clamp(1.12rem, 1.6vw, 1.35rem);
	line-height: 1.25;
}

.ec-decision-guide__choices {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.65rem;
}

.ec-decision-guide__choices button {
	min-height: 48px;
	padding: 0.65rem 0.8rem;
	border: 1px solid var(--ec-border);
	border-radius: var(--ec-control-radius);
	background: var(--ec-light-gray);
	color: var(--ec-text);
	font: inherit;
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1.3;
	cursor: pointer;
	transition: border-color var(--ec-transition-fast), background-color var(--ec-transition-fast), color var(--ec-transition-fast), transform var(--ec-transition-fast);
}

.ec-decision-guide__choices button:not(:disabled):hover {
	border-color: var(--ec-orange);
	transform: translateY(-1px);
}

.ec-decision-guide__choices button[aria-pressed="true"] {
	border-color: var(--ec-orange);
	background: var(--ec-orange);
	color: var(--ec-dark);
}

.ec-decision-guide__choices button:disabled,
.ec-tool-card__footer button:disabled {
	cursor: default;
	opacity: 1;
}

.ec-decision-guide__status {
	grid-column: 2;
	margin: -0.25rem 0 0;
	color: var(--ec-text-muted);
	font-size: 0.82rem;
}

.ec-tools__layout {
	display: grid;
	grid-template-columns: minmax(370px, 2fr) minmax(0, 3fr);
	gap: 1.25rem;
	align-items: start;
}

.ec-featured-tool,
.ec-tool-card {
	position: relative;
	border: 1px solid var(--ec-border);
	border-radius: var(--ec-panel-radius);
	background: var(--ec-white);
	box-shadow: var(--ec-card-shadow);
	transition: border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.ec-featured-tool {
	position: sticky;
	top: var(--ec-header-offset, 150px);
	overflow: hidden;
	background: var(--ec-dark);
	color: var(--ec-white);
}

.ec-featured-tool__content {
	padding: clamp(1.5rem, 3vw, 2.25rem);
}

.ec-featured-tool__icon,
.ec-tool-card__icon {
	display: grid;
	place-items: center;
	border-radius: 14px;
	background: rgba(255, 122, 0, 0.14);
	color: var(--ec-orange);
}

.ec-featured-tool__icon {
	width: 54px;
	height: 54px;
	margin-bottom: 1.3rem;
}

.ec-featured-tool__icon svg,
.ec-tool-card__icon svg,
.ec-tools__disclaimer svg,
.ec-tool-card__time svg,
.ec-tool-card__footer svg {
	fill: none;
	stroke: currentcolor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.ec-featured-tool__icon svg {
	width: 28px;
	height: 28px;
}

.ec-featured-tool__label {
	margin: 0 0 0.45rem;
	color: #ff9a3c;
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ec-featured-tool h3 {
	margin: 0 0 0.8rem;
	color: var(--ec-white);
	font-size: clamp(1.65rem, 2.5vw, 2.2rem);
	line-height: 1.12;
}

.ec-featured-tool__content > p:not(.ec-featured-tool__label) {
	margin: 0;
	color: #d1d5db;
	line-height: 1.7;
}

.ec-featured-tool__why {
	margin-top: 1.3rem;
	padding-top: 1.2rem;
	border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.ec-featured-tool__why strong,
.ec-tool-card__why strong {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.76rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ec-featured-tool__why strong {
	color: #ff9a3c;
}

.ec-featured-tool__why p {
	margin: 0;
	color: #d1d5db;
	font-size: 0.91rem;
	line-height: 1.6;
}

.ec-featured-tool__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	margin-top: 1.5rem;
}

.ec-featured-tool__actions a {
	display: inline-flex;
	min-height: 46px;
	align-items: center;
	justify-content: center;
	padding: 0.72rem 1rem;
	border-radius: 12px;
	font-size: 0.88rem;
	font-weight: 800;
	text-decoration: none;
}

.ec-featured-tool__primary {
	background: var(--ec-orange);
	color: var(--ec-dark);
}

.ec-featured-tool__primary:hover {
	background: var(--ec-orange-hover);
	color: var(--ec-dark);
}

.ec-featured-tool__secondary {
	gap: 0.45rem;
	border: 1px solid rgba(255, 255, 255, 0.28);
	color: var(--ec-white);
}

.ec-featured-tool__secondary:hover {
	border-color: #fff;
	color: #fff;
}

.ec-featured-tool__secondary svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentcolor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.ec-budget-preview {
	padding: clamp(1.25rem, 2.5vw, 1.75rem);
	background: var(--ec-light-gray);
	color: var(--ec-text);
}

.ec-budget-preview__heading,
.ec-budget-preview dl > div,
.ec-budget-preview__progress > div:first-child {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.ec-budget-preview__heading span {
	font-weight: 800;
}

.ec-budget-preview__heading small {
	color: var(--ec-text-muted);
}

.ec-budget-preview dl {
	display: grid;
	gap: 0.75rem;
	margin: 1.1rem 0;
}

.ec-budget-preview dl > div {
	padding-bottom: 0.7rem;
	border-bottom: 1px solid var(--ec-border);
}

.ec-budget-preview dt {
	color: var(--ec-text-muted);
	font-size: 0.88rem;
}

.ec-budget-preview dd {
	margin: 0;
	font-weight: 800;
}

.ec-budget-preview__remaining dd {
	color: #16813b;
}

.ec-budget-preview__progress {
	padding: 0.9rem;
	border: 1px solid var(--ec-border);
	border-radius: var(--ec-control-radius);
	background: var(--ec-white);
}

.ec-budget-preview__progress span,
.ec-budget-preview__progress strong {
	font-size: 0.8rem;
}

.ec-budget-preview__track {
	overflow: hidden;
	height: 8px;
	margin-top: 0.7rem;
	border-radius: 999px;
	background: var(--ec-border);
}

.ec-budget-preview__track span {
	display: block;
	width: 23.5%;
	height: 100%;
	border-radius: inherit;
	background: var(--ec-success);
}

.ec-tools__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.25rem;
}

.ec-tool-card {
	display: flex;
	min-height: 100%;
	flex-direction: column;
	padding: 1.35rem;
}

.ec-tool-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--ec-card-shadow-hover);
}

.ec-tool-card__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
}

.ec-tool-card__icon {
	flex: 0 0 46px;
	width: 46px;
	height: 46px;
}

.ec-tool-card__icon svg {
	width: 24px;
	height: 24px;
}

.ec-tool-card__labels {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	justify-content: flex-end;
}

.ec-tool-card__labels span {
	padding: 0.28rem 0.48rem;
	border-radius: 999px;
	background: var(--ec-light-gray);
	color: var(--ec-text-muted);
	font-size: 0.72rem;
	font-weight: 800;
}

.ec-tool-card__body {
	flex: 1;
}

.ec-tool-card h3 {
	margin: 1.15rem 0 0.55rem;
	color: var(--ec-text);
	font-size: 1.12rem;
	line-height: 1.3;
}

.ec-tool-card__description {
	margin: 0;
	color: var(--ec-text-muted);
	font-size: 0.91rem;
	line-height: 1.65;
}

.ec-tool-card__time {
	display: flex;
	gap: 0.4rem;
	align-items: center;
	margin: 0.8rem 0 0;
	color: var(--ec-text-muted);
	font-size: 0.77rem;
	font-weight: 700;
}

.ec-tool-card__time svg {
	width: 16px;
	height: 16px;
}

.ec-tool-card__why {
	margin-top: 1rem;
	padding: 0.9rem;
	border-radius: var(--ec-control-radius);
	background: var(--ec-light-gray);
}

.ec-tool-card__why strong {
	color: #b85400;
}

.ec-tool-card__why p {
	margin: 0;
	color: #4b5563;
	font-size: 0.8rem;
	line-height: 1.55;
}

.ec-tool-card__footer {
	display: flex;
	gap: 0.6rem;
	align-items: center;
	justify-content: space-between;
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--ec-border);
}

.ec-tool-card__footer button,
.ec-tool-card__footer a {
	display: inline-flex;
	min-height: 44px;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	border-radius: 10px;
	font: inherit;
	font-size: 0.78rem;
	font-weight: 800;
	text-decoration: none;
}

.ec-tool-card__footer button {
	padding: 0.6rem 0.72rem;
	border: 1px solid var(--ec-border);
	background: var(--ec-white);
	color: #4b5563;
	cursor: pointer;
}

.ec-tool-card__footer button:disabled {
	cursor: default;
}

.ec-tool-card__footer button[aria-pressed="true"] {
	border-color: var(--ec-orange);
	background: rgba(255, 122, 0, 0.1);
	color: #9a4600;
}

.ec-tool-card__footer a {
	padding: 0.6rem 0.8rem;
	background: var(--ec-dark);
	color: var(--ec-white);
}

.ec-tool-card__footer a:hover {
	background: var(--ec-orange);
	color: var(--ec-dark);
}

.ec-tool-card__footer svg {
	width: 16px;
	height: 16px;
}

.ec-tools.has-recommendations [data-ec-tool-card]:not(.is-recommended) {
	opacity: 0.68;
}

.ec-tools [data-ec-tool-card].is-recommended {
	border-color: var(--ec-orange);
	box-shadow: 0 0 0 2px rgba(255, 122, 0, 0.15), 0 18px 42px rgba(17, 17, 17, 0.1);
}

.ec-tools [data-ec-tool-card].is-recommended::after {
	position: absolute;
	top: 0.8rem;
	left: 0.8rem;
	z-index: 1;
	padding: 0.3rem 0.55rem;
	border-radius: 999px;
	background: var(--ec-orange);
	color: var(--ec-dark);
	content: "Suggested";
	font-size: 0.72rem;
	font-weight: 900;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.ec-featured-tool.is-recommended .ec-featured-tool__icon,
.ec-tool-card.is-recommended .ec-tool-card__icon {
	margin-top: 1.65rem;
}

.ec-tools__disclaimer {
	display: flex;
	max-width: 900px;
	gap: 0.65rem;
	align-items: flex-start;
	margin: 1.5rem 0 0;
	padding: 1rem 1.1rem;
	border: 1px solid var(--ec-border);
	border-radius: 14px;
	background: var(--ec-light-gray);
	color: var(--ec-text-muted);
	font-size: 0.82rem;
	line-height: 1.55;
}

.ec-tools__guides {
	display: grid;
	grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
	gap: 24px;
	margin-top: 24px;
	padding: clamp(22px, 3vw, 32px);
	border: 1px solid var(--ec-border);
	border-radius: var(--ec-card-radius);
	background: var(--ec-white);
}

.ec-tools__guides h3 {
	margin: 0;
	color: var(--ec-dark);
	font-family: Poppins, Inter, sans-serif;
}

.ec-tools__guides ul {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ec-tools__guides li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--ec-border);
}

.ec-tools__guides a {
	color: var(--ec-text);
	font-weight: 700;
}

.ec-tools__guides span {
	color: var(--ec-text-muted);
	font-size: 12px;
	white-space: nowrap;
}

@media (max-width: 700px) {
	.ec-tools__guides {
		grid-template-columns: 1fr;
	}
}

.ec-tools__disclaimer svg {
	flex: 0 0 19px;
	width: 19px;
	height: 19px;
	color: var(--ec-orange);
}

.ec-decision-guide__choices button:focus-visible,
.ec-featured-tool__actions a:focus-visible,
.ec-tool-card__footer button:focus-visible,
.ec-tool-card__footer a:focus-visible {
	box-shadow: var(--ec-focus-ring);
	outline: 0;
}

@media (max-width: 1180px) {
	.ec-tools__layout {
		grid-template-columns: 1fr;
	}

	.ec-featured-tool {
		position: relative;
		top: auto;
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
	}

	.ec-tools__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 960px) {
	.ec-decision-guide {
		grid-template-columns: 1fr;
	}

	.ec-decision-guide__choices {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ec-decision-guide__status {
		grid-column: 1;
	}

	.ec-tools__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 961px) and (max-width: 1080px) {
	.ec-tools__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	.ec-featured-tool {
		display: block;
	}

	.ec-tools.has-recommendations [data-ec-tool-card]:not(.is-recommended) {
		opacity: 0.72;
	}
}

@media (max-width: 620px) {
	.ec-tools {
		margin-top: 4rem;
	}

	.ec-decision-guide,
	.ec-featured-tool,
	.ec-tool-card {
		border-radius: 18px;
	}

	.ec-decision-guide__choices,
	.ec-tools__grid {
		grid-template-columns: 1fr;
	}

	.ec-featured-tool__actions,
	.ec-tool-card__footer {
		align-items: stretch;
		flex-direction: column;
	}

	.ec-featured-tool__actions a,
	.ec-tool-card__footer button,
	.ec-tool-card__footer a {
		width: 100%;
	}

	.ec-tool-card__labels {
		justify-content: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ec-decision-guide__choices button,
	.ec-featured-tool,
	.ec-tool-card {
		transition: none;
	}
}
