/**
 * AELAB Content Tabs — structured tabs with gallery, text, products.
 */
.aelab-ctabs {
	--aelab-ctab-bg: #f1f5f9;
	--aelab-ctab-active-bg: #1e293b;
	--aelab-ctab-active-text: #fff;
	--aelab-ctab-text: #334155;
	--aelab-ctab-hover-bg: #e2e8f0;
	--aelab-ctab-radius: 6px;
	box-sizing: border-box;
	width: 100%;
}

/* ── Tab bar ── */
.aelab-ctabs__bar {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0;
	margin: 0 0 0;
}

.aelab-ctabs__tab {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 10px 20px;
	border: none;
	border-radius: var(--aelab-ctab-radius) var(--aelab-ctab-radius) 0 0;
	background: var(--aelab-ctab-bg);
	color: var(--aelab-ctab-text);
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s ease, color 0.2s ease;
}

.aelab-ctabs__tab:not(.is-active):hover {
	background: var(--aelab-ctab-hover-bg);
}

.aelab-ctabs__tab.is-active {
	background: var(--aelab-ctab-active-bg);
	color: var(--aelab-ctab-active-text);
}

.aelab-ctabs__arrow {
	font-weight: 700;
	font-size: 1.1em;
}

/* ── Panels ── */
.aelab-ctabs__panel {
	display: none;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 0 var(--aelab-ctab-radius) var(--aelab-ctab-radius) var(--aelab-ctab-radius);
	padding: 20px;
}

.aelab-ctabs__panel.is-active {
	display: block;
}

/* ── Top: gallery + text side by side ── */
.aelab-ctabs__top {
	margin-bottom: 0;
}

.aelab-ctabs__top.has-both {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 20px;
	align-items: start;
}

.aelab-ctabs__gallery {
	display: grid;
	gap: 6px;
}

.aelab-ctabs__gallery--multi {
	grid-template-columns: repeat(2, 1fr);
}

.aelab-ctabs__gallery--single {
	grid-template-columns: 1fr;
}

.aelab-ctabs__top:not(.has-both) .aelab-ctabs__gallery {
	flex: none;
	max-width: 100%;
}

.aelab-ctabs__gallery-img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
	object-fit: cover;
}

/* Gallery column: width (and height) = text block height — size set via JS (--aelab-ctabs-gallery-size). */
.aelab-ctabs__top.has-both .aelab-ctabs__gallery {
	width: var(--aelab-ctabs-gallery-size, min(280px, 100%));
	height: var(--aelab-ctabs-gallery-size, auto);
	max-width: 100%;
	flex-shrink: 0;
	box-sizing: border-box;
}

.aelab-ctabs__top.has-both .aelab-ctabs__gallery--multi .aelab-ctabs__gallery-img {
	height: 100%;
	min-height: 0;
}

.aelab-ctabs__top.has-both .aelab-ctabs__gallery--single .aelab-ctabs__gallery-img {
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
}

.aelab-ctabs__gallery--single .aelab-ctabs__gallery-img {
	min-width: 280px;
}

.aelab-ctabs__top.has-both .aelab-ctabs__gallery--single .aelab-ctabs__gallery-img {
	min-width: 0;
}

.aelab-ctabs__text {
	width: 100%;
	min-width: 0;
}

.aelab-ctabs__top.has-both .aelab-ctabs__text,
.aelab-ctabs__top.has-both .aelab-ctabs__gallery {
	width: 100%;
	max-width: none;
}

.aelab-ctabs__heading {
	margin: 0 0 10px;
	font-size: 1.25rem;
	font-weight: 600 !important;
	color: #1e293b;
}

.aelab-ctabs__content {
	font-size: 0.92rem;
	line-height: 1.65;
	color: #334155;
}

.aelab-ctabs__content ol,
.aelab-ctabs__content ul {
	padding-inline-start: 20px;
	margin: 0;
}

.aelab-ctabs__content li {
	margin-bottom: 3px;
}

/* ── Products section ── */
.aelab-ctabs__products {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #e9ecef;
}

.aelab-ctabs__products-label {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
	font-size: 0.95rem;
	color: #1e293b;
}

.aelab-ctabs__products-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.aelab-ctabs__product-tag {
	display: inline-block;
	padding: 5px 14px;
	border: 1.5px solid #dc2626;
	border-radius: 4px;
	font-size: 0.82rem;
	font-weight: 500;
	color: #dc2626;
	text-decoration: none;
	background: #fff;
	transition: background 0.15s, color 0.15s;
}

.aelab-ctabs__product-tag:hover {
	background: #dc2626;
	color: #fff;
}

.aelab-ctabs__products-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-top: 14px;
	overflow: hidden;
}

.aelab-ctabs__product-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
	border-radius: 6px;
	padding: 12px 10px 14px;
	transition: transform 0.15s, box-shadow 0.15s;
	border: 1px solid #e9ecef;
}

.aelab-ctabs__brand-ribbon {
	position: absolute;
	top: 12px;
	right: -44px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 150px;
	height: 26px;
	padding: 0 16px;
	background: #000000;
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 2.4px;
	transform: rotate(45deg);
	transform-origin: center;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
	pointer-events: none;
}

.aelab-ctabs__product-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
	border-color: #cbd5e1;
}

.aelab-ctabs__product-img {
	width: 100%;
	max-width: 160px;
	height: auto;
	display: block;
	margin: 0 auto 10px;
	object-fit: contain;
}

.aelab-ctabs__product-name {
	font-size: 0.8rem;
	font-weight: 600;
	text-align: center;
	color: #1e293b;
	line-height: 1.35;
}

/* ── Responsive ── */
@media (max-width: 991px) {
	.aelab-ctabs__top.has-both {
		grid-template-columns: 1fr;
	}

	.aelab-ctabs__top.has-both .aelab-ctabs__gallery {
		width: 100% !important;
		height: auto !important;
		max-width: 100%;
	}

	.aelab-ctabs__top.has-both .aelab-ctabs__gallery--single .aelab-ctabs__gallery-img {
		height: auto;
	}

	.aelab-ctabs__gallery {
		max-width: 100%;
		width: 100%;
	}

	.aelab-ctabs__products-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 767px) {
	.aelab-ctabs__bar {
		gap: 4px;
		overflow-x: auto;
		flex-wrap: nowrap;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.aelab-ctabs__bar::-webkit-scrollbar {
		display: none;
	}

	.aelab-ctabs__tab {
		padding: 8px 14px;
		font-size: 0.85rem;
		flex-shrink: 0;
	}

	.aelab-ctabs__panel {
		padding: 14px;
	}

	.aelab-ctabs__top.has-both {
		grid-template-columns: 1fr;
	}

	.aelab-ctabs__top.has-both .aelab-ctabs__gallery {
		width: 100% !important;
		height: auto !important;
	}

	.aelab-ctabs__gallery {
		flex: none;
		max-width: 100%;
	}

	.aelab-ctabs__gallery--single .aelab-ctabs__gallery-img {
		min-width: 0;
	}

	.aelab-ctabs__products-tags {
		gap: 4px;
		overflow-x: auto;
		flex-wrap: nowrap;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 4px;
	}

	.aelab-ctabs__product-tag {
		font-size: 0.78rem;
		padding: 4px 10px;
		flex-shrink: 0;
	}

	.aelab-ctabs__products-grid {
		display: flex;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		gap: 12px;
		padding-bottom: 8px;
		scroll-snap-type: x mandatory;
	}

	.aelab-ctabs__products-grid::-webkit-scrollbar {
		height: 4px;
	}

	.aelab-ctabs__products-grid::-webkit-scrollbar-thumb {
		background: #cbd5e1;
		border-radius: 4px;
	}

	.aelab-ctabs__product-card {
		flex: 0 0 60%;
		max-width: 60%;
		scroll-snap-align: start;
	}
}

/* Linked to AELAB Solutions Sidebar */
.aelab-ctabs-hub .aelab-ctabs-linked-set {
	display: none;
}

.aelab-ctabs-hub .aelab-ctabs-linked-set.is-active {
	display: block;
}

.aelab-ctabs-hub--editor .aelab-ctabs-linked-set {
	display: block;
	margin-bottom: 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px dashed #cbd5e1;
}

.aelab-ctabs-hub--editor .aelab-ctabs-linked-set:last-child {
	border-bottom: none;
	margin-bottom: 0;
}

.aelab-ctabs__editor-set-label {
	margin: 0 0 12px;
	font-size: 13px;
	color: #64748b;
}

.aelab-ctabs__editor-set-label code {
	margin-left: 6px;
	font-size: 12px;
}

.aelab-ctabs-hub__empty {
	padding: 24px;
	text-align: center;
	color: #64748b;
	font-size: 0.95rem;
	background: #f8fafc;
	border-radius: 8px;
	border: 1px dashed #cbd5e1;
}

.aelab-ctabs-hub__empty[hidden] {
	display: none !important;
}
