/**
 * Shared optimizer layer for legacy custom templates.
 *
 * Goals:
 * - Better spacing rhythm
 * - Premium visual consistency
 * - Improved accessibility states
 * - Lower layout shifts from media/content blocks
 */

body {
	--hwx-template-sec-y: clamp(2.5rem, 4.2vw, 4rem);
	--hwx-template-gap: clamp(1rem, 2vw, 1.75rem);
}

.site-main section {
	padding-block: var(--hwx-template-sec-y);
}

.site-main .container {
	max-width: 1300px !important;
	margin: 0 auto;
	padding: 0 20px;
	width: 100%;
}

.site-main .container-2,
.site-main .container-3,
.site-main .container_own {
	max-width: 1300px !important;
	margin: 0 auto;
	width: 100%;
}

.site-main .testimonials-header {
	text-align: center;
}

.site-main .section-header h2,
.site-main .section-title {
	font-size: clamp(1.5rem, 2.2vw, 2.35rem);
	line-height: 1.2;
	letter-spacing: -0.02em;
	margin-bottom: 0.5rem;
}

.site-main .section-header p,
.site-main .section-description,
.site-main .testimonials-header p,
.site-main .testimonials-header .subtitle {
	max-width: 68ch;
	margin-inline: auto;
	line-height: 1.7;
	display: block;
	margin: 0;
    text-align: left;
}

.site-main .pricing-grid,
.site-main .plugins-grid,
.site-main .tutorials-grid,
.site-main .testimonials-grid,
.site-main .stats-grid {
	gap: var(--hwx-template-gap);
}

.site-main .pricing-card,
.site-main .plugin-card,
.site-main .video-card,
.site-main .testimonial-card,
.site-main .faq-item {
	border-radius: 16px;
	box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.site-main img {
	display: block;
	max-width: 100%;
	height: auto;
}

.site-main .plugin-image,
.site-main .video-thumbnail,
.site-main .story-image,
.site-main .about-image,
.site-main .paid-image {
	overflow: hidden;
	border-radius: 14px;
	background: #f3f4f6;
}

.site-main .video-thumbnail {
	aspect-ratio: 16 / 9;
}

.site-main .video-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
	outline: 3px solid #c47a1a;
	outline-offset: 2px;
}

@media (max-width: 768px) {
	body {
		--hwx-template-sec-y: clamp(2rem, 5vw, 2.75rem);
	}

	.site-main .container {
		padding: 0 16px;
	}

	.site-main .section-header p,
	.site-main .section-description,
	.site-main .testimonials-header p,
	.site-main .testimonials-header .subtitle {
		max-width: 100%;
	}
}

/* -------------------------------------------------------------------------
 * Legal / policy templates (privacy, refund, terms) — matches CATC hero + sections
 * ------------------------------------------------------------------------- */

.hwx-catc-pro-wrap .hwx-policy-hero-visual {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: min(52vw, 320px);
	border-radius: 24px;
	background: linear-gradient(
		145deg,
		rgba(102, 126, 234, 0.14) 0%,
		rgba(118, 75, 162, 0.1) 50%,
		rgba(15, 23, 42, 0.04) 100%
	);
	border: 1px solid rgba(102, 126, 234, 0.22);
	box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.hwx-catc-pro-wrap .hwx-policy-hero-visual__icon {
	font-size: clamp(3.5rem, 14vw, 6.5rem);
	line-height: 1;
	color: #5a67d8;
	opacity: 0.92;
}

.hwx-catc-pro-wrap .hwx-legal-body {
	padding-block: clamp(2.5rem, 5vw, 4rem);
}

.hwx-catc-pro-wrap .hwx-legal-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
	gap: clamp(1.5rem, 3vw, 2.75rem);
	align-items: start;
}

.hwx-catc-pro-wrap .hwx-legal-main {
	background: #fff;
	border-radius: 20px;
	padding: clamp(1.5rem, 3.2vw, 3rem);
	box-shadow: 0 20px 60px rgba(15, 23, 42, 0.1);
}

.hwx-catc-pro-wrap .hwx-legal-block {
	margin-bottom: 2.25rem;
}

.hwx-catc-pro-wrap .hwx-legal-block:last-child {
	margin-bottom: 0;
}

.hwx-catc-pro-wrap .hwx-legal-main .policy-heading {
	font-size: clamp(1.35rem, 2.1vw, 1.85rem);
	font-weight: 700;
	color: #1e293b;
	margin: 0 0 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 2px solid #e2e8f0;
	position: relative;
}

.hwx-catc-pro-wrap .hwx-legal-main .policy-heading::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 72px;
	height: 2px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 2px;
}

.hwx-catc-pro-wrap .hwx-legal-main .policy-text {
	color: #374151;
	line-height: 1.8;
	font-size: 1.05rem;
}

.hwx-catc-pro-wrap .hwx-legal-main .policy-text p {
	margin: 0 0 1.1em;
}

.hwx-catc-pro-wrap .hwx-legal-main .policy-text h3 {
	font-size: 1.2rem;
	font-weight: 600;
	color: #1e293b;
	margin: 1.5em 0 0.65em;
}

.hwx-catc-pro-wrap .hwx-legal-main .policy-text h3:first-child {
	margin-top: 0;
}

.hwx-catc-pro-wrap .hwx-legal-main .policy-text a {
	color: #5a67d8;
	font-weight: 500;
	text-decoration: none;
	transition: color 0.2s ease;
}

.hwx-catc-pro-wrap .hwx-legal-main .policy-text a:hover {
	color: #4338ca;
	text-decoration: underline;
}

.hwx-catc-pro-wrap .hwx-legal-aside {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.hwx-catc-pro-wrap .hwx-legal-sidebar-card {
	background: #fff;
	border-radius: 18px;
	padding: 1.35rem 1.25rem;
	box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
	border: 1px solid rgba(226, 232, 240, 0.9);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.hwx-catc-pro-wrap .hwx-legal-sidebar-card:hover {
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
	transform: translateY(-2px);
}

.hwx-catc-pro-wrap .hwx-legal-sidebar-card h3 {
	font-size: 1.05rem;
	font-weight: 600;
	color: #1e293b;
	margin: 0 0 1rem;
	padding-bottom: 0.65rem;
	border-bottom: 2px solid #e2e8f0;
}

.hwx-catc-pro-wrap .hwx-legal-summary {
	list-style: none;
	margin: 0;
	padding: 0;
}

.hwx-catc-pro-wrap .hwx-legal-summary li {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.55rem 0;
	border-bottom: 1px solid #f1f5f9;
	color: #4b5563;
	font-size: 0.95rem;
	font-weight: 500;
}

.hwx-catc-pro-wrap .hwx-legal-summary li:last-child {
	border-bottom: none;
}

.hwx-catc-pro-wrap .hwx-legal-summary i {
	color: #10b981;
	font-size: 1rem;
	flex-shrink: 0;
}

.hwx-catc-pro-wrap .hwx-legal-update {
	font-size: 1.05rem;
	font-weight: 600;
	color: #5a67d8;
	text-align: center;
	margin: 0 0 0.75rem;
	padding: 0.85rem;
	background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
	border-radius: 12px;
}

.hwx-catc-pro-wrap .hwx-legal-note {
	color: #64748b;
	font-size: 0.9rem;
	line-height: 1.65;
	margin: 0;
	text-align: center;
	font-style: italic;
}

.hwx-catc-pro-wrap .hwx-legal-support-text {
	color: #64748b;
	font-size: 0.92rem;
	line-height: 1.65;
	margin: 0 0 1rem;
}

.hwx-catc-pro-wrap .hwx-legal-support-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	box-sizing: border-box;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff !important;
	text-decoration: none !important;
	padding: 0.65rem 1rem;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.92rem;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
}

.hwx-catc-pro-wrap .hwx-legal-support-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 22px rgba(102, 126, 234, 0.45);
	color: #fff !important;
}

.hwx-catc-pro-wrap .hwx-legal-fact {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	padding: 0.65rem 0;
	border-bottom: 1px solid #f1f5f9;
	font-size: 0.88rem;
}

.hwx-catc-pro-wrap .hwx-legal-fact:last-child {
	border-bottom: none;
}

.hwx-catc-pro-wrap .hwx-legal-fact-label {
	color: #64748b;
	font-weight: 500;
}

.hwx-catc-pro-wrap .hwx-legal-fact-value {
	color: #1e293b;
	font-weight: 600;
	background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
	padding: 0.35rem 0.65rem;
	border-radius: 8px;
	white-space: nowrap;
}

@media (max-width: 1024px) {
	.hwx-catc-pro-wrap .hwx-legal-grid {
		grid-template-columns: 1fr;
	}

	.hwx-catc-pro-wrap .hwx-legal-aside {
		order: 2;
	}

	.hwx-catc-pro-wrap .hwx-legal-main {
		order: 1;
	}
}

@media (max-width: 576px) {
	.hwx-catc-pro-wrap .hwx-legal-fact {
		flex-direction: column;
		align-items: flex-start;
	}
}
