/**
 * Brands: homepage carousel, brands page, brand page header (inc/brands.php).
 * Card sizes, fonts and the "Vaata" arrow follow the homepage category carousel.
 */

/* Homepage carousel */

.es-brands-carousel {
	position: relative;
}

.es-brands-track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 30px) / 4);
	gap: 10px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

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

.es-brand-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 320px;
	padding: 24px 30px 20px;
	border-radius: 15px;
	background: #eeeeee;
	scroll-snap-align: start;
	transition: background-color .3s ease-in;
	box-sizing: border-box;
}

.es-brand-card:hover {
	background: #f3f3f3;
}

.es-brand-card-link {
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
}

.es-brand-card-title {
	padding-right: 28px;
	color: #000;
	font-family: "Krona One", sans-serif;
	font-size: 18px;
	line-height: 22.5px;
}

.es-brand-card-logo {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 16px 0;
}

.es-brand-card-logo img {
	width: auto;
	max-width: 85%;
	max-height: 150px;
	object-fit: contain;
}

.es-brand-card-more {
	position: relative;
	align-self: flex-start;
	padding: 10px 28px 10px 0;
	color: #000;
	font-family: Montserrat, sans-serif;
	font-size: 16px;
	line-height: 24px;
}

.es-brand-card-more::after,
.es-brands-all a::after,
.es-brands-nav::before {
	content: "";
	position: absolute;
	top: 50%;
	width: 10px;
	height: 10px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3 1l4 4-4 4' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	transform: translateY(-50%);
}

.es-brand-card-more::after {
	right: 10px;
	transition: right .3s;
}

.es-brand-card:hover .es-brand-card-more::after {
	right: 0;
}

.es-brands-carousel .es-brands-nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 62px;
	height: 62px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transform: translateY(-50%);
}

.es-brands-carousel .es-brands-nav:hover,
.es-brands-carousel .es-brands-nav:focus {
	background: transparent;
}

.es-brands-nav::before {
	left: 50%;
	width: 18px;
	height: 18px;
	transform: translate(-50%, -50%);
}

.es-brands-prev {
	left: -70px;
}

.es-brands-prev::before {
	transform: translate(-50%, -50%) rotate(180deg);
}

.es-brands-next {
	right: -70px;
}

.es-brands-nav[disabled] {
	display: none;
}

/* No room for the arrows next to the cards: white round buttons on the cards, like the categories. */
@media (max-width: 1300px) {
	.es-brands-carousel .es-brands-nav,
	.es-brands-carousel .es-brands-nav:hover,
	.es-brands-carousel .es-brands-nav:focus {
		background: #fff;
	}

	.es-brands-prev {
		left: 10px;
	}

	.es-brands-next {
		right: 10px;
	}
}

@media (max-width: 1024px) {
	.es-brands-track {
		grid-auto-columns: calc((100% - 10px) / 2);
	}
}

@media (max-width: 767px) {
	.es-brands-track {
		grid-auto-columns: 100%;
	}

	.es-brand-card {
		height: 361px;
	}

	.es-brand-card-title {
		font-size: 20px;
		line-height: 30px;
	}
}

/* "Kõik brändid" link next to the homepage heading, same arrow motion as "Vaata" */

.es-brands-all a {
	position: relative;
	display: inline-block;
	padding-right: 28px;
}

.es-brands-all a::after {
	right: 10px;
	transition: right .3s;
}

.es-brands-all a:hover::after {
	right: 0;
}

/* Brand logo without an image: the name */

.es-brand-logo-text {
	color: #b5b5b5;
	font-family: "Krona One", sans-serif;
	font-size: 22px;
	line-height: 1.3;
	text-align: center;
	word-break: break-word;
}

/* Brands page */

.es-brands-pills {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 14px;
	margin: 0 0 80px;
}

.es-brands-pills .es-brands-pill,
.es-brands-pills .es-brands-pill:focus {
	min-width: 180px;
	padding: 12px 28px;
	border: 1px solid #ec2227;
	border-radius: 999px;
	background: #fff;
	color: #ec2227;
	font-family: "Krona One", sans-serif;
	font-size: 15px;
	line-height: 20px;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}

.es-brands-pills .es-brands-pill:hover,
.es-brands-pills .es-brands-pill.is-active {
	background: #ec2227;
	color: #fff;
}

.es-brands-pills .es-brands-pill:focus-visible {
	outline: 2px solid #000;
	outline-offset: 2px;
}

.es-brands-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 80px 30px;
}

.es-brand-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	color: #000;
	text-decoration: none;
	animation: es-brand-in .3s ease-out;
}

.es-brand-item[hidden] {
	display: none;
}

.es-brand-item-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 180px;
}

.es-brand-item-logo img {
	width: auto;
	max-width: 80%;
	max-height: 180px;
	object-fit: contain;
	transition: transform .3s;
}

.es-brand-item:hover .es-brand-item-logo img {
	transform: scale(1.04);
}

.es-brand-item-name {
	margin-top: 30px;
	color: #000;
	font-family: "Krona One", sans-serif;
	font-size: 18px;
	line-height: 1.3;
	text-align: center;
}

.es-brand-item:hover .es-brand-item-name {
	color: #ec2227;
}

.es-brands-none {
	margin: 0;
	font-family: Montserrat, sans-serif;
	text-align: center;
}

@keyframes es-brand-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
}

@media (max-width: 1024px) {
	.es-brands-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 60px 20px;
	}
}

@media (max-width: 767px) {
	/* One scrollable row of buttons instead of several rows. */
	.es-brands-pills {
		flex-wrap: nowrap;
		justify-content: flex-start;
		gap: 8px;
		margin: 0 -20px 40px;
		padding: 0 20px 4px;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.es-brands-pills::-webkit-scrollbar {
		display: none;
	}

	.es-brands-pills .es-brands-pill,
	.es-brands-pills .es-brands-pill:focus {
		flex: none;
		min-width: 0;
		padding: 10px 20px;
		font-size: 13px;
	}

	.es-brands-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 40px 16px;
	}

	.es-brand-item-logo {
		height: 110px;
	}

	.es-brand-item-logo img {
		max-height: 110px;
	}

	.es-brand-item-name {
		margin-top: 16px;
		font-size: 15px;
	}

	.es-brand-logo-text {
		font-size: 17px;
	}
}

/* Brand page header */

.es-brand-header {
	display: grid;
	grid-template-columns: minmax(0, 37fr) minmax(0, 63fr);
	gap: 56px;
	align-items: start;
}

.es-brand-header-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	border: 1px solid #eeeeee;
}

.es-brand-header-logo img {
	width: auto;
	max-width: 65%;
	max-height: 65%;
	object-fit: contain;
}

.es-brand-header-logo .es-brand-logo-text {
	font-size: 30px;
}

.es-brand-title {
	margin: 0 0 18px;
	color: #000;
	font-family: "Krona One", sans-serif;
	font-size: 40px;
	font-weight: 400;
	line-height: 1.25;
}

.es-brand-cats {
	margin: 0 0 32px;
	color: #8f8f8f;
	font-family: "Krona One", sans-serif;
	font-size: 16px;
	line-height: 1.4;
}

.es-brand-description {
	color: #000;
	font-family: Montserrat, sans-serif;
	font-size: 16px;
	line-height: 1.75;
}

.es-brand-description p {
	margin: 0 0 1em;
}

.es-brand-description h3 {
	margin: 1.6em 0 .4em;
	color: #000;
	font-family: Montserrat, sans-serif;
	font-size: 1em;
	font-weight: 700;
	line-height: 1.5;
}

.es-brand-description ul {
	margin: 0 0 1em;
	padding-left: 1.2em;
}

.es-brand-description li {
	margin: 0 0 .35em;
}

.es-brand-description > h3:first-child,
.es-brand-lead + h3 {
	margin-top: 0;
}

.es-brand-placeholder {
	color: #8f8f8f;
}

.es-brand-files {
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
}

.es-brand-files li {
	margin: 0 0 14px;
}

.es-brand-files a {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	color: #000;
	font-family: Montserrat, sans-serif;
	font-size: 16px;
	line-height: 1.4;
	text-decoration: none;
}

.es-brand-files a:hover {
	color: #ec2227;
}

.es-brand-file-icon {
	flex: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #000 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M7 9.5l4 4 4-4M7 15.5h8' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.es-brand-files a:hover .es-brand-file-icon {
	background-color: #ec2227;
}

@media (max-width: 1024px) {
	.es-brand-header {
		gap: 32px;
	}

	.es-brand-title {
		font-size: 32px;
	}
}

@media (max-width: 767px) {
	.es-brand-header {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.es-brand-header-logo {
		aspect-ratio: auto;
		height: 220px;
	}

	.es-brand-title {
		margin-bottom: 10px;
		font-size: 26px;
	}

	.es-brand-cats {
		margin-bottom: 20px;
		font-size: 14px;
	}

	.es-brand-description,
	.es-brand-files a {
		font-size: 15px;
	}
}
