/* Yara Parts Filters — styles */

.ypf-grid-wrap {
	margin: 32px 0;
}

.ypf-grid-title {
	margin: 0 0 18px;
	font-size: 20px;
	font-weight: 700;
	text-align: center;
}

.ypf-grid {
	display: grid;
	gap: 14px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ypf-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ypf-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ypf-cols-4 { grid-template-columns: repeat(4, 1fr); }
.ypf-cols-5 { grid-template-columns: repeat(5, 1fr); }
.ypf-cols-6 { grid-template-columns: repeat(6, 1fr); }
.ypf-cols-7 { grid-template-columns: repeat(7, 1fr); }
.ypf-cols-8 { grid-template-columns: repeat(8, 1fr); }

.ypf-grid-item {
	margin: 0;
	list-style: none;
}

.ypf-grid-item > a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 14px 10px;
	border: 1px solid rgba(0, 0, 0, 0.09);
	border-radius: 12px;
	background: #fff;
	text-decoration: none;
	color: inherit;
	height: 100%;
	transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.ypf-grid-item > a:hover {
	border-color: rgba(0, 0, 0, 0.2);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.ypf-grid-img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 8px;
}

.ypf-grid-img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.ypf-grid-name {
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	line-height: 1.5;
}

.ypf-grid-count {
	font-size: 12px;
	opacity: .6;
}

/* ---- Filter bar ---- */

.ypf-filter-bar {
	margin: 0 0 20px;
	padding: 12px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.ypf-filter-title {
	display: block;
	margin-bottom: 10px;
	font-size: 14px;
	font-weight: 700;
	opacity: .75;
}

.ypf-filter-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ypf-filter-item {
	margin: 0;
	list-style: none;
}

.ypf-filter-item > a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 999px;
	font-size: 13px;
	line-height: 1.6;
	text-decoration: none;
	color: inherit;
	background: #fff;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.ypf-filter-item > a:hover {
	border-color: currentColor;
}

.ypf-filter-item.is-active > a {
	background: #111;
	border-color: #111;
	color: #fff;
}

.ypf-filter-img {
	width: 24px;
	height: 24px;
	object-fit: contain;
	border-radius: 4px;
}

.ypf-filter-count {
	font-style: normal;
	font-size: 11px;
	opacity: .55;
	padding-inline-start: 2px;
}

.ypf-filter-item.is-active .ypf-filter-count {
	opacity: .8;
}

/* چند نوار پشت سر هم */
.ypf-filter-bars {
	margin-bottom: 18px;
}

.ypf-filter-bars .ypf-filter-bar:last-child {
	border-bottom: 0;
	margin-bottom: 0;
}

/* ---- Responsive ---- */

@media (max-width: 991px) {
	.ypf-cols-5,
	.ypf-cols-6,
	.ypf-cols-7,
	.ypf-cols-8 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 767px) {
	.ypf-cols-4,
	.ypf-cols-5,
	.ypf-cols-6,
	.ypf-cols-7,
	.ypf-cols-8 { grid-template-columns: repeat(3, 1fr); }

	.ypf-grid-name { font-size: 13px; }
}

@media (max-width: 480px) {
	.ypf-grid { gap: 10px; }
	.ypf-cols-3,
	.ypf-cols-4,
	.ypf-cols-5,
	.ypf-cols-6,
	.ypf-cols-7,
	.ypf-cols-8 { grid-template-columns: repeat(2, 1fr); }

	.ypf-filter-list {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 6px;
		-webkit-overflow-scrolling: touch;
	}

	.ypf-filter-item > a { white-space: nowrap; }
}
