/* عنصر جستجو - استایل پایه (بدون وابستگی به main.min.css) */
/*
 * متغیرهای CSS این ویجت (توسط کنترل‌های ریسپانسیو المنتور مقداردهی می‌شوند):
 * --asw-btn-w          عرض دکمه‌ی آیکون
 * --asw-btn-left/right موقعیت دکمه (چپ/راست)
 * --asw-pad-left/right پدینگ اینپوت (برای اینکه متن زیر آیکون نرود)
 * --asw-input-display  نمایش/عدم نمایش اینپوت (حالت «فقط آیکون»)
 * --asw-btn-position   absolute در حالت عادی / static در حالت «فقط آیکون»
 */
.asw-wrapper {
  --asw-btn-w: 64px;
  --asw-btn-left: auto;
  --asw-btn-right: 0;
  --asw-pad-left: 24px;
  --asw-pad-right: calc(var(--asw-btn-w) + 12px);
  position: relative;
  max-width: var(--asw-wrap-maxw, 405px);
  width: var(--asw-wrap-width, 100%);
  margin: var(--asw-wrap-margin, 0 auto 0 14px);
}
.asw-wrapper[dir="rtl"] {
  --asw-btn-left: 0;
  --asw-btn-right: auto;
  --asw-pad-left: calc(var(--asw-btn-w) + 12px);
  --asw-pad-right: 24px;
}
.asw-input-group {
  position: relative;
  display: flex;
  width: var(--asw-group-width, 100%);
}
.asw-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  direction: inherit;
  font-family: inherit;
  border-radius: 15px;
  background-color: #f8f9fb;
  border: 1px solid #f8f9fb;
  padding: 16px 24px 14px;
  font-size: 12px;
  color: #2d365d;
}
/* اینپوت اصلی (نه اینپوت داخل پاپ‌آپ) */
.asw-wrapper .asw-input {
  display: var(--asw-input-display, block);
  padding-left: var(--asw-pad-left);
  padding-right: var(--asw-pad-right);
}
.asw-input:focus {
  border-color: #212341;
}
.asw-btn {
  position: var(--asw-btn-position, absolute);
  top: 0;
  left: var(--asw-btn-left);
  right: var(--asw-btn-right);
  width: var(--asw-btn-w);
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  border-radius: 15px;
  background-color: #212341;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

/* پاپ‌آپ جستجوی زنده */
.asw-seeebox {
  position: fixed; inset: 0; z-index: 99999; display: none;
  align-items: center; justify-content: center; padding: 20px; box-sizing: border-box;
}
.asw-seeebox.active { display: flex; }
.asw-seeebox-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.asw-seeebox-panel {
  position: relative; max-width: 720px; width: 92%; margin: 0;
  background: #fff; border-radius: 20px; box-shadow: 0 10px 50px rgba(0,0,0,.15);
  padding: 20px; direction: inherit; font-family: inherit; max-height: 82vh; overflow-y: auto;
}

/* ردیف بالای پاپ‌آپ: اینپوت جستجو + دکمه‌ی بستن */
.asw-seeebox-topbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.asw-box-input-group { position: relative; flex: 1 1 auto; min-width: 0; }
.asw-box-input { margin: 0; padding: 12px 16px; }
.asw-seeebox-close {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: #f1f1f1; border: none; border-radius: 20px; padding: 10px 16px;
  font-size: 13px; cursor: pointer;
}
.asw-empty { text-align: center; padding: 30px 0; color: #888; font-size: 14px; }

/* لودینگ (معادل Notiflix Block.dots اصلی) */
.asw-loading-overlay {
  position: absolute; inset: 0; z-index: 5; display: flex;
  align-items: center; justify-content: center; background: rgba(255,255,255,.7);
  border-radius: 20px;
}
.asw-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid #e3e3e3; border-top-color: #212341;
  animation: asw-spin .8s linear infinite;
}
@keyframes asw-spin { to { transform: rotate(360deg); } }

/* اسلایدر تصویری محصولات — پیاده‌سازی native، بدون وابستگی به کتابخانه‌ی خارجی */
.asw-slider-wrap { position: relative; margin-bottom: 16px; padding: 0 36px; }
.asw-swiper {
  overflow-x: auto; overflow-y: hidden; direction: inherit;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -ms-overflow-style: none; scrollbar-width: none;
}
.asw-swiper::-webkit-scrollbar { display: none; }
.asw-swiper-track { display: flex; align-items: flex-start; gap: 10px; }
.asw-slide { flex: 0 0 auto; width: 190px; height: 96px; scroll-snap-align: start; }
.asw-slide-card {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; height: 100%;
  border: 1px solid #eee; border-radius: 14px; padding: 10px;
  text-decoration: none; color: inherit; box-sizing: border-box;
}
.asw-slide-card:hover { border-color: transparent; box-shadow: inset 0 0 10px 4px rgba(82,99,116,.13); }
.asw-slide-card img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.asw-slide-card .asw-slide-text {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto;
  overflow: hidden; height: 100%; padding-top: 2px; box-sizing: border-box;
}
.asw-slide-card .asw-name {
  font-size: 13px; line-height: 1.4; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.asw-slide-card .asw-cat {
  font-size: 10px; color: #999; line-height: 1.3; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* فلش‌های اسلایدر: کنار خود اسلایدر و وسط‌چین عمودی (نه بالای پنل) */
.asw-swiper-next, .asw-swiper-prev {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; padding: 0;
  background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15); display: flex;
  align-items: center; justify-content: center; cursor: pointer; z-index: 2;
  border: none; color: #212341;
}
.asw-swiper-next { inset-inline-end: 0; }
.asw-swiper-prev { inset-inline-start: 0; }
.asw-swiper-next[disabled], .asw-swiper-prev[disabled] { opacity: .35; cursor: default; pointer-events: none; }

.asw-results { display: flex; gap: 20px; flex-wrap: wrap; }
.asw-col { flex: 1 1 260px; min-width: 0; }
.asw-col-title { font-size: 13px; color: #888; margin-bottom: 10px; }
.asw-result-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: 12px;
  text-decoration: none; color: inherit; min-width: 0;
}
.asw-result-item:hover { background: #f8f9fb; }
.asw-result-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.asw-result-item .asw-name {
  font-size: 13px; display: block; white-space: normal; overflow: visible;
  word-break: break-word; line-height: 1.4;
}
.asw-result-item .asw-cat {
  font-size: 10px; color: #999; display: block; white-space: normal; overflow: visible;
  word-break: break-word; line-height: 1.3;
}
.asw-result-item .asw-price { font-size: 11px; color: #212341; }
.asw-cat-item {
  display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none;
  color: inherit; font-size: 13px; white-space: normal; overflow: visible;
  word-break: break-word; box-sizing: border-box; line-height: 1.4;
}
.asw-cat-item:hover { background: #f8f9fb; }
.asw-view-all { display: block; margin-top: 10px; font-size: 12px; color: #212341; text-decoration: underline; }
.asw-sale-badge {
  display: inline-block; margin-inline-start: 4px; padding: 2px 6px; border-radius: 8px;
  font-size: 10px; background: #ffe4e4; color: #d63333;
}

/* ===== نسخه ۳.۲: قیمت، ناموجود، هایلایت، پیام‌ها، پیشنهادها ===== */
.asw-slide-card .asw-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.asw-meta-inline { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-inline-start: 6px; vertical-align: middle; }
.asw-price { font-size: 11px; color: #212341; line-height: 1.3; }
.asw-price del { opacity: .55; margin-inline-end: 4px; }
.asw-price ins { text-decoration: none; }
.asw-price .screen-reader-text {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.asw-oos {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  font-size: 10px; line-height: 1.5; background: #eee; color: #777;
}
.asw-is-oos img { opacity: .55; }
.asw-mark { background: #fff3b0; color: inherit; padding: 0 1px; border-radius: 3px; }

.asw-notice { font-size: 12px; color: #666; margin: 0 0 12px; }
.asw-notice a { color: inherit; font-weight: 600; text-decoration: underline; }

.asw-suggest { margin-bottom: 8px; }
.asw-suggest .asw-col-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asw-clear {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 12px; color: inherit; text-decoration: underline; opacity: .8;
}
.asw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.asw-chip {
  border: none; cursor: pointer; padding: 7px 14px; border-radius: 20px;
  font-size: 12px; font-family: inherit; background: #f1f1f1; color: #2d365d;
}
.asw-chip:hover { filter: brightness(.96); }

/* آیتم انتخاب‌شده با کلیدهای جهت‌دار */
.asw-active { background-color: #eef0f6; outline: 2px solid rgba(33, 35, 65, .35); outline-offset: -2px; }
.asw-slide-card.asw-active { border-color: transparent; }

.asw-cat-item .asw-price { font-size: 11px; }
