/* پنل واحد دسته‌بندی و پنجرهٔ واحد جستجو */
body.sp-locked { overflow: hidden; }

/* دکمهٔ پشتیبانی و نوار پیشرفت نباید روی پنل‌ها بیفتند */
body.sp-locked #contact, body.fp-locked #contact, body.sp-locked .progress-wrap, body.fp-locked .progress-wrap { display: none !important; }

/* نوار اسکرول قرمز قالب برای داخل پنل‌ها مناسب نیست */
.sp-panel *::-webkit-scrollbar, .fp-panel *::-webkit-scrollbar { width: 4px; height: 0; }
.sp-panel *::-webkit-scrollbar-track, .fp-panel *::-webkit-scrollbar-track { background: transparent; }
.sp-panel *::-webkit-scrollbar-thumb, .fp-panel *::-webkit-scrollbar-thumb { border-radius: 4px; background: #d5d7dc; }

.sp-backdrop { display: none; position: fixed; inset: 0; z-index: 1040; background: rgba(0, 0, 0, .45); }
.sp-backdrop.sp-open { display: block; }
.sp-backdrop.sp-hover { pointer-events: none; }
.sp-panel { display: none; position: fixed; z-index: 1050; background: #fff; }
.sp-panel.sp-open { display: flex; flex-direction: column; }
.sp-panel [hidden] { display: none !important; }
.sp-close { flex: none; border: 0; background: transparent; padding: 6px; color: #3a3a3a; font-size: 18px; line-height: 1; }

/* دسته‌بندی */
.sp-category { top: var(--sp-top, 0); right: 50%; width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - var(--sp-top, 0px) - 24px); overflow: hidden; border-radius: 0 0 14px 14px; transform: translateX(50%); }
.sp-category-head { display: none; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #e8e9ed; }
.sp-logo img { display: block; max-height: 34px; width: auto; }
.sp-category-body { display: flex; flex: 1; min-height: 0; }
.sp-rail { flex: none; width: 210px; padding: 8px 0; overflow-y: auto; background: #f5f6f8; }
.sp-rail-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 16px; border: 0; background: transparent; color: #515151; font-size: 14px; text-align: right; }
.sp-rail-item i { flex: none; font-size: 18px; }
.sp-rail-item.active { background: #fff; color: var(--main-color-one); font-weight: 500; }
.sp-category-content { flex: 1; min-width: 0; min-height: 360px; padding: 18px 22px; overflow-y: auto; }
.sp-pane { display: none; }
.sp-pane.active { display: block; }
.sp-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sp-pane-head h3 { margin: 0; color: #3a3a3a; font-size: 16px; font-weight: 500; }
.sp-pane-head a { flex: none; color: var(--main-color-one); font-size: 13px; }
.sp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 18px 10px; }
.sp-tile { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #3a3a3a; font-size: 13px; line-height: 1.6; text-align: center; }
.sp-tile:hover { color: var(--main-color-one); }
.sp-tile-image { display: flex; align-items: center; justify-content: center; width: 80px; height: 80px; margin-bottom: 6px; overflow: hidden; border-radius: 50%; background: #f5f6f8; color: #a9adb6; font-size: 24px; }
.sp-tile-image img { width: 100%; height: 100%; object-fit: cover; }
.sp-tile small { color: #8b8f98; font-size: 12px; }
.sp-links { display: none; }

/* جستجو */
.sp-search { top: 24px; right: 50%; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: hidden; border-radius: 14px; transform: translateX(50%); }
.sp-search-bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #e8e9ed; }
.sp-search-field { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 12px; border-radius: 10px; background: #f3f4f6; }
.sp-search-field > i { color: #6c6c6c; font-size: 17px; }
#sp-search-input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; color: #3a3a3a; font-size: 16px; outline: 0; }
#sp-search-input::-webkit-search-cancel-button { display: none; }
.sp-search-clear { border: 0; background: transparent; padding: 2px; color: #3a3a3a; font-size: 18px; line-height: 1; }
.sp-search-body { flex: 1; min-height: 0; padding: 16px; overflow-y: auto; }
.sp-search-body h6 { margin: 0 0 12px; color: #3a3a3a; font-size: 14px; font-weight: 500; }
.sp-search-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.sp-search-chips a { padding: 6px 14px; border: 1px solid #dfe1e6; border-radius: 18px; color: #515151; font-size: 13px; }
.sp-search-chips a:hover { border-color: var(--main-color-one); color: var(--main-color-one); }
.sp-search-banner { display: block; }
.sp-search-banner img { display: block; width: auto; max-width: 100%; height: auto; max-height: 320px; margin: 0 auto; border-radius: 12px; }
.sp-search-all { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; color: #6c6c6c; font-size: 13px; }
.sp-search-term { color: var(--main-color-one); font-weight: 500; }
.sp-search-all-link { flex: none; color: #3a3a3a; font-weight: 500; }
.sp-search-categories { padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid #e8e9ed; }
.sp-search-category-list { display: flex; gap: 12px; overflow-x: auto; }
.sp-search-category-list .sp-tile { flex: none; width: 88px; }
.sp-search-category-list .sp-tile-image { width: 64px; height: 64px; }
.sp-search-product { display: flex; align-items: center; gap: 12px; padding: 8px; margin-bottom: 8px; border-radius: 10px; background: #f5f6f8; color: #3a3a3a; }
.sp-search-product img { flex: none; width: 64px; height: 64px; border-radius: 8px; background: #fff; object-fit: contain; }
.sp-search-product-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13px; line-height: 1.7; }
.sp-search-product-text b { color: #515151; font-weight: 500; }
.sp-search-empty { padding: 36px 8px; color: #6c6c6c; font-size: 14px; text-align: center; }

/* زیردسته‌های بالای صفحهٔ دسته */
.sp-chips { display: flex; gap: 10px; margin-bottom: 16px; padding: 4px 2px 8px; overflow-x: auto; scrollbar-width: none; }
.sp-chips::-webkit-scrollbar { display: none; }
.sp-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 16px 6px 8px; border-radius: 26px; background: #fff; color: #3a3a3a; font-size: 13px; }
.sp-chip img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

/* صفحهٔ نتایج جستجو */
.sp-result-title { margin: 0 0 14px; color: #3a3a3a; font-size: 18px; font-weight: 500; }

@media (max-width: 991.98px) {
	.sp-category, .sp-search { inset: 0; width: 100%; max-height: none; border-radius: 0; transform: none; }
	.sp-category-head { display: flex; flex: none; }
	.sp-rail { width: 96px; padding: 0; }
	.sp-rail-item { flex-direction: column; gap: 6px; padding: 14px 6px; border-bottom: 1px solid #e8e9ed; font-size: 12px; line-height: 1.5; text-align: center; }
	.sp-rail-item i { font-size: 22px; }
	.sp-category-content { min-height: 0; padding: 14px; }
	.sp-tiles { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 16px 8px; }
	.sp-tile-image { width: 68px; height: 68px; }
	.sp-links { display: block; margin-top: 20px; padding-top: 12px; border-top: 1px solid #e8e9ed; }
	.sp-links a { display: block; padding: 9px 2px; color: #515151; font-size: 14px; }
}
