/* =====================================================
   FEATURED CATEGORIES — عیناً فونت‌ایران
===================================================== */

/* ───── متغیرهای مورد نیاز (اگر در base نیست) ───── */
:root {
  --br-3: 12px;
  --br-round: 9999px;
  --fs-2: 0.694rem;
  --fs-3: 0.833rem;
  --fs-6: 1.44rem;
  --c-grey-light-5: #e8e8ec;
  --c-grey-light-4: #d1d1d8;
  --c-grey-light-2: #b1b1b8;
  --c-grey:         #919199;
  --c-grey-dark-2:  #636369;
  --c-text-1:       #1f1a1e;
  --c-red-3:        #b32a65;
  --white:          #ffffff;
}

/* ───── wrapper ───── */
.featured-categories {
  padding-top: 36px;
}

.featured-categories .page-container {
  max-width: 100%;
  overflow: hidden;
}

.featured-categories .page-width {
  margin: 0 auto;
  padding: 0 15px;
  width: 100%;
  max-width: 1220px;
}

/* ═══════════════════════════════════════════════════════
   INDEX-F-CATS — ردیف کارت‌ها
═══════════════════════════════════════════════════════ */
.index-f-cats {
  padding: 20px 0;
}

.index-f-cats .swiper-wrapper {
  display: flex;
}

.index-f-cats .item {
  text-decoration: none;
  color: initial;
  display: flex;
  align-items: center;
  position: relative;
  width: 220px;
  height: 120px;
  padding: 10px;
  overflow: hidden;
  background-color: var(--white);
  border-radius: var(--br-3);
  border: 1px solid var(--c-grey-light-5);
  margin: 0 8px;
  flex-shrink: 0;
  transition: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.index-f-cats .item:first-child { margin-right: 0; }

/* ───── متن ───── */
.index-f-cats .start {
  position: relative;
  z-index: 2;
}

.index-f-cats .title {
  color: var(--c-grey-dark-2);
  margin-bottom: -2px;
  font-size: var(--fs-3);
  font-weight: 300;
  display: flex;
  align-items: center;
}

.index-f-cats .title > span:first-child {
  white-space: nowrap;
}

/* شمارنده */
.index-f-cats .title .counter {
  background-color: var(--c-grey-light-5);
  color: var(--c-grey);
  font-size: var(--fs-2);
  letter-spacing: 0.5px;
  padding: 0 8px;
  min-width: 38px;
  height: 18px;
  margin-right: 3px;
  border-radius: var(--br-round);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: 0.2s ease;
}

.index-f-cats .title .counter div {
  margin-top: 1px;
  display: flex;
  overflow: hidden;
  flex-direction: row-reverse;
  text-shadow: 0 calc(var(--fs-3) * -1) 0 var(--white);
}

.index-f-cats .counter div span {
  display: block;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: transform 0.4s;
  transform: translateY(var(--m, 0)) translateZ(0);
}

.index-f-cats .counter div span:first-child { transition-delay: 60ms; }
.index-f-cats .counter div span:nth-child(2) { transition-delay: 0.12s; }
.index-f-cats .counter div span:nth-child(3) { transition-delay: 0.18s; }

/* نام دسته */
.index-f-cats .cat-name {
  z-index: 2;
  position: relative;
  font-weight: 700;
  font-size: var(--fs-6);
  color: var(--c-text-1);
  line-height: 1.4;
  margin-top: 3px;
}

/* آیکون گوشه */
.index-f-cats .icon {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.index-f-cats .icon img {
  width: 60px;
  opacity: 0.35;
  transition: opacity 0.4s ease;
  object-fit: contain;
}

/* ═══════════════════════════════════════════════════════
   DESKTOP (≥ 992px) — ۵ کارت چسبیده در یک ردیف
═══════════════════════════════════════════════════════ */
@media only screen and (min-width: 992px) {

  .featured-categories {
    padding-top: 36px;
  }

  .index-f-cats {
    padding: 1px 0 30px;
    display: flex;
  }

  .index-f-cats .swiper-wrapper {
    display: flex;
    width: 100% !important;
    transform: none !important;
    flex-wrap: nowrap;
  }

  .index-f-cats .item {
    width: calc(100% / 5);
    margin: 0;
    flex: 1 1 20%;
    border-radius: 0;
    border-color: var(--c-grey-light-4);
    border-right: none;
    height: 110px;
    flex-shrink: 1;
    min-width: 0;
  }

  .index-f-cats .item:first-child {
    border-right: 1px solid var(--c-grey-light-4);
    border-radius: 0 var(--br-3) var(--br-3) 0;
  }

  .index-f-cats .item:last-child {
    border-radius: var(--br-3) 0 0 var(--br-3);
  }

  .index-f-cats .item:hover {
    background-color: #f9f9fb;
    z-index: 10;
  }

  .index-f-cats .title {
    color: var(--c-grey-light-2);
  }

  .index-f-cats .icon {
    display: flex;
  }

  .index-f-cats .item:hover .icon img {
    opacity: 1;
  }

  .index-f-cats .item:hover .counter {
    background-color: var(--c-red-3);
    color: var(--white);
  }

  .index-f-cats .item:hover .title .counter span {
    --m: var(--fs-3);
  }

  /* ۶ کارت یا بیشتر → wrap به دو ردیف */
  .index-f-cats .item:nth-child(n+6) {
    /* دسته‌های اضافه در ردیف دوم (اختیاری) */
  }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — موبایل
═══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .index-f-cats .item {
    width: 200px;
    height: 110px;
    margin: 0 6px;
  }

  .index-f-cats .icon img {
    width: 50px;
  }

  .index-f-cats .cat-name {
    font-size: 1.2rem;
  }
}

@media (max-width: 560px) {
  .index-f-cats .item {
    width: 175px;
    height: 100px;
  }

  .index-f-cats .cat-name {
    font-size: 1.05rem;
  }

  .index-f-cats .title {
    font-size: 0.78rem;
  }

  .index-f-cats .icon {
    width: 60px;
  }

  .index-f-cats .icon img {
    width: 40px;
  }
}

/* ═══════════════════════════════════════════════════════
   DARK MODE
═══════════════════════════════════════════════════════ */
[data-theme="dark"] .index-f-cats .item {
  background-color: #1e1b22;
  border-color: #2a242f;
}

[data-theme="dark"] .index-f-cats .item:hover {
  background-color: #262230;
}

[data-theme="dark"] .index-f-cats .cat-name {
  color: #f8f4f7;
}

[data-theme="dark"] .index-f-cats .title {
  color: #a89ea8;
}

[data-theme="dark"] .index-f-cats .title .counter {
  background-color: #2a242f;
  color: #c9c9cf;
}