/* =========================================================
   Amazo Digikala Widgets — v1.0.0
   استایل‌ها فقط داخل .amz-cats و .amz-brands اعمال می‌شوند
   ========================================================= */

.amz-cats,
.amz-brands {
	direction: rtl;
	font-family: "Vazirmatn", "Vazir", "IRANSans", "IRANYekan", "Yekan Bakh", Tahoma, sans-serif;
	box-sizing: border-box;
}

.amz-cats *,
.amz-brands * {
	box-sizing: border-box;
}

/* ---------------------------------------------------------
   ۱) دسته‌بندی‌ها
   --------------------------------------------------------- */

.amz-cats__title {
	margin: 0 0 24px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.6;
	color: #23254e;
}

.amz-cats__grid {
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	column-gap: 12px;
	row-gap: 24px;
	align-items: start;
}

.amz-cat {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	text-decoration: none;
	color: inherit;
	min-width: 0;
}

.amz-cat__circle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	padding: 12%;
	border-radius: 50%;
	background-color: #f0f0f1;
	overflow: hidden;
	transition: background-color .25s ease, transform .25s ease, box-shadow .25s ease;
}

/* پشتیبانی از مرورگرهای قدیمی که aspect-ratio ندارند */
@supports not (aspect-ratio: 1 / 1) {
	.amz-cat__circle::before {
		content: "";
		display: block;
		padding-top: 100%;
	}
	.amz-cat__circle img {
		position: absolute;
		inset: 12%;
	}
}

.amz-cat__circle img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform .3s ease;
	user-select: none;
}

.amz-cat__label {
	margin-top: 10px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.8;
	color: #3f4064;
	transition: color .2s ease;
	overflow-wrap: anywhere;
}

.amz-hover-zoom .amz-cat:hover .amz-cat__circle img {
	transform: scale(1.08);
}

.amz-hover-lift .amz-cat:hover .amz-cat__circle {
	transform: translateY(-6px);
	box-shadow: 0 10px 22px rgba(0, 0, 0, .10);
}

.amz-cat:focus-visible {
	outline: 2px solid #7c3aed;
	outline-offset: 4px;
	border-radius: 8px;
}

/* ---------------------------------------------------------
   ۲) محبوب‌ترین برندها
   --------------------------------------------------------- */

.amz-brands__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
}

.amz-brands__heading {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.amz-brands__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.amz-brands__icon svg {
	width: 24px;
	height: 24px;
	fill: #23254e;
}

.amz-brands__icon i {
	font-size: 24px;
	color: #23254e;
}

.amz-brands__title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.6;
	color: #23254e;
}

.amz-brands__viewall {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex: none;
	font-size: 14px;
	font-weight: 500;
	color: #19bfd3;
	text-decoration: none;
	transition: opacity .2s ease;
}

.amz-brands__viewall:hover {
	opacity: .75;
}

.amz-brands__viewport {
	position: relative;
}

.amz-brands__track {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 4px;
}

.amz-brands__track::-webkit-scrollbar {
	display: none;
}

/* نمایش نوار اسکرول در صورت فعال بودن */
.amz-scrollbar-yes .amz-brands__track {
	scrollbar-width: thin;
	scrollbar-color: #d8d8dc transparent;
	padding-bottom: 10px;
}

.amz-scrollbar-yes .amz-brands__track::-webkit-scrollbar {
	display: block;
	height: 6px;
}

.amz-scrollbar-yes .amz-brands__track::-webkit-scrollbar-thumb {
	background: #d8d8dc;
	border-radius: 99px;
}

.amz-brands__track.is-dragging {
	scroll-behavior: auto;
	cursor: grabbing;
	scroll-snap-type: none;
}

.amz-brands__track.is-dragging a {
	pointer-events: none;
}

.amz-brand {
	display: flex;
	flex-direction: column;
	flex: 0 0 180px;
	width: 180px;
	scroll-snap-align: start;
	border: 1px solid #e0e0e2;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	text-decoration: none;
	color: inherit;
	transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}

.amz-brand:hover {
	border-color: #cfcfd4;
}

.amz-brand__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 140px;
	padding: 16px;
	background-color: #f0f0f1;
}

.amz-brand__logo img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	transition: transform .3s ease;
	user-select: none;
	-webkit-user-drag: none;
}

.amz-brand:hover .amz-brand__logo img {
	transform: scale(1.06);
}

.amz-brand__name {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px 8px;
	background: #fff;
	font-size: 14px;
	font-weight: 500;
	color: #3f4064;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.amz-brand:focus-visible {
	outline: 2px solid #7c3aed;
	outline-offset: 2px;
}

/* دکمه‌های جهت */
.amz-nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	transform: translateY(-50%);
	border: 0;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
	cursor: pointer;
	transition: opacity .2s ease, visibility .2s ease;
}

.amz-nav svg {
	width: 55%;
	height: 55%;
}

.amz-nav--prev {
	right: -8px;
}

.amz-nav--next {
	left: -8px;
}

.amz-nav.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.amz-arrows-yes .amz-nav {
	display: flex;
}

@media (max-width: 767px) {
	.amz-arrows-mobile-off-yes .amz-nav {
		display: none;
	}
}

/* احترام به تنظیم کاهش انیمیشن */
@media (prefers-reduced-motion: reduce) {
	.amz-cats *,
	.amz-brands * {
		transition: none !important;
	}
	.amz-brands__track {
		scroll-behavior: auto;
	}
}

/* حالت ویرایشگر المنتور */
.elementor-editor-active .amz-brands__track {
	cursor: default;
}
