/* ARK Shop Builder — Frontend Styles
   تمام مقادیر رنگ/فونت با متغیرهای CSS تعریف شده‌اند تا هم از طریق پنل استایل
   المنتور و هم از طریق CSS اضافه قالب به‌راحتی قابل تغییر باشند. */

.asb-filter, .asb-product-grid { direction: rtl; text-align: right; font-family: inherit; box-sizing: border-box; }
.asb-filter *, .asb-product-grid * { box-sizing: border-box; }

/* -------- کادر فیلتر -------- */
.asb-filter {
	--asb-primary: #0e3b2e;
	--asb-gold: #c9a24b;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 14px;
	padding: 20px;
	width: 100%;
	max-width: 320px;
}
.asb-filter__topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.asb-filter__title { margin: 0; font-size: 17px; font-weight: 700; }
.asb-filter__clear { background: none; border: none; cursor: pointer; font-size: 12px; color: #7a7a7a; padding: 0; }
.asb-filter__clear:hover { color: var(--asb-primary); }
.asb-filter__topbar-actions { display: flex; align-items: center; gap: 8px; }

.asb-block { border-bottom: 1px solid #ececec; padding: 12px 0; }
.asb-block:last-of-type { border-bottom: none; }
.asb-block__heading { display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px 0; user-select: none; }
.asb-block__toggle { width: 18px; height: 18px; transition: transform .25s ease; flex-shrink: 0; }
.asb-block__toggle svg { width: 100%; height: 100%; }
.asb-block.is-open .asb-block__toggle { transform: rotate(180deg); }
.asb-block__content { display: none; padding-top: 10px; }
.asb-block.is-open .asb-block__content { display: block; }

.asb-option { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; margin-bottom: 10px; color: #4c4c4c; }
.asb-option input[type="checkbox"], .asb-option input[type="radio"] { width: 16px; height: 16px; accent-color: var(--asb-primary); flex-shrink: 0; }
.asb-option__count { font-size: 11px; color: #b0b0b0; margin-inline-start: auto; font-style: normal; }
.asb-empty-note { font-size: 12px; color: #b0b0b0; }

.asb-option--rating .asb-stars { display: inline-flex; gap: 2px; }
.asb-option--rating svg { width: 14px; height: 14px; color: #d9d9d9; }
.asb-option--rating svg.is-full { color: var(--asb-gold); }

/* -------- بازه قیمت -------- */
.asb-price-range { padding: 6px 6px 0; }
.asb-price-track { position: relative; height: 4px; background: #e4e4e4; border-radius: 4px; margin: 22px 4px 18px; }
.asb-price-track__active { position: absolute; top: 0; bottom: 0; background: var(--asb-gold); border-radius: 4px; }
.asb-price-handle { position: absolute; top: 50%; width: 16px; height: 16px; background: var(--asb-gold); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.1); border-radius: 50%; transform: translate(50%, -50%); cursor: grab; touch-action: none; }
.asb-price-inputs { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.asb-price-inputs span { color: #9a9a9a; }
.asb-price-input { flex: 1; min-width: 0; background: #f5f5f5; border: none; border-radius: 8px; padding: 8px 10px; font-size: 12px; text-align: center; color: #122019; }

/* -------- نمونه رنگ -------- */
.asb-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.asb-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: 0 0 0 1px #e2e2e2 inset; }
.asb-swatch.is-active { border-color: var(--asb-primary); }

/* -------- دکمه اعمال فیلتر -------- */
.asb-apply-btn { display: block; width: 100%; margin-top: 16px; background: var(--asb-primary); color: #fff; border: none; border-radius: 10px; padding: 13px 20px; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .2s ease; }
.asb-apply-btn:hover { background: var(--asb-gold); }

/* -------- دکمه شناور موبایل: به‌طور پیش‌فرض همیشه مخفی است -------- */
.asb-mobile-trigger { display: none; align-items: center; gap: 8px; background: #0e3b2e; color: #fff; border: none; border-radius: 10px; padding: 12px 18px; font-size: 13px; font-weight: 700; cursor: pointer; width: fit-content; margin-bottom: 14px; }
.asb-mobile-trigger svg { width: 18px; height: 18px; }

/* حالت «نمایش عادی» (پیش‌فرض): فیلتر در موبایل هم مثل دسکتاپ به‌صورت عادی و همیشه‌باز نمایش داده می‌شود */
.asb-mode-inline .asb-filter { max-width: 100%; }

@media (max-width: 600px) {
	.asb-mode-inline .asb-filter { max-width: 100%; width: 100%; }
}

/* حالت «پنل کشویی»: فقط زمانی فعال می‌شود که صراحتاً از تنظیمات ویجت انتخاب شده باشد */
.asb-filter-backdrop { display: none; }
.asb-filter__handle { display: none; }
.asb-filter__mobile-close { display: none; background: none; border: none; padding: 4px; cursor: pointer; color: #7a7a7a; }
.asb-filter__mobile-close svg { width: 18px; height: 18px; display: block; }

@media (max-width: 767px) {
	.asb-mode-drawer .asb-mobile-trigger { display: inline-flex; }

	.asb-mode-drawer .asb-filter-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, .45);
		z-index: 999997;
		opacity: 0;
		visibility: hidden;
		transition: opacity .25s ease, visibility .25s ease;
	}
	.asb-mode-drawer .asb-filter-backdrop.is-visible { opacity: 1; visibility: visible; }

	.asb-mode-drawer .asb-filter {
		position: fixed; inset: auto 0 0 0; max-width: 100%; height: 85vh;
		border-radius: 20px 20px 0 0; transform: translateY(110%);
		transition: transform .3s ease; z-index: 999998; overflow-y: auto;
		box-shadow: 0 -10px 40px rgba(0,0,0,.2);
	}
	.asb-mode-drawer .asb-filter.is-mobile-open { transform: translateY(0); }
	.asb-mode-drawer .asb-filter.is-dragging { transition: none; }

	.asb-mode-drawer .asb-filter__handle {
		display: block; width: 42px; height: 5px; background: #ddd; border-radius: 4px;
		margin: 10px auto 6px; cursor: grab; touch-action: none;
	}
	.asb-mode-drawer .asb-filter__mobile-close { display: inline-flex; align-items: center; justify-content: center; }
}

body.asb-no-scroll { overflow: hidden; }

/* -------- گرید محصولات -------- */
.asb-product-grid__items {
	display: grid;
	grid-template-columns: repeat(var(--asb-cols, 4), 1fr);
	gap: 24px;
}
@media (max-width: 1024px) { .asb-product-grid__items { grid-template-columns: repeat(min(var(--asb-cols, 3), 3), 1fr); } }
@media (max-width: 600px) { .asb-product-grid__items { grid-template-columns: repeat(min(var(--asb-cols, 2), 2), 1fr); } }

.asb-product-card { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid #ececec; transition: box-shadow .25s ease, transform .25s ease; position: relative; display: flex; flex-direction: column; }
.asb-product-card:hover { box-shadow: 0 14px 30px rgba(0,0,0,.08); }
.asb-product-card__media { position: relative; aspect-ratio: 1/1; overflow: hidden; background: #f6f6f6; }
.asb-product-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.asb-product-card:hover .asb-product-card__media img { transform: scale(1.05); }

.asb-badge { position: absolute; top: 10px; right: 10px; z-index: 2; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; color: #fff; }
.asb-badge--sale { background: #c0392b; }
.asb-badge--new { background: #c9a24b; }

.asb-wishlist-btn { position: absolute; top: 10px; left: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.9); border: none; display: flex; align-items: center; justify-content: center; color: #122019; cursor: pointer; }
.asb-wishlist-btn svg { width: 17px; height: 17px; }
.asb-wishlist-btn.is-active { color: #c0392b; }
.asb-wishlist-btn.is-active svg { fill: currentColor; }

.asb-product-card__body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.asb-product-card__cat { font-size: 11px; color: #9a9a9a; }
.asb-product-card__title { font-size: 14px; font-weight: 700; margin: 0; line-height: 1.5; }
.asb-product-card__title a { color: #122019; text-decoration: none; }
.asb-product-card__rating { --r: 0%; position: relative; width: 80px; height: 12px; }
.asb-product-card__footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 8px; }
.asb-product-card__price { font-size: 14px; font-weight: 700; color: #0e3b2e; }
.asb-product-card__price del { color: #b0b0b0; font-weight: 400; font-size: 12px; margin-inline-end: 6px; }

.asb-add-cart { width: 38px; height: 38px; border-radius: 10px; background: #0e3b2e; color: #fff; display: flex; align-items: center; justify-content: center; text-decoration: none; transition: background .2s ease; flex-shrink: 0; }
.asb-add-cart:hover { background: #c9a24b; color: #fff; }
.asb-add-cart svg { width: 17px; height: 17px; }

.asb-no-products { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: #9a9a9a; }

.asb-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 30px; }
.asb-pagination button { width: 36px; height: 36px; border-radius: 8px; border: 1px solid #ececec; background: #fff; cursor: pointer; font-size: 13px; }
.asb-pagination button.is-active { background: #0e3b2e; color: #fff; border-color: #0e3b2e; }

.asb-product-grid.is-loading .asb-product-grid__items { opacity: .4; pointer-events: none; transition: opacity .2s ease; }
