/**
 * Anied Category Carousel — Styles
 * =============================================================================
 * ساختار عیناً از anied-bestsellers.css گرفته شده (باکس ۳ ردیفی، کارت
 * محصول، تایمر، دکمه‌ی سبد/پاپ‌آپ). تنها فرق‌ها:
 *   ۱) پس‌زمینه‌ی باکس بالایی، به‌جای گرادیانت رنگی، شیشه‌ای با ته‌رنگ آبی
 *      یخی شده (فقط دسکتاپ/تبلت — موبایل باکس دیگه‌ای داره)
 *   ۲) توضیح زیر آیکن هم‌رنگ عنوان است (نه رنگ خنثی/muted)
 * =============================================================================
 */

/* ===== باکس دسته‌بندی — شیشه‌ای با ته‌رنگ آبی یخی ===== */
.anied-catcar-box {
  position: relative;
  width: 160px;
  display: flex;
  flex-direction: column;
  color: var(--anied-text, #1a1a1a);
  text-align: center;
  border-radius: 18px;

  /* افکت شیشه‌ای + ته‌رنگ آبی یخی: به‌جای مخلوط‌کردن با سطح خنثی سایت،
     مستقیم با یه آبی روشن (#00A2FF) مخلوط می‌کنیم تا هم بلور داشته باشه
     هم رنگ گرم/سرد آبی مشخصی زیرش دیده بشه. بلور محدود (نه شدید) که فشار
     GPU زیاد نشه، حتی با کاروسل متحرک پشتش. */
  background: linear-gradient(
  160deg,
  color-mix(in srgb, #00A2FF 4%, var(--anied-surface-1, #fff) 30%) 0%,
  color-mix(in srgb, #00A2FF 2%, var(--anied-surface-1, #fff) 24%) 100%
);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid color-mix(in srgb, #00A2FF 30%, transparent);
  box-shadow: 0 4px 24px rgba(0, 102, 204, 0.12);
}
.anied-catcar-box .ccb-title { flex: 0 0 18%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; font-family: var(--anied-font); padding: 0 10px; color: var(--anied-text, #1a1a1a); }
.anied-catcar-box .ccb-divider { height: 1px; margin: 0 20px; background: color-mix(in srgb, #00A2FF 25%, transparent); flex-shrink: 0; }
.anied-catcar-box .ccb-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 16px; gap: 4px; }
.anied-catcar-box .ccb-body .ico { width: 34px; height: 34px; margin-bottom: 10px; color: var(--anied-brand, #00A2FF); }
.anied-catcar-box .ccb-body .ico svg { width: 100%; height: 100%; }
/* توضیح زیر آیکن — هم‌رنگ عنوان (طبق درخواست، نه رنگ muted) */
.anied-catcar-box .ccb-body p { font-size: 16px; font-weight: 700; font-family: var(--anied-font); margin: 0; line-height: 1.6; color: var(--anied-text, #1a1a1a); }
.anied-catcar-box .ccb-view-all { flex: 0 0 22%; display: flex; align-items: center; justify-content: center; }
.anied-catcar-box .view-all { display: inline-flex; align-items: center; gap: 6px; color: var(--anied-brand, #00A2FF); text-decoration: none; font-size: 12px; font-weight: 700; font-family: var(--anied-font); }
.anied-catcar-box .view-all svg { width: 10px; height: 10px; }

.anied-catcar-box-slot { position: absolute; top: 0; bottom: 0; right: 0; width: 160px; z-index: 5; }
.anied-catcar-box-slot .anied-catcar-box { width: 100%; height: 100%; }

/* ===== section wrap + mobile bar ===== */
.anied-catcar-section { max-width: 1110px; margin: 0 auto; padding: 20px 5px 20px; direction: rtl; }

.anied-catcar-mbar { display: none; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 16px; margin-bottom: 16px; background: var(--anied-brand, #00A2FF); color: #fff; }
.anied-catcar-mbar-title { display: flex; align-items: center; gap: 8px; }
.anied-catcar-mbar-title .ico { width: 18px; height: 18px; flex-shrink: 0; }
.anied-catcar-mbar-title .ico svg { width: 100%; height: 100%; }
.anied-catcar-mbar-title span { font-family: var(--anied-font); font-size: 15px; font-weight: 700; }
.anied-catcar-mbar-viewall { font-size: 11.5px; font-weight: 700; color: #fff; opacity: 0.9; text-decoration: none; display: flex; align-items: center; gap: 4px; }
.anied-catcar-mbar-viewall svg { width: 10px; height: 10px; }

.anied-catcar-row { position: relative; }

/* ===== carousel viewport — تکنیک نرمال‌سازی LTR (همون anied-deals/bestsellers):
   viewport و track صریحاً LTR هستن، پس هیچ ابهامی توی جهت اسکرول نیست.
   row-reverse یعنی آیتم اول از سمت راست شروع می‌شه (طبیعی برای خواننده‌ی
   فارسی) ولی خودِ اسکرول با منطق استاندارد LTR مرورگر کار می‌کنه — بدون
   محاسبه‌ی transform دستی، بدون باگ marquee. ===== */
.anied-catcar-viewport {
  width: 100%; box-sizing: border-box; padding-right: 160px;
  overflow-x: auto; overflow-y: hidden;
  -ms-overflow-style: none; scrollbar-width: none;
  cursor: grab; direction: ltr;
}
.anied-catcar-viewport::-webkit-scrollbar { display: none; }
.anied-catcar-viewport.dragging { cursor: grabbing; scroll-behavior: auto; }
.anied-catcar-track { display: flex; flex-direction: row-reverse; gap: 12px; width: max-content; user-select: none; }

/* ===== product card — همون کامپوننت as-card که توی کل سایت استفاده می‌شه ===== */
.anied-catcar-section .as-card { background: var(--anied-surface-1); border: 1px solid var(--anied-border); border-radius: 12px; overflow: hidden; position: relative; text-decoration: none; display: block; flex: 0 0 auto; width: 170px; direction: rtl; font-family: var(--anied-font); -webkit-tap-highlight-color: transparent; }
@media (hover: hover) and (pointer: fine) {
  .anied-catcar-section .as-card:hover { border-color: var(--anied-brand); }
}
.anied-catcar-section .as-card-img-wrap { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--anied-surface-2); }
.anied-catcar-section .as-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.anied-catcar-section .as-countdown {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 2;
  background: color-mix(in srgb, var(--anied-surface-0) 55%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-radius: 8px; padding: 5px 3px 5px 7px;
  display: flex; align-items: center; gap: 4px;
  direction: ltr; font-size: 10.5px; font-weight: 700; color: var(--anied-text); white-space: nowrap;
}
.anied-catcar-section .as-countdown .cd-sep { color: var(--anied-text-muted); font-weight: 400; margin: 0 1px; }
.anied-catcar-section .as-countdown .cd-flame { width: 20px; height: 28px; margin: -14px 0 0 0; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.anied-catcar-section .as-countdown .cd-flame svg, .anied-catcar-section .as-countdown .cd-flame canvas { width: 100% !important; height: 100% !important; display: block; }

.anied-catcar-section .as-glass-right { position: absolute; bottom: 5px; right: 8px; z-index: 2; background: color-mix(in srgb, var(--anied-surface-0) 55%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: 8px; padding: 5px 9px; display: flex; align-items: center; gap: 6px; }
.anied-catcar-section .as-rating-num { font-size: 11px; font-weight: 700; color: var(--anied-text); }
.anied-catcar-section svg.as-rating-star { width: 12px !important; height: 12px !important; }
.anied-catcar-section .as-card-body { padding: 9px; }
.anied-catcar-section .as-card-name { font-size: 12px; font-weight: 600; color: var(--anied-text); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anied-catcar-section .as-bottom-row { display: flex; align-items: center; justify-content: space-between; }
.anied-catcar-section .as-price-block { display: flex; flex-direction: column; gap: 4px; }
.anied-catcar-section .as-price-final { font-size: 13px; font-weight: 800; color: var(--anied-text); }
.anied-catcar-section .as-price-prefix { font-size: 10px; font-weight: 600; color: var(--anied-text-muted); }
.anied-catcar-section .as-toman { font-size: 11px; font-weight: 400; color: var(--anied-text-muted); margin-inline-start: 3px; }
.anied-catcar-section .as-price-sub { display: flex; align-items: center; gap: 6px; }
.anied-catcar-section .as-price-old { font-size: 10px; color: var(--anied-text-muted); text-decoration: line-through; }
.anied-catcar-section .as-toman-old { font-size: 9px; font-weight: 400; margin-inline-start: 2px; }
.anied-catcar-section .as-price-pct { background: var(--anied-brand); color: #fff; font-size: 9px; padding: 1px 6px; border-radius: 20px; font-weight: 700; }

.anied-catcar-section .as-cart-zone { position: relative; height: 36px; }
.anied-catcar-section .as-cart-btn {
  all: unset;
  box-sizing: border-box !important;
  -webkit-tap-highlight-color: transparent;
  width: 36px !important; height: 36px !important;
  min-width: 36px !important; min-height: 36px !important;
  max-width: 36px !important; max-height: 36px !important;
  background: var(--anied-brand-dim) !important;
  background-image: none !important;
  box-shadow: none !important;
  border: 1px solid var(--anied-brand-border) !important;
  border-radius: 50% !important;
  color: var(--anied-brand) !important;
  display: flex !important; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; padding: 0 !important; margin: 0 !important;
}
.anied-catcar-section .as-cart-btn::before, .anied-catcar-section .as-cart-btn::after { content: none !important; display: none !important; }
.anied-catcar-section .as-cart-btn.hidden { display: none !important; }
.anied-catcar-section .as-cart-btn svg { width: 15px !important; height: 15px !important; display: block; }
.anied-catcar-section .as-stepper { display: none; align-items: center; height: 36px; border: 1px solid var(--anied-brand-border); border-radius: 36px; background: var(--anied-brand-dim); overflow: hidden; }
.anied-catcar-section .as-stepper.show { display: flex; }
.anied-catcar-section .as-step-btn {
  all: unset;
  box-sizing: border-box !important;
  -webkit-tap-highlight-color: transparent;
  width: 28px !important; height: 36px !important;
  background: none !important; background-image: none !important; box-shadow: none !important;
  border: none !important;
  color: var(--anied-brand) !important;
  font-size: 15px; cursor: pointer;
  display: flex !important; align-items: center; justify-content: center;
  flex-shrink: 0; padding: 0 !important; margin: 0 !important;
}
.anied-catcar-section .as-step-btn::before, .anied-catcar-section .as-step-btn::after { content: none !important; display: none !important; }
.anied-catcar-section .as-step-val { width: 20px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--anied-text); }

/* ===== bundle/variant popup shell — reused from the real plugin ===== */
.as-overlay { position: fixed; inset: 0; z-index: 99997; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .25s; }
.as-overlay.open { opacity: 1; pointer-events: all; }
.as-overlay-box { position: relative; background: var(--anied-surface-1); border: 1px solid var(--anied-border); border-radius: 16px; width: 100%; max-width: 400px; max-height: 85vh; overflow-y: auto; overflow-x: hidden; padding: 24px; direction: rtl; transform: translateY(20px); transition: transform .25s; font-family: var(--anied-font); }
.as-overlay-box * { max-width: 100%; box-sizing: border-box; }
.as-overlay.open .as-overlay-box { transform: translateY(0); }
.as-overlay-close { position: absolute; top: 14px; left: 14px; width: 28px; height: 28px; border-radius: 8px; background: rgba(242,242,242,.06); border: 1px solid var(--anied-border); color: var(--anied-text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; z-index: 2; }
.as-loading { text-align: center; padding: 30px; color: var(--anied-text-muted); }

@media (max-width: 1000px) and (min-width: 861px) {
  .anied-catcar-box-slot { width: 140px; }
  .anied-catcar-viewport { padding-right: 140px; }
}

@media (max-width: 860px) {
  .anied-catcar-section { padding: 32px 16px 48px; }
  .anied-catcar-mbar { display: flex; }
  .anied-catcar-row .anied-catcar-box-slot { display: none; }
  .anied-catcar-viewport { padding-right: 0; }
}
