/**
 * Brands carousel (horizontal track + prev/next).
 *
 * @package Matta_Utility
 */

.matta-brands-carousel {
	position: relative;
	box-sizing: border-box;
	--brand-slide-gap: 1.25rem;
}

.matta-brands-carousel .brands-track {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--brand-slide-gap);
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 0.5rem 0;
}

.matta-brands-carousel .brands-track::-webkit-scrollbar {
	display: none;
}

.matta-brands-carousel .brand-item {
	flex: 0 0 calc((100% - (2.5 * var(--brand-slide-gap))) / 3.5);
	scroll-snap-align: start;
	display: block;
	text-decoration: none;
	color: inherit;
	min-width: 0;
	background: #fff;
}

@media (max-width: 1024px) {
	.matta-brands-carousel .brand-item {
		flex-basis: calc((100% - var(--brand-slide-gap)) / 2);
	}
}

.matta-brands-carousel .brand-bg,
.matta-brands-carousel .brand-logo {
	border-radius: 8px;
	overflow: hidden;
}

.matta-brands-carousel .brand-bg {
	min-height: 100px;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}

.matta-brands-carousel .brand-bg img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	max-width: 100px;
	max-height: 60px;
}

.matta-brands-carousel .brand-logo {
	margin-bottom: 0.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem;
	min-height: 64px;
}

.matta-brands-carousel .brand-logo img {
	max-width: 100%;
	height: auto;
	display: block;
	object-fit: contain;
}

.matta-brands-carousel .brands-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 47px;
	height: 47px;
	border: 0;
	border-radius: 0;
	background: transparent url("../images/brands-arrow.svg") center/contain no-repeat;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.matta-brands-carousel .brands-arrow:hover {
	opacity: 0.9;
}

.matta-brands-carousel .brands-arrow:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.matta-brands-carousel .brands-arrow.prev {
	left: 4px;
	background-color: transparent;
	transform: translateY(-50%) rotate(180deg);
}

.matta-brands-carousel .brands-arrow.next {
	right: 4px;
	background-color: transparent;
}

@media (max-width: 600px) {
	.matta-brands-carousel .brands-arrow {
		display: none;
	}
}
