/**
 * Frontend Styles for Calculators Catalog Hub
 * Scoped, modern, lightweight, responsive and standalone.
 */

:root {
	--cch-front-primary: #0284c7;
	--cch-front-primary-hover: #0369a1;
	--cch-front-slate-900: #0f172a;
	--cch-front-slate-800: #1e293b;
	--cch-front-slate-700: #334155;
	--cch-front-slate-600: #475569;
	--cch-front-slate-500: #64748b;
	--cch-front-slate-400: #94a3b8;
	--cch-front-slate-200: #e2e8f0;
	--cch-front-slate-100: #f1f5f9;
	--cch-front-slate-50: #f8fafc;
	--cch-front-radius-sm: 8px;
	--cch-front-radius: 14px;
	--cch-front-radius-lg: 20px;
	--cch-front-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
	--cch-front-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.07);
	--cch-front-shadow-hover: 0 12px 25px -4px rgba(0, 0, 0, 0.1), 0 6px 12px -3px rgba(0, 0, 0, 0.06);
	--cch-front-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==================== WRAPPER & CONTAINER ==================== */
.cch-catalog-wrapper {
	background-color: var(--cch-front-slate-50);
	color: var(--cch-front-slate-700);
	font-family: var(--cch-front-font);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	padding: 48px 16px 80px 16px;
	width: 100%;
	box-sizing: border-box;
}

.cch-catalog-wrapper *,
.cch-catalog-wrapper *::before,
.cch-catalog-wrapper *::after {
	box-sizing: border-box;
}

.cch-container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 8px;
}

/* ==================== HEADER SECTION ==================== */
.cch-header-block {
	text-align: center;
	margin-bottom: 40px;
}

.cch-main-title {
	font-size: 36px;
	font-weight: 800;
	color: var(--cch-front-slate-900);
	letter-spacing: -0.03em;
	line-height: 1.2;
	margin: 0 0 16px 0;
}

@media (min-width: 768px) {
	.cch-main-title {
		font-size: 46px;
	}
}

.cch-main-subtitle {
	font-size: 17px;
	line-height: 1.6;
	color: var(--cch-front-slate-600);
	max-width: 760px;
	margin: 0 auto;
}

/* ==================== LIVE SEARCH BOX ==================== */
.cch-search-container {
	max-width: 640px;
	margin: 0 auto 36px auto;
	position: relative;
}

.cch-search-input-wrap {
	position: relative;
	display: flex;
	align-items: center;
	background: #ffffff;
	border: 1px solid var(--cch-front-slate-200);
	border-radius: 9999px;
	padding: 4px 18px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	transition: all 0.25s ease;
}

.cch-search-input-wrap:focus-within {
	border-color: var(--cch-front-primary);
	box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}

.cch-search-icon {
	display: flex;
	align-items: center;
	color: var(--cch-front-slate-400);
	margin-right: 12px;
	flex-shrink: 0;
}

.cch-live-search-input {
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	padding: 10px 0 !important;
	font-size: 15px !important;
	color: var(--cch-front-slate-900) !important;
	width: 100% !important;
	font-family: inherit !important;
}

.cch-live-search-input::placeholder {
	color: var(--cch-front-slate-400);
}

.cch-search-clear {
	background: #e2e8f0;
	border: none;
	border-radius: 50%;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--cch-front-slate-600);
	font-size: 16px;
	line-height: 1;
	transition: all 0.2s ease;
	flex-shrink: 0;
	padding: 0;
}

.cch-search-clear:hover {
	background: #cbd5e1;
	color: var(--cch-front-slate-900);
}

.cch-search-feedback {
	text-align: center;
	margin-top: 10px;
	font-size: 13px;
	color: var(--cch-front-slate-500);
}

.cch-search-feedback strong {
	color: var(--cch-front-primary);
}

/* ==================== TABS NAVIGATION ==================== */
.cch-tabs-nav {
	display: flex;
	flex-direction: column;
	gap: 16px;
	border-bottom: 2px solid var(--cch-front-slate-200);
	margin-bottom: 36px;
	padding-bottom: 4px;
}

@media (min-width: 768px) {
	.cch-tabs-nav {
		flex-direction: row;
		gap: 32px;
		padding-bottom: 0;
	}
}

.cch-tab-btn {
	background: transparent;
	border: none;
	border-bottom: 4px solid transparent;
	padding: 8px 4px 16px 4px;
	display: flex;
	align-items: center;
	text-align: left;
	cursor: pointer;
	transition: all 0.25s ease;
	color: var(--cch-front-slate-400);
	outline: none;
	margin-bottom: -2px;
}

.cch-tab-icon {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: rgba(226, 232, 240, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--cch-front-slate-400);
	transition: all 0.25s ease;
}

.cch-tab-icon .cch-svg-icon {
	width: 24px;
	height: 24px;
}

.cch-tab-text {
	margin-left: 16px;
	display: flex;
	flex-direction: column;
}

.cch-tab-full-name {
	font-size: 20px;
	font-weight: 700;
	color: var(--cch-front-slate-400);
	transition: color 0.25s ease;
	line-height: 1.3;
}

@media (min-width: 768px) {
	.cch-tab-full-name {
		font-size: 24px;
	}
}

.cch-tab-short-name {
	display: none;
}

/* Hover State */
.cch-tab-btn:hover {
	border-bottom-color: var(--cch-front-slate-300);
}

.cch-tab-btn:hover .cch-tab-full-name {
	color: var(--cch-front-slate-600);
}

.cch-tab-btn:hover .cch-tab-icon {
	color: var(--cch-front-slate-600);
}

/* Active Tab State */
.cch-tab-btn.cch-tab-active {
	border-bottom-color: var(--cch-front-primary);
}

.cch-tab-btn.cch-tab-active .cch-tab-full-name {
	color: var(--cch-front-slate-900);
}

.cch-tab-btn.cch-tab-active .cch-tab-icon {
	background: rgba(2, 132, 199, 0.1) !important;
	color: var(--cch-front-primary) !important;
}

/* ==================== TABS CONTENT & GRID ==================== */
.cch-tabs-content-wrap {
	position: relative;
	min-height: 200px;
}

.cch-tab-pane {
	animation: cchFadeIn 0.4s ease-in-out;
}

@keyframes cchFadeIn {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.cch-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
}

@media (min-width: 640px) {
	.cch-grid.cch-cols-2,
	.cch-grid.cch-cols-3,
	.cch-grid.cch-cols-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.cch-grid.cch-cols-3 {
		grid-template-columns: repeat(3, 1fr);
	}
	.cch-grid.cch-cols-4 {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* ==================== CALCULATOR CARD ==================== */
.cch-card {
	background: #ffffff;
	border: 1px solid rgba(226, 232, 240, 0.8);
	border-radius: var(--cch-front-radius);
	padding: 24px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	text-decoration: none !important;
	color: inherit;
	box-shadow: var(--cch-front-shadow-sm);
	position: relative;
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
	overflow: visible;
	margin-top: 8px;
}

.cch-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--cch-front-shadow-hover);
	border-color: rgba(203, 213, 225, 0.9);
}

.cch-card-badge-wrap {
	position: absolute;
	top: 0;
	right: 20px;
	transform: translateY(-50%);
	z-index: 10;
	pointer-events: none;
}

.cch-badge {
	display: inline-flex;
	align-items: center;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	padding: 4px 11px;
	border-radius: 9999px;
	line-height: 1.2;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	white-space: nowrap;
}

.cch-badge-emerald {
	background-color: #ecfdf5;
	color: #059669;
	border: 1px solid #a7f3d0;
}

.cch-badge-sky {
	background-color: #e0f2fe;
	color: #0284c7;
	border: 1px solid #bae6fd;
}

.cch-badge-amber {
	background-color: #fffbeb;
	color: #d97706;
	border: 1px solid #fde68a;
}

.cch-badge-rose {
	background-color: #fff1f2;
	color: #e11d48;
	border: 1px solid #fecdd3;
}

.cch-badge-purple {
	background-color: #f5f3ff;
	color: #7c3aed;
	border: 1px solid #ddd6fe;
}

/* Card Image */
.cch-card-image-box {
	margin: -24px -24px 16px -24px;
	height: var(--cch-card-img-height, 150px);
	background: var(--cch-front-slate-100);
	overflow: hidden;
	position: relative;
	border-radius: calc(var(--cch-front-radius) - 1px) calc(var(--cch-front-radius) - 1px) 0 0;
}

.cch-card-image-box img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.cch-card:hover .cch-card-image-box img {
	transform: scale(1.05);
}

/* Card Content */
.cch-card-content {
	display: flex;
	flex-direction: column;
	flex: 1;
	justify-content: space-between;
}

.cch-card-title {
	font-size: 19px;
	font-weight: 700;
	color: var(--cch-front-slate-900);
	margin: 0 0 10px 0;
	line-height: 1.35;
	transition: color 0.2s ease;
}

.cch-card:hover .cch-card-title {
	color: var(--cch-front-primary);
}

.cch-card-desc {
	font-size: 14px;
	line-height: 1.55;
	color: var(--cch-front-slate-500);
	margin: 0 0 20px 0;
	flex: 1;
}

/* Card Action */
.cch-card-action {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	margin-top: auto;
	padding-top: 12px;
	font-size: 14px;
	font-weight: 600;
	color: var(--cch-front-primary);
	transition: color 0.2s ease;
}

.cch-card-action-arrow {
	width: 18px;
	height: 18px;
	margin-left: 6px;
	transition: transform 0.25s ease;
}

.cch-card:hover .cch-card-action-arrow {
	transform: translateX(4px);
}

/* ==================== NO RESULTS STATE ==================== */
.cch-no-results {
	text-align: center;
	padding: 60px 20px;
	background: #ffffff;
	border-radius: var(--cch-front-radius);
	border: 1px dashed var(--cch-front-slate-200);
	max-width: 600px;
	margin: 20px auto;
}

.cch-no-results-icon {
	font-size: 40px;
	margin-bottom: 12px;
}

.cch-no-results-title {
	font-size: 22px;
	font-weight: 700;
	color: var(--cch-front-slate-900);
	margin: 0 0 8px 0;
}

.cch-no-results-text {
	font-size: 15px;
	color: var(--cch-front-slate-500);
	margin: 0 0 20px 0;
}

.cch-btn-suggest {
	display: inline-block;
	background: var(--cch-front-primary);
	color: #ffffff !important;
	padding: 10px 24px;
	border-radius: 9999px;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none !important;
	transition: all 0.2s ease;
}

.cch-btn-suggest:hover {
	background: var(--cch-front-primary-hover);
	transform: translateY(-1px);
}

/* ==================== CTA BOTTOM CARD ==================== */
.cch-cta-card {
	margin-top: 70px;
	text-align: center;
	background: #ffffff;
	padding: 44px 28px;
	border-radius: var(--cch-front-radius-lg);
	border: 1px solid var(--cch-front-slate-200);
	box-shadow: var(--cch-front-shadow-sm);
}

.cch-cta-title {
	font-size: 26px;
	font-weight: 800;
	color: var(--cch-front-slate-900);
	margin: 0 0 12px 0;
}

.cch-cta-text {
	font-size: 16px;
	line-height: 1.6;
	color: var(--cch-front-slate-600);
	max-width: 580px;
	margin: 0 auto 28px auto;
}

.cch-cta-btn-wrap {
	margin-top: 20px;
}

.cch-cta-btn {
	background-color: var(--cch-front-primary);
	color: #ffffff !important;
	padding: 14px 34px;
	border-radius: 9999px;
	font-size: 16px;
	font-weight: 700;
	text-decoration: none !important;
	display: inline-block;
	transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
	box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.cch-cta-btn:hover {
	background-color: var(--cch-front-primary-hover);
	transform: scale(1.04);
	box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}
