/**
 * Trusted brands — brand red band, text left, logo tiles right.
 */

.kelmendi-brands {
	--kb-bg: var(--kelmendi-accent, #e20813);
	--kb-text: #ffffff;
	--kb-text-muted: rgba(255, 255, 255, 0.88);
	--kb-tile-bg: #ffffff;
	--kb-tile-radius: 14px;
	--kb-max: 1280px;
	--kb-pad-x: clamp(1.25rem, 4vw, 2.5rem);
	--kb-pad-y: clamp(3.5rem, 7vw, 5.5rem);
	--kb-tile-size: clamp(4.5rem, 9vw, 6.25rem);
	--kb-tile-gap: clamp(0.65rem, 1.5vw, 1rem);

	width: 100%;
	background: var(--kb-bg);
	color: var(--kb-text);
	box-sizing: border-box;
}

/* Full-bleed inside Elementor shortcode widget */
.elementor-widget-shortcode .kelmendi-brands {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.kelmendi-brands__inner {
	max-width: var(--kb-max);
	margin: 0 auto;
	padding: var(--kb-pad-y) var(--kb-pad-x);
	box-sizing: border-box;
}

.kelmendi-brands__layout {
	display: grid;
	grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
	gap: clamp(2rem, 5vw, 4rem);
	align-items: center;
}

.kelmendi-brands__heading {
	margin: 0 0 clamp(1rem, 2vw, 1.5rem);
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(2rem, 4.2vw, 3.35rem);
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -0.02em;
	color: var(--kb-text);
}

.kelmendi-brands__body {
	margin: 0;
	max-width: 26em;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: clamp(0.95rem, 1.25vw, 1.1rem);
	line-height: 1.65;
	color: var(--kb-text-muted);
}

.kelmendi-brands__body p {
	margin: 0;
}

.kelmendi-brands__logos {
	min-width: 0;
}

.kelmendi-brands__row {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--kb-tile-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.kelmendi-brands__row--top {
	margin-bottom: var(--kb-tile-gap);
}

.kelmendi-brands__row--bottom {
	max-width: calc(5 * var(--kb-tile-size) + 4 * var(--kb-tile-gap));
	margin-left: auto;
	margin-right: auto;
}

.kelmendi-brands__item {
	flex: 0 0 var(--kb-tile-size);
	width: var(--kb-tile-size);
	height: var(--kb-tile-size);
	margin: 0;
	padding: clamp(0.5rem, 1.2vw, 0.85rem);
	box-sizing: border-box;
	background: var(--kb-tile-bg);
	border-radius: var(--kb-tile-radius);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.kelmendi-brands__logo-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	text-decoration: none;
}

.kelmendi-brands__logo-img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

@media (max-width: 991px) {
	.kelmendi-brands__layout {
		grid-template-columns: 1fr;
		gap: clamp(2rem, 4vw, 2.75rem);
	}

	.kelmendi-brands__row--bottom {
		max-width: none;
	}
}

/* Mobile: one even grid (fixes broken two-row layout + bad % heights) */
@media (max-width: 767px) {
	.kelmendi-brands__logos {
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: var(--kb-tile-gap);
		width: 100%;
	}

	.kelmendi-brands__row {
		display: contents;
		margin: 0;
	}

	.kelmendi-brands__row--top {
		margin-bottom: 0;
	}

	.kelmendi-brands__item {
		flex: none;
		width: 100%;
		height: auto;
		aspect-ratio: 1;
		max-width: none;
		max-height: none;
	}
}

@media (max-width: 480px) {
	.kelmendi-brands__logos {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Elementor: full-bleed red band on small screens */
@media (max-width: 767px) {
	.elementor-widget-shortcode:has(.kelmendi-brands),
	.elementor-widget-shortcode:has(.kelmendi-brands) .elementor-widget-container,
	.elementor-element:has(.kelmendi-brands),
	.elementor-element:has(.kelmendi-brands) > .e-con,
	.elementor-element:has(.kelmendi-brands) > .e-con-inner,
	.elementor-section:has(.kelmendi-brands) > .elementor-container,
	.elementor-section:has(.kelmendi-brands) > .e-con-inner {
		max-width: 100% !important;
		width: 100% !important;
		padding-left: 0 !important;
		padding-right: 0 !important;
		overflow: visible !important;
	}
}
