/**
 * MayPhat Brands & Partners Widget Styles (mp-brands.css)
 * Pixel-perfect implementation matching MayPhat design reference.
 *
 * @package MayPhat
 */

.mp-brands-wrapper {
	--mp-brand-card-bg: #ffffff;
	--mp-brand-card-border: #e6e6e6;
	--mp-brand-card-radius: 8px;
	--mp-brand-card-height: 56px;
	--mp-brand-title-color: #222222;

	width: 100%;
	margin-bottom: 25px;
	box-sizing: border-box;
	padding: 0 18px;
}

/* Header Section */
.mp-brands-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.mp-brands-title {
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--mp-brand-title-color);
	margin: 0;
	padding: 0;
	letter-spacing: 0.5px;
	line-height: 1.3;
}

/* Slider Row & Item Container */
.mp-brands-slider-container {
	position: relative;
	width: 100%;
}

.mp-brands-slider {
	margin-left: -5px;
	margin-right: -5px;
}

.mp-brands-slider .flickity-viewport {
	overflow: hidden;
	padding: 4px 0 6px 0;
}

.mp-brand-item-col,
.col.mp-brand-item-col {
	padding-left: 5px;
	padding-right: 5px;
	padding-bottom: 5px;
	box-sizing: border-box;
}

/* Multi-column grid rules for Flickity slider items */
.mp-brands-slider.large-columns-12>.col {
	flex: 0 0 8.333333%;
	max-width: 8.333333%;
	width: 8.333333%;
}

.mp-brands-slider.large-columns-10>.col {
	flex: 0 0 10%;
	max-width: 10%;
	width: 10%;
}

.mp-brands-slider.large-columns-8>.col {
	flex: 0 0 12.5%;
	max-width: 12.5%;
	width: 12.5%;
}

.mp-brands-slider.large-columns-7>.col {
	flex: 0 0 14.285714%;
	max-width: 14.285714%;
	width: 14.285714%;
}

.mp-brands-slider.large-columns-6>.col {
	flex: 0 0 16.666667%;
	max-width: 16.666667%;
	width: 16.666667%;
}

.mp-brands-slider.large-columns-5>.col {
	flex: 0 0 20%;
	max-width: 20%;
	width: 20%;
}

.mp-brands-slider.large-columns-4>.col {
	flex: 0 0 25%;
	max-width: 25%;
	width: 25%;
}

.mp-brands-slider.large-columns-3>.col {
	flex: 0 0 33.333333%;
	max-width: 33.333333%;
	width: 33.333333%;
}

.mp-brands-slider.large-columns-2>.col {
	flex: 0 0 50%;
	max-width: 50%;
	width: 50%;
}

@media (max-width: 849px) {
	.mp-brands-slider.medium-columns-6>.col {
		flex: 0 0 16.666667%;
		max-width: 16.666667%;
		width: 16.666667%;
	}

	.mp-brands-slider.medium-columns-5>.col {
		flex: 0 0 20%;
		max-width: 20%;
		width: 20%;
	}

	.mp-brands-slider.medium-columns-4>.col {
		flex: 0 0 25%;
		max-width: 25%;
		width: 25%;
	}

	.mp-brands-slider.medium-columns-3>.col {
		flex: 0 0 33.333333%;
		max-width: 33.333333%;
		width: 33.333333%;
	}

	.mp-brands-slider.medium-columns-2>.col {
		flex: 0 0 50%;
		max-width: 50%;
		width: 50%;
	}
}

@media (max-width: 549px) {
	.mp-brands-slider.small-columns-4>.col {
		flex: 0 0 25%;
		max-width: 25%;
		width: 25%;
	}

	.mp-brands-slider.small-columns-3>.col {
		flex: 0 0 33.333333%;
		max-width: 33.333333%;
		width: 33.333333%;
	}

	.mp-brands-slider.small-columns-2>.col {
		flex: 0 0 50%;
		max-width: 50%;
		width: 50%;
	}

	.mp-brands-slider.small-columns-1>.col {
		flex: 0 0 100%;
		max-width: 100%;
		width: 100%;
	}
}

/* Brand Card Styling */
.mp-brand-card {
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--mp-brand-card-bg);
	border: 1px solid var(--mp-brand-card-border);
	border-radius: var(--mp-brand-card-radius);
	height: var(--mp-brand-card-height);
	padding: 6px 12px;
	box-sizing: border-box;
	text-decoration: none;
	color: inherit;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
	position: relative;
	overflow: hidden;
	width: 100%;
}

.mp-brand-card:hover {
	border-color: #d0d0d0;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.mp-brand-card__img {
	max-height: calc(var(--mp-brand-card-height) - 18px);
	max-width: 88%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	margin: 0 auto;
	transition: filter 0.25s ease, opacity 0.25s ease;
}

/* Grayscale Mode option */
.mp-brands-wrapper--grayscale .mp-brand-card__img {
	filter: grayscale(100%);
	opacity: 0.85;
}

.mp-brands-wrapper--grayscale .mp-brand-card:hover .mp-brand-card__img {
	filter: grayscale(0%);
	opacity: 1;
}

/* Fallback SVG / text logo styling */
.mp-brand-card__text {
	font-size: 13px;
	font-weight: 800;
	color: #333333;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	letter-spacing: -0.2px;
	font-family: inherit;
}

.mp-brand-card__text--honda {
	color: #e60012;
	font-style: italic;
}

.mp-brand-card__text--kama {
	color: #d32f2f;
	letter-spacing: 0.5px;
}

.mp-brand-card__text--perkins {
	color: #003366;
}

.mp-brand-card__text--cummins {
	color: #000000;
}

.mp-brand-card__text--doosan {
	color: #002c6c;
	font-style: italic;
}

.mp-brand-card__text--yanmar {
	color: #d90007;
}

.mp-brand-card__text--schneider {
	color: #009639;
}

.mp-brand-card__text--lioa {
	color: #cc0000;
}

.mp-brand-card__text--jasic {
	color: #111111;
}

.mp-brand-card__text--bbc {
	color: #c62828;
}

/* Flatsome Flickity Nav Buttons Override for Brands Widget */
.mp-brands-slider-container .flickity-prev-next-button {
	width: 28px !important;
	height: 28px;
	color: red;
	/* background: #ffffff;
	border: 1px solid #e2e8f0; */
	/* box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); */
	border-radius: 50%;
	transition: all 0.2s ease;
	opacity: 0.95;
	top: 50%;
	transform: translate(-20%, -50%) !important;
}

.mp-brands-slider-container:hover .flickity-prev-next-button:hover {
	background: #ffffff;
	border-color: #cbd5e1;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
	opacity: 1;
	top: 50%;
	transform: translate(-20%, -50%) !important;
}

.mp-brands-slider-container .slider:hover .flickity-prev-next-button {
	top: 50%;
	transform: translate(-20%, -50%) !important;
}

.mp-brands-slider-container .flickity-prev-next-button.previous {
	left: -12px;
}

.mp-brands-slider-container .flickity-prev-next-button.next {
	right: -12px;
}

.mp-brands-slider-container .flickity-prev-next-button .flickity-button-icon {
	width: 24px;
	height: 24px;
	fill: #475569;
}

/* Responsive navigation adjustments */
@media (max-width: 549px) {
	.mp-brands-slider-container .flickity-prev-next-button.previous {
		left: -6px;
	}

	.mp-brands-slider-container .flickity-prev-next-button.next {
		right: -6px;
	}
}