/* Homepage: stacked header → search hub → compact hero */

:root {
	--ai-home-bg: #ffffff;
	--ai-home-surface: transparent;
	--ai-home-border: #e2e8f0;
	--ai-home-accent: #2563eb;
	--ai-home-text: #0f172a;
	--ai-home-muted: #64748b;
	--ai-home-content-max: 1200px;
	--ai-home-content-gutter: 24px;
	--ai-home-hero-image: url("https://ai-gen.online/wp-content/uploads/2026/02/ComfyUI_temp_xntqy_00006_.jpg");
	--ai-home-hero-bg-position: 88% 14%;
	--ai-home-hero-bg-position-mobile: 78% 10%;
}

body.ai-gen-light-header .site-header,
body.ai-gen-light-header header.site-header,
body.ai-gen-light-header #masthead {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	z-index: 100;
	background: var(--ai-home-bg) !important;
	box-shadow: none !important;
}

body.ai-gen-light-header #masthead {
	padding: 12px 16px 0;
	background: var(--ai-home-bg) !important;
}

body.ai-gen-light-header #page {
	background: var(--ai-home-bg);
}

/* Auth pill — в правом углу шапки (см. ai-gen-header-bar.css) */

body.ai-gen-light-header .ast-primary-header-bar,
body.ai-gen-light-header .main-header-bar,
body.ai-gen-light-header .ast-header-wrap,
body.ai-gen-light-header #ast-desktop-header {
	background: transparent !important;
	backdrop-filter: none !important;
	-webkit-backdrop-filter: none !important;
	border: 0 !important;
	width: 100% !important;
	max-width: none !important;
}

body.ai-gen-light-header #masthead .site-primary-header-wrap,
body.ai-gen-light-header #masthead .site-primary-header-wrap.ast-container,
body.ai-gen-light-header #masthead .ast-builder-grid-row-container {
	max-width: var(--ai-home-content-max) !important;
	width: min(var(--ai-home-content-max), calc(100% - var(--ai-home-content-gutter) * 2)) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding: 10px 18px !important;
	box-sizing: border-box;
	background: transparent !important;
	backdrop-filter: none !important;
	-webkit-backdrop-filter: none !important;
	border: 0 !important;
	border-radius: 0;
	box-shadow: none !important;
}

body.ai-gen-light-header .main-header-menu > .menu-item > .menu-link,
body.ai-gen-light-header .ast-builder-menu-1 .menu-item > .menu-link,
body.ai-gen-light-header .site-header .menu-link,
body.ai-gen-light-header .ai-gen-auth-toolbar .button {
	color: var(--ai-home-text) !important;
}

/* Elementor pages (/policy/, /about/, …): hero already has H1. */
body.ai-gen-light-header.ai-gen-static-page.elementor-page .entry-header {
	display: none !important;
}

body.ai-gen-light-header.ai-gen-static-page #primary,
body.ai-gen-light-header.ai-gen-static-page .site-main,
body.ai-gen-light-header.ai-gen-static-page #content {
	background: var(--ai-home-bg) !important;
}

/* Search hub — directly under masthead, light surface */
body.ai-gen-home .ai-gen-home-hub {
	width: 100%;
	padding: 8px 16px 16px;
	background: var(--ai-home-bg) !important;
	color: var(--ai-home-text);
	box-sizing: border-box;
}

body.ai-gen-home .ai-gen-home-hub__inner {
	max-width: var(--ai-home-content-max);
	width: min(var(--ai-home-content-max), calc(100% - var(--ai-home-content-gutter) * 2));
	margin: 0 auto;
	padding: 0 2px 4px;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.ai-gen-home-hub__search-form {
	display: flex;
	align-items: stretch;
	gap: 0;
	background: #f8fafc;
	border: 1px solid var(--ai-home-border);
	border-radius: 14px;
	overflow: hidden;
	margin-bottom: 14px;
	min-height: 52px;
}

.ai-gen-home-hub__search-icon {
	display: flex;
	align-items: center;
	padding: 0 14px 0 16px;
	color: var(--ai-home-muted);
	flex-shrink: 0;
}

.ai-gen-home-hub__search-icon svg {
	width: 20px !important;
	height: 20px !important;
	max-width: 20px !important;
	max-height: 20px !important;
	stroke: var(--ai-home-muted) !important;
}

.ai-gen-home-hub__search-input {
	flex: 1;
	border: 0;
	background: #fff;
	padding: 14px 10px;
	font-size: 0.975rem;
	color: #0f172a;
	min-width: 0;
}

.ai-gen-home-hub__search-input::placeholder {
	color: #64748b;
}

.ai-gen-home-hub__search-input:focus {
	outline: 2px solid rgba(96, 165, 250, 0.45);
	outline-offset: -2px;
}

.ai-gen-home-hub__search-btn {
	border: 0;
	background: var(--ai-home-accent);
	color: #fff;
	font-weight: 700;
	font-size: 0.8125rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	padding: 0 20px;
	margin: 5px;
	border-radius: 10px;
	cursor: pointer;
	flex-shrink: 0;
	line-height: 1.2;
	box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
	transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.ai-gen-home-hub__search-btn:hover,
.ai-gen-home-hub__search-btn:focus-visible {
	background: #1d4ed8;
	transform: translateY(-1px);
}

.ai-gen-home-hub__categories {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px 6px;
}

.ai-gen-home-hub__cat {
	display: flex !important;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 6px 4px;
	border-radius: 12px;
	background: transparent;
	border: 0;
	text-decoration: none;
	color: #475569;
	transition: transform 0.15s ease, color 0.15s ease;
}

.ai-gen-home-hub__cat:hover,
.ai-gen-home-hub__cat:focus-visible {
	transform: translateY(-2px);
	color: var(--ai-home-text);
}

.ai-gen-home-hub__cat-icon {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 48px !important;
	height: 48px !important;
	min-width: 48px !important;
	max-width: 48px !important;
	min-height: 48px !important;
	max-height: 48px !important;
	border-radius: 12px;
	background: #f1f5f9;
	border: 1px solid var(--ai-home-border);
	color: #334155;
	overflow: visible;
	flex-shrink: 0;
	box-shadow: none;
}

.ai-gen-home-hub__cat-icon svg,
.ai-gen-home-hub__cat-icon svg path,
.ai-gen-home-hub__cat-icon svg circle,
.ai-gen-home-hub__cat-icon svg rect {
	stroke: #334155 !important;
	color: #334155 !important;
	fill: none;
}

.ai-gen-home-hub__cat-icon svg circle[fill="currentColor"] {
	fill: var(--ai-home-accent) !important;
	stroke: none !important;
}

.ai-gen-home-hub__cat-icon svg {
	width: 22px !important;
	height: 22px !important;
	max-width: 22px !important;
	max-height: 22px !important;
	opacity: 1 !important;
}

.ai-gen-home-hub__cat:hover .ai-gen-home-hub__cat-icon,
.ai-gen-home-hub__cat:focus-visible .ai-gen-home-hub__cat-icon {
	border-color: rgba(37, 99, 235, 0.45);
	background: #eff6ff;
}

.ai-gen-home-hub__cat-label {
	font-size: 0.72rem;
	font-weight: 600;
	text-align: center;
	line-height: 1.25;
	max-width: 9em;
	color: #475569;
}

.ai-gen-home-hub__results {
	margin-top: 20px;
	padding-top: 8px;
	border-top: 1px solid var(--ai-home-border);
}

.ai-gen-home-hub__results-title {
	font-size: 1.05rem;
	margin: 0 0 14px;
	color: var(--ai-home-text);
	font-weight: 600;
}

.ai-gen-home-hub__empty {
	color: var(--ai-home-muted);
	margin: 12px 0 0;
}

.ai-gen-home-hub__results-grid .ai-gen-ready-templates__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

/* Hero bg: override Elementor post-10.css before JS adds .ai-gen-home-hero (prevents flash) */
body.ai-gen-home .elementor.elementor-10 > .e-con.e-parent:has(h1):not(.elementor-motion-effects-element-type-background),
body.ai-gen-home .elementor.elementor-10 > .e-con.e-parent:has(h1) > .elementor-motion-effects-container > .elementor-motion-effects-layer,
body.ai-gen-home .ai-gen-home-hero:not(.elementor-motion-effects-element-type-background),
body.ai-gen-home .ai-gen-home-hero > .elementor-motion-effects-container > .elementor-motion-effects-layer {
	background-image: var(--ai-home-hero-image) !important;
	background-size: cover !important;
	background-repeat: no-repeat !important;
	background-attachment: scroll !important;
	background-position: var(--ai-home-hero-bg-position) !important;
}

body.ai-gen-home .elementor.elementor-10 > .e-con.e-parent:has(h1)::before,
body.ai-gen-home .elementor.elementor-10 > .e-con.e-parent:has(h1) > .elementor-motion-effects-container > .elementor-motion-effects-layer::before,
body.ai-gen-home .ai-gen-home-hero::before,
body.ai-gen-home .ai-gen-home-hero > .elementor-motion-effects-container > .elementor-motion-effects-layer::before {
	background: transparent !important;
	background-image: none !important;
}

@media (min-width: 1025px) {
	body.ai-gen-home .elementor.elementor-10 > .e-con.e-parent:has(h1):not(.elementor-motion-effects-element-type-background),
	body.ai-gen-home .elementor.elementor-10 > .e-con.e-parent:has(h1) > .elementor-motion-effects-container > .elementor-motion-effects-layer,
	body.ai-gen-home .ai-gen-home-hero:not(.elementor-motion-effects-element-type-background),
	body.ai-gen-home .ai-gen-home-hero > .elementor-motion-effects-container > .elementor-motion-effects-layer {
		background-attachment: scroll !important;
	}
}

/* Hero — light card aligned with page (photo peeks on the right) */
body.ai-gen-home #content .elementor > .ai-gen-home-hero,
body.ai-gen-home .entry-content > .elementor > .ai-gen-home-hero {
	flex: 0 0 auto !important;
	width: min(var(--ai-home-content-max), calc(100% - var(--ai-home-content-gutter) * 2)) !important;
	max-width: var(--ai-home-content-max) !important;
	margin: 12px auto 0 !important;
	align-self: center !important;
}

body.ai-gen-home .ai-gen-home-hero {
	min-height: 0 !important;
	border-radius: 16px;
	overflow: hidden;
	border: 1px solid var(--ai-home-border);
	box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
	background-image: var(--ai-home-hero-image) !important;
	background-size: cover !important;
	background-repeat: no-repeat !important;
	background-attachment: scroll !important;
	background-position: var(--ai-home-hero-bg-position) !important;
}

body.ai-gen-home .ai-gen-home-hero:not(.elementor-motion-effects-element-type-background),
body.ai-gen-home .ai-gen-home-hero > .elementor-motion-effects-container > .elementor-motion-effects-layer {
	background-image: var(--ai-home-hero-image) !important;
	background-size: cover !important;
	background-repeat: no-repeat !important;
	background-attachment: scroll !important;
	background-position: var(--ai-home-hero-bg-position) !important;
}

body.ai-gen-home .ai-gen-home-hero > .elementor-motion-effects-container,
body.ai-gen-home .ai-gen-home-hero > .elementor-motion-effects-container > .elementor-motion-effects-layer {
	transform: none !important;
	height: 100% !important;
	top: 0 !important;
}

body.ai-gen-home .ai-gen-home-hero > .e-con-inner,
body.ai-gen-home .ai-gen-home-hero > .elementor-container {
	position: relative;
	z-index: 2;
	min-height: clamp(444px, 54vh, 588px) !important;
	padding: clamp(18px, 3vw, 28px) clamp(18px, 4vw, 32px) !important;
}

body.ai-gen-home .ai-gen-home-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		#ffffff 0%,
		rgba(255, 255, 255, 0.98) 42%,
		rgba(255, 255, 255, 0.88) 58%,
		rgba(255, 255, 255, 0.45) 78%,
		rgba(255, 255, 255, 0.15) 100%
	);
	z-index: 1;
	pointer-events: none;
}

body.ai-gen-home .ai-gen-home-hero .elementor-heading-title {
	color: #0f172a !important;
	text-shadow: none;
	font-size: clamp(1.35rem, 2.6vw, 1.75rem) !important;
	line-height: 1.15 !important;
	margin-bottom: 0.35em !important;
	font-weight: 700 !important;
	letter-spacing: -0.02em;
	max-width: 16em;
}

body.ai-gen-home .ai-gen-home-hero .elementor-widget-text-editor,
body.ai-gen-home .ai-gen-home-hero .elementor-widget-text-editor p {
	color: #475569 !important;
	font-size: clamp(0.875rem, 1.5vw, 1rem) !important;
	line-height: 1.45 !important;
	max-width: 28em;
}

body.ai-gen-home .ai-gen-home-hero .elementor-button-wrapper {
	margin-top: 6px;
}

/* Unified primary CTA buttons across homepage content */
body.ai-gen-home .elementor-widget-button .elementor-button,
body.ai-gen-home a.elementor-button.elementor-button-link {
	border: 0 !important;
	color: #fff !important;
	background: var(--ai-home-accent) !important;
	fill: #fff !important;
	padding: 0.65em 1.35em !important;
	font-size: 0.8125rem !important;
	font-weight: 700 !important;
	letter-spacing: 0.05em !important;
	text-transform: uppercase !important;
	border-radius: 10px !important;
	box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28) !important;
	line-height: 1.2 !important;
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease !important;
}

body.ai-gen-home .elementor-widget-button .elementor-button:hover,
body.ai-gen-home .elementor-widget-button .elementor-button:focus-visible,
body.ai-gen-home a.elementor-button.elementor-button-link:hover,
body.ai-gen-home a.elementor-button.elementor-button-link:focus-visible {
	background: #1d4ed8 !important;
	color: #fff !important;
	fill: #fff !important;
	transform: translateY(-1px);
}

/* Partner logos — separate strip, equal logo sizes */
body.ai-gen-home #content .elementor > .ai-gen-home-hero-carousel,
body.ai-gen-home .entry-content > .elementor > .ai-gen-home-hero-carousel {
	flex: 0 0 auto !important;
	width: min(var(--ai-home-content-max), calc(100% - var(--ai-home-content-gutter) * 2)) !important;
	max-width: var(--ai-home-content-max) !important;
	margin: 10px auto 4px !important;
	align-self: center !important;
}

/* Elementor blocks on homepage — same width as Special offer / lower sections */
body.ai-gen-home #content .elementor.elementor-10 > .e-con:not(.ai-gen-home-popular),
body.ai-gen-home .entry-content > .elementor.elementor-10 > .e-con:not(.ai-gen-home-popular) {
	width: min(var(--ai-home-content-max), calc(100% - var(--ai-home-content-gutter) * 2)) !important;
	max-width: var(--ai-home-content-max) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	align-self: center !important;
}

body.ai-gen-home .ai-gen-home-hero-carousel {
	min-height: 0 !important;
	padding: 0 !important;
	overflow: visible;
	background: #f8fafc;
	border: 1px solid var(--ai-home-border);
	border-radius: 14px;
	box-shadow: none;
}

body.ai-gen-home .ai-gen-home-hero-carousel > .e-con-inner,
body.ai-gen-home .ai-gen-home-hero-carousel > .elementor-container {
	padding: 14px 18px !important;
	min-height: 0 !important;
}

body.ai-gen-home .ai-gen-home-hero-carousel .elementor-widget-image-carousel,
body.ai-gen-home .ai-gen-home-hero-carousel .elementor-image-carousel-wrapper,
body.ai-gen-home .ai-gen-home-hero-carousel .swiper {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	min-height: 0 !important;
	height: auto !important;
	max-height: none !important;
}

body.ai-gen-home .ai-gen-home-hero-carousel .swiper-wrapper {
	align-items: center;
	min-height: 0 !important;
	height: auto !important;
	max-height: none !important;
}

body.ai-gen-home .ai-gen-home-hero-carousel .swiper-slide {
	height: auto !important;
	min-height: 36px !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
}

body.ai-gen-home .ai-gen-home-hero-carousel .swiper-slide-inner,
body.ai-gen-home .ai-gen-home-hero-carousel .swiper-slide figure {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0 8px;
}

body.ai-gen-home .ai-gen-home-hero-carousel .swiper-slide img {
	display: block;
	max-height: 26px !important;
	max-width: 108px !important;
	width: auto !important;
	height: auto !important;
	object-fit: contain;
	opacity: 0.82;
	filter: grayscale(15%);
}

body.ai-gen-home .ai-gen-home-hero-carousel .elementor-swiper-button,
body.ai-gen-home .ai-gen-home-hero-carousel .swiper-button-prev,
body.ai-gen-home .ai-gen-home-hero-carousel .swiper-button-next {
	display: none !important;
}

/* Full-width plugin sections inside Elementor */
.elementor.elementor-10 > .ai-gen-home-popular,
.ai-gen-home-popular {
	width: 100% !important;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	flex: 0 0 100% !important;
	align-self: stretch !important;
	box-sizing: border-box;
}

@media (min-width: 640px) {
	.ai-gen-home-hub__results-grid .ai-gen-ready-templates__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 922px) {
	.ai-gen-home-hub__categories {
		grid-template-columns: repeat(8, minmax(0, 1fr));
	}
}

@media (min-width: 992px) {
	.ai-gen-home-hub__results-grid .ai-gen-ready-templates__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Popular carousel */
.ai-gen-home-popular {
	padding: clamp(28px, 4vw, 40px) clamp(16px, 4vw, 32px);
	background: #f8fafc;
	border-top: 1px solid #e2e8f0;
}

.ai-gen-home-popular__head {
	max-width: var(--ai-home-content-max);
	width: min(var(--ai-home-content-max), calc(100% - var(--ai-home-content-gutter) * 2));
	margin: 0 auto 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.ai-gen-home-popular__actions {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-shrink: 0;
}

.ai-gen-home-popular__nav-group {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.ai-gen-home-popular__title {
	margin: 0;
	font-size: clamp(1.2rem, 2.5vw, 1.45rem);
	color: #0f172a;
	font-weight: 700;
}

.ai-gen-home-popular__all {
	color: #2563eb;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9375rem;
	white-space: nowrap;
}

.ai-gen-home-popular__track-wrap {
	max-width: var(--ai-home-content-max);
	width: min(var(--ai-home-content-max), calc(100% - var(--ai-home-content-gutter) * 2));
	margin: 0 auto;
	position: relative;
}

.ai-gen-home-popular__track {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding: 4px 2px 12px;
	-webkit-overflow-scrolling: touch;
}

.ai-gen-home-popular__track::-webkit-scrollbar {
	display: none;
}

.ai-gen-home-popular__slide {
	flex: 0 0 min(168px, 45vw);
	width: min(168px, 45vw);
	scroll-snap-align: start;
}

.ai-gen-home-popular__slide .ai-gen-ready-templates__card {
	aspect-ratio: 4 / 3;
	min-height: 0;
	width: 100%;
}

.ai-gen-home-popular__nav {
	position: static;
	transform: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border-radius: 10px;
	border: 1px solid var(--ai-home-border);
	background: #fff;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
	cursor: pointer;
	color: #334155;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.ai-gen-home-popular__nav svg {
	display: block;
	width: 18px;
	height: 18px;
}

.ai-gen-home-popular__nav:hover,
.ai-gen-home-popular__nav:focus-visible {
	border-color: rgba(37, 99, 235, 0.45);
	background: #eff6ff;
	color: var(--ai-home-accent);
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
	outline: none;
}

.ai-gen-home-popular__nav:disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

@media (min-width: 768px) {
	.ai-gen-home-popular__slide {
		flex: 0 0 calc((100% - 32px) / 3);
		width: calc((100% - 32px) / 3);
	}
}

@media (min-width: 992px) {
	.ai-gen-home-popular__slide {
		flex: 0 0 calc((100% - 48px) / 4);
		width: calc((100% - 48px) / 4);
		max-width: 300px;
	}
}

/* Social auth buttons */
.ai-gen-social-auth {
	margin-top: 18px;
}

.ai-gen-social-auth__divider {
	display: flex;
	align-items: center;
	gap: 12px;
	color: #64748b;
	font-size: 0.8125rem;
	margin: 0 0 12px;
}

.ai-gen-social-auth__divider::before,
.ai-gen-social-auth__divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: #e2e8f0;
}

.ai-gen-social-auth__buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ai-gen-social-auth__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 11px 14px;
	border-radius: 10px;
	border: 1px solid #e2e8f0;
	background: #fff;
	font-weight: 600;
	cursor: pointer;
	color: #0f172a;
}

.ai-gen-social-auth__btn--google:hover,
.ai-gen-social-auth__btn--facebook:hover {
	border-color: #cbd5e1;
	background: #f8fafc;
}

.ai-gen-social-auth__btn--facebook {
	color: #1877f2;
}

@media (max-width: 921px) {
	body.ai-gen-light-header #masthead .site-primary-header-wrap,
	body.ai-gen-light-header #masthead .site-primary-header-wrap.ast-container,
	body.ai-gen-light-header #masthead .ast-builder-grid-row-container {
		width: calc(100% - 24px) !important;
		padding: 8px 12px !important;
		border-radius: 12px;
	}

	body.ai-gen-light-header #masthead {
		padding: 8px 0 0;
	}

	.ai-gen-home-hub__categories {
		display: flex;
		flex-wrap: nowrap;
		overflow-x: auto;
		gap: 10px;
		padding: 2px 2px 8px;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.ai-gen-home-hub__categories::-webkit-scrollbar {
		display: none;
	}

	.ai-gen-home-hub__cat {
		flex: 0 0 76px;
		scroll-snap-align: start;
		padding: 4px 2px;
	}

	.ai-gen-home-hub__cat-icon {
		width: 42px !important;
		height: 42px !important;
		min-width: 42px !important;
		max-width: 42px !important;
		min-height: 42px !important;
		max-height: 42px !important;
	}

	.ai-gen-home-hub__cat-label {
		font-size: 0.62rem;
		max-width: 76px;
		line-height: 1.2;
	}

	.ai-gen-home-hub__search-form {
		flex-wrap: nowrap;
		min-height: 48px;
	}

	.ai-gen-home-hub__search-input {
		padding: 12px 8px;
		font-size: 0.9rem;
	}

	.ai-gen-home-hub__search-btn {
		width: auto;
		margin: 5px;
		padding: 0 16px;
		font-size: 0.75rem;
	}

	.ai-gen-home-popular__head {
		flex-wrap: wrap;
		gap: 12px;
	}

	.ai-gen-home-popular__actions {
		width: 100%;
		justify-content: space-between;
	}

	body.ai-gen-home .ai-gen-home-hero {
		border-radius: 14px;
		background-position: var(--ai-home-hero-bg-position-mobile) !important;
		margin-top: 8px !important;
	}

	body.ai-gen-home .ai-gen-home-hero > .e-con-inner,
	body.ai-gen-home .ai-gen-home-hero > .elementor-container {
		min-height: clamp(300px, 68vw, 400px) !important;
		padding: 14px 16px !important;
	}

	body.ai-gen-home .ai-gen-home-hero::after {
		background: linear-gradient(
			180deg,
			#ffffff 0%,
			rgba(255, 255, 255, 0.96) 55%,
			rgba(255, 255, 255, 0.78) 100%
		);
	}

	body.ai-gen-home .ai-gen-home-hero .elementor-heading-title {
		max-width: none;
		font-size: clamp(1.2rem, 5.2vw, 1.45rem) !important;
	}

	body.ai-gen-home .ai-gen-home-hero-carousel {
		border-radius: 12px;
		margin-top: 8px !important;
	}
}

@media (max-width: 480px) {
	:root {
		--ai-home-content-gutter: 12px;
	}

	body.ai-gen-home .ai-gen-home-hub,
	body.ai-gen-generation-hub .ai-gen-home-hub--generation {
		padding-left: 12px;
		padding-right: 12px;
	}
}

@media (min-width: 922px) {
	.ai-gen-social-auth__buttons {
		flex-direction: row;
	}

	.ai-gen-social-auth__btn {
		flex: 1;
	}
}

/* /generation/ — hub inside Ready templates (same UI as homepage) */
.ai-gen-ready-templates .ai-gen-home-hub--generation {
	width: 100%;
	padding: 0 0 20px;
	margin: 0 0 4px;
	background: transparent;
	color: var(--ai-home-text, #0f172a);
	box-sizing: border-box;
}

.ai-gen-ready-templates .ai-gen-home-hub--generation .ai-gen-home-hub__inner {
	max-width: none;
	width: 100%;
	padding: 0;
	margin: 0;
}

.ai-gen-ready-templates .ai-gen-home-hub--generation .ai-gen-home-hub__cat {
	border: 0;
	padding: 6px 4px;
	background: transparent;
	font: inherit;
	cursor: pointer;
	text-align: center;
}

.ai-gen-ready-templates .ai-gen-home-hub--generation .ai-gen-home-hub__cat.is-active .ai-gen-home-hub__cat-icon {
	border-color: rgba(37, 99, 235, 0.45);
	background: #eff6ff;
}

body.ai-gen-light-header #primary,
body.ai-gen-light-header .site-main,
body.ai-gen-light-header #content {
	background: var(--ai-home-bg) !important;
}

body.ai-gen-light-header .ai-generation-landing--no-hero {
	padding-top: 20px;
}

/* WooCommerce cart in light header — dark icon (was white on transparent hero) */
body.ai-gen-light-header .ast-header-woo-cart .ast-cart-menu-wrap,
body.ai-gen-light-header .ast-header-woo-cart .ast-site-header-cart,
body.ai-gen-light-header .ast-header-woo-cart a.cart-container,
body.ai-gen-light-header .ast-header-woo-cart .ast-woo-header-cart-info-wrap,
body.ai-gen-light-header .ast-site-header-cart .ast-cart-menu-wrap {
	color: var(--ai-home-text) !important;
}

body.ai-gen-light-header .ast-header-woo-cart .astra-icon,
body.ai-gen-light-header .ast-header-woo-cart svg,
body.ai-gen-light-header .ast-header-woo-cart .ast-icon svg,
body.ai-gen-light-header .ast-site-header-cart .astra-icon,
body.ai-gen-light-header .ast-site-header-cart svg path,
body.ai-gen-light-header .ast-site-header-cart .ast-woocommerce-cart-icon {
	fill: var(--ai-home-text) !important;
	color: var(--ai-home-text) !important;
	stroke: var(--ai-home-text) !important;
}

body.ai-gen-light-header .ast-header-woo-cart .count,
body.ai-gen-light-header .ast-header-woo-cart .ast-count-text,
body.ai-gen-light-header .ast-site-header-cart .count {
	color: #fff !important;
	background-color: var(--ai-home-text) !important;
	border-color: var(--ai-home-text) !important;
}

body.ai-gen-light-header .ast-mobile-menu-trigger-minimal,
body.ai-gen-light-header .ast-mobile-menu-trigger-fill,
body.ai-gen-light-header .ast-button-wrap .menu-toggle,
body.ai-gen-light-header .ast-mobile-svg {
	fill: var(--ai-home-text) !important;
	color: var(--ai-home-text) !important;
}

/* Astra SVG filter turns logo white for transparent hero — disable on light header */
body.ai-gen-light-header #masthead .site-logo-img img,
body.ai-gen-light-header #masthead .transparent-custom-logo img,
body.ai-gen-light-header #masthead .ai-gen-custom-logo-link img,
body.ai-gen-light-header #masthead img.custom-logo,
body.ai-gen-light-header #masthead img.ast-mobile-header-logo {
	filter: none !important;
	-webkit-filter: none !important;
}

body.ai-gen-light-header #masthead .site-logo-img > .custom-logo-link,
body.ai-gen-light-header #masthead .site-logo-img > .ai-gen-custom-logo-link {
	display: inline-flex !important;
	align-items: center;
	flex-shrink: 0;
}

body.ai-gen-light-header #masthead .custom-mobile-logo-link {
	display: none !important;
}

body.ai-gen-generation-hub #primary,
body.ai-gen-generation-hub .site-main,
body.ai-gen-generation-hub #content {
	background: var(--ai-home-bg) !important;
}

body.ai-gen-generation-hub .ai-generation-landing--no-hero {
	padding-top: 20px;
}

.ai-gen-ready-templates .ai-gen-home-hub--generation .ai-gen-home-hub__cat.is-active .ai-gen-home-hub__cat-label {
	color: var(--ai-home-accent, #2563eb);
	font-weight: 700;
}

/* Brand logo — consistent size, transparent PNG on all headers */
#masthead .custom-logo-link,
#masthead .site-logo-img > .custom-logo-link,
#masthead .site-logo-img > .ai-gen-custom-logo-link {
	display: inline-flex !important;
	align-items: center;
	flex-shrink: 0;
	max-width: 220px;
}

#masthead .custom-logo,
#masthead .custom-logo-link img,
#masthead .site-logo-img img.custom-logo,
#masthead .site-logo-img img,
#masthead img.ast-mobile-header-logo {
	max-height: 64px !important;
	max-width: 220px !important;
	width: auto !important;
	height: auto !important;
	object-fit: contain;
	background: transparent !important;
}

/* Hide legacy per-page featured image used as mobile logo */
#masthead img.ast-mobile-header-logo[src*="ComfyUI_temp_ovmka"],
#masthead img.custom-logo[src*="ComfyUI_temp_ovmka"] {
	display: none !important;
}

/* Mobile / tablet: prevent horizontal scroll, unify logo, hide duplicate cart FAB */
body.ai-gen-home,
body.ai-gen-light-header.ai-gen-generation-hub,
body.ai-gen-light-header.ai-gen-creative-hub {
	overflow-x: clip;
}

body.ai-gen-home #content,
body.ai-gen-home #primary,
body.ai-gen-light-header #content,
body.ai-gen-light-header #primary {
	max-width: 100%;
	overflow-x: clip;
}

body.ai-gen-home #content .elementor.elementor-10 {
	width: 100% !important;
	max-width: 100% !important;
	overflow-x: clip;
}

@media (max-width: 921px) {
	body.ai-gen-light-header .ast-site-identity .site-title,
	body.ai-gen-light-header .ast-site-identity .site-description {
		display: none !important;
	}

	body.ai-gen-light-header #ast-mobile-header .ast-builder-grid-row {
		align-items: center;
		gap: 8px;
		min-height: 52px;
	}

	body.ai-gen-light-header #ast-mobile-header .site-header-primary-section-left {
		flex: 1 1 auto;
		min-width: 0;
	}

	body.ai-gen-light-header #ast-mobile-header .site-header-primary-section-right {
		flex: 0 0 auto;
		display: flex;
		align-items: center;
		gap: 2px;
	}

	body.ai-gen-light-header #ast-mobile-header .site-logo-img > .custom-logo-link,
	body.ai-gen-light-header #ast-mobile-header .site-logo-img > .ai-gen-custom-logo-link {
		max-width: min(200px, 52vw);
	}

	body.ai-gen-light-header #ast-mobile-header .menu-toggle.main-header-menu-toggle,
	body.ai-gen-light-header #ast-mobile-header .ast-mobile-menu-trigger-fill {
		background: transparent !important;
		border: 0 !important;
		box-shadow: none !important;
		padding: 10px !important;
		width: 44px;
		height: 44px;
		border-radius: 10px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	body.ai-gen-light-header #ast-mobile-header .menu-toggle.main-header-menu-toggle:hover,
	body.ai-gen-light-header #ast-mobile-header .ast-mobile-menu-trigger-fill:hover,
	body.ai-gen-light-header #ast-mobile-header .menu-toggle.main-header-menu-toggle:focus-visible,
	body.ai-gen-light-header #ast-mobile-header .ast-mobile-menu-trigger-fill:focus-visible {
		background: #f1f5f9 !important;
	}

	body.ai-gen-light-header #ast-mobile-header .ast-header-woo-cart .ast-site-header-cart-li {
		display: flex;
		align-items: center;
	}

	body.ai-gen-light-header #ast-mobile-header .ast-header-woo-cart a.cart-container {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		border-radius: 10px;
	}

	body.ai-gen-light-header #ast-mobile-header .ast-header-woo-cart a.cart-container:hover {
		background: #f1f5f9;
	}

	body.ai-gen-light-header .ai-gen-header-bar--mobile-context {
		border-top: 1px solid #f1f5f9;
	}

	body.ai-gen-light-header .ai-gen-header-bar--mobile-context .ai-gen-header-bar-inner {
		padding: 6px 12px 8px;
	}

	body.ai-gen-light-header #moderncart-floating-cart {
		display: none !important;
	}

	body.ai-gen-home #content .elementor.elementor-10 > .e-con .e-con-inner {
		padding-left: 16px !important;
		padding-right: 16px !important;
	}

	body.ai-gen-home #content .elementor.elementor-10 img {
		max-width: 100%;
		height: auto;
	}

	body.ai-gen-home .elementor-widget-button .elementor-button-wrapper {
		text-align: left;
	}

	body.ai-gen-generation-hub .ai-generation-landing,
	body.ai-gen-creative-hub .ai-generation-landing {
		padding-left: 12px;
		padding-right: 12px;
	}
}

@media (min-width: 768px) and (max-width: 921px) {
	.ai-gen-home-hub__categories {
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		overflow-x: visible;
		flex-wrap: wrap;
	}

	.ai-gen-home-hub__cat {
		flex: initial;
	}
}
