/* =====================================================
   HERO CAROUSEL — بنر + ۲ کارت مربعی
===================================================== */

:root {
  --c-grey-light-8: #f9f9fc;
  --c-grey-light-7: #f3f3f7;
  --c-grey-light-6: #ebebef;
  --c-grey-light-5: #e8e8ec;
  --c-grey-light-4: #d1d1d8;
  --c-grey:         #919199;
  --c-grey-dark-2:  #636369;
  --c-grey-dark-4:  #3b3b40;
  --c-grey-dark-5:  #2d2d33;
  --c-text-1:       #1f1a1e;
  --c-red:          #b32a65;
  --c-red-3:        #b32a65;
  --white:          #ffffff;
  --br-1: 4px;  --br-2: 8px;  --br-3: 12px;
  --br-4: 16px; --br-5: 24px; --br-6: 36px;
  --br-round: 9999px;
  --fs-2: 0.694rem; --fs-2-5: 0.722rem; --fs-3: 0.833rem;
  --fs-4: 1rem;     --fs-5: 1.2rem;     --fs-6: 1.44rem;
}

/* ═══════════════ WRAPPER ═══════════════ */
.index-carousel .page-container {
  background-color: var(--c-grey-light-8);
  padding: 15px 0;
}
.index-carousel .page-width {
  margin: 0 auto;
  padding: 0 15px;
  width: 100%;
  max-width: 1280px;
}
.index-carousel .main-carousel {
  max-width: 100%;
  overflow: hidden;
}
.index-carousel .slide {
  max-width: 100%;
  padding: 0;
}

/* ═══════════════ SINGLE LAYOUT ═══════════════ */
.single-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  height: 480px;
}

/* ═══════════════ بنر بزرگ ═══════════════ */
.card-large.slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--br-4);
  background: var(--c-grey-light-5);
  height: 100%;
}
.card-large.slider .banner-link {
  display: block; height: 100%;
  text-decoration: none; color: inherit;
}
.card-large.slider .cover-image,
.card-large.slider .media-container {
  width: 100%; height: 100%; display: block;
}
.card-large.slider .media-container img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.card-large.slider .banner-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #b32a65 0%, #e879a8 100%);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.card-large.slider .banner-placeholder .bp-inner { text-align: center; opacity: 0.7; }
.card-large.slider .banner-placeholder .bp-emoji { display: block; font-size: 4rem; margin-bottom: 10px; }
.card-large.slider .banner-placeholder .bp-text { font-size: 1rem; font-weight: 700; }

/* کادر شفاف پایین بنر — پرکننده کل عرض */
.card-large.slider .wrapper {
  position: absolute;
  bottom: 20px !important;
  left: 20px !important;
  right: 20px !important;
  width: auto !important;
  max-width: none !important;
  padding: 12px 16px 12px 12px;
  display: flex !important;
  align-items: center;
  gap: 14px;
  border-radius: var(--br-3);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background-color: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: saturate(150%) blur(18px);
  backdrop-filter: saturate(150%) blur(18px);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .15);
  box-sizing: border-box !important;
}
.card-large.slider .thumb-link { display: block; }
.card-large.slider .thumb {
  width: 72px; height: 72px;
  overflow: hidden; border-radius: var(--br-2);
  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .15);
  flex-shrink: 0;
}
.card-large.slider .thumb .icon-container {
  width: 100%; height: 100%;
  display: flex; justify-content: center; align-items: center; padding: 10px;
}
.card-large.slider .thumb .icon-container img {
  max-width: 100%; max-height: 100%; object-fit: contain;
}
.card-large.slider .details {
  display: flex; flex-direction: column; gap: 6px;
  flex: 1 !important; max-width: none !important; overflow: hidden;
}
.card-large.slider .title-link { text-decoration: none; color: inherit; }
.card-large.slider .details .title {
  font-size: var(--fs-4); font-weight: 800; margin: 0;
  color: var(--c-text-1); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-large.slider .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.card-large.slider .tag {
  padding: 2px 10px 3px;
  font-size: var(--fs-2-5);
  color: var(--c-red-3);
  background-color: rgba(179, 42, 101, 0.12);
  border-radius: var(--br-round);
  font-weight: 700;
}

/* ═══════════════ دو کارت مربعی ═══════════════ */
.side-cards {
  display: grid; grid-template-rows: 1fr 1fr;
  gap: 16px; height: 100%;
}
.side-card {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--br-4); overflow: hidden;
  text-decoration: none; color: inherit;
  transition: transform .28s ease, box-shadow .28s ease;
  padding: 14px; border: 1px solid transparent;
}
.side-discount {
  background: linear-gradient(135deg, #fff2f7 0%, #ffe4ee 100%);
  border-color: #f5d0df;
}
.side-best {
  background: linear-gradient(135deg, #fffbea 0%, #fef3cf 100%);
  border-color: #f0dfa0;
}
.side-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px -12px rgba(179, 42, 101, .25);
}
.side-badge {
  display: inline-block; font-size: .72rem; font-weight: 800;
  padding: 3px 10px 4px; background: rgba(255, 255, 255, .7);
  border-radius: 999px; width: fit-content; margin-bottom: 8px;
  color: var(--c-text-1);
}
.side-discount .side-badge { color: #b32a65; }
.side-best    .side-badge { color: #a57500; }
.side-image {
  flex: 1; display: flex; align-items: center; justify-content: center;
  position: relative; min-height: 70px;
}
.side-image img {
  max-width: 100%; max-height: 110px; object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .08));
  transition: transform .35s ease;
}
.side-card:hover .side-image img { transform: scale(1.08); }
.side-image > span { font-size: 2.6rem; opacity: .5; }
.side-percent {
  position: absolute; top: 4px; left: 4px;
  background: #b32a65; color: #fff;
  font-size: .78rem; font-weight: 800;
  padding: 2px 8px 3px; border-radius: 8px;
}
.side-info { margin-top: 6px; }
.side-title {
  font-size: .88rem; font-weight: 800; color: var(--c-text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px;
}
.side-price { display: flex; align-items: baseline; gap: 6px; }
.side-price del { font-size: .72rem; color: #b8aeba; }
.side-price strong {
  font-size: 1rem; font-weight: 900; color: var(--c-red-3);
  font-feature-settings: "ss02";
}
.side-price strong span { font-size: .68rem; font-weight: 500; opacity: .8; margin-right: 2px; }

/* ═══════════════ MULTI SLIDE (۳ کارت) ═══════════════ */
.index-carousel .aspect-ratio { width: 100%; display: block; position: relative; }
.index-carousel .index-cards-wrapper {
  display: flex; flex-direction: column; gap: 12px; height: 480px;
}

/* 🔑 کارت اصلی */
.i-card {
  flex: 1;
  position: relative !important;
  overflow: hidden;
  border-radius: var(--br-3);
  z-index: 1;
  isolation: isolate;
}

.i-card .wrapper {
  padding: 16px;
  display: flex; align-items: center;
  position: relative;
  background-color: var(--white);
  border-radius: var(--br-3);
  transition: background-color 0.25s ease;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--c-grey-light-6);
  box-sizing: border-box;
}

.i-card .card-link {
  display: flex; align-items: center;
  text-decoration: none; color: inherit;
  width: 100%; height: 100%;
}

.i-card:hover .wrapper { background-color: var(--c-grey-dark-5); }

.i-card .thumb {
  width: 90px; height: 90px;
  border-radius: var(--br-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  background-color: var(--c-grey-light-6);
  transition: 0.3s ease;
}
.i-card .thumb .icon-container {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; padding: 12px;
}
.i-card .thumb .icon-container img {
  max-width: 100%; max-height: 100%; object-fit: contain;
}
.i-card .details {
  flex: 1; padding: 0 15px 0 0;
  display: flex; flex-direction: column; gap: 6px;
  overflow: hidden; transition: 0.3s ease;
}
.i-card .details .title {
  font-size: var(--fs-4); font-weight: 800; color: var(--c-text-1);
  margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color 0.3s ease;
}
.i-card:hover .details .title { color: #f8f4f7; }
.i-card .price { display: flex; align-items: baseline; gap: 4px; }
.i-card .price .old-price {
  font-size: .72rem;
  color: #b8aeba;
  margin-left: 4px;
}
.i-card .price .value {
  font-weight: 800; font-size: var(--fs-5);
  font-feature-settings: "ss02"; color: var(--c-red-3);
}
.i-card .price .currency { font-size: var(--fs-2); font-weight: 300; color: var(--c-grey); }
.i-card .details .tag {
  display: inline-block; border-radius: var(--br-round);
  padding: 2px 10px 3px;
  background-color: var(--c-grey-light-5);
  font-size: var(--fs-2); color: var(--c-grey-dark-2);
  width: fit-content;
  transition: 0.3s ease;
}
.i-card:hover .details .tag {
  background-color: rgba(255,255,255,.15);
  color: #f8f4f7;
}

/* ═══════════════════════════════════════════════════════
   🎬 HOVER OVERLAY — لایه هاور (دسکتاپ + موبایل با لمس)
═══════════════════════════════════════════════════════ */
.i-card .hover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 5;
  border-radius: var(--br-3);
  background: linear-gradient(180deg,
              rgba(31, 26, 30, 0.55) 0%,
              rgba(31, 26, 30, 0.88) 55%,
              rgba(31, 26, 30, 0.96) 100%);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: opacity .3s ease, visibility .3s ease;
  text-align: center;
  box-sizing: border-box;
}

/* 🔑 فعال شدن لایه هاور */
.i-card:hover .hover-overlay,
.i-card.is-touched .hover-overlay {   /* ← کلاس لمس موبایل */
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.i-card .hover-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.4;
  margin-bottom: 2px;
}

.i-card .hover-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.i-card .btn-cart,
.i-card .btn-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: .8rem;
  font-weight: 700;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease, border-color .2s ease;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.i-card .btn-cart {
  background-color: var(--c-red);
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(179, 42, 101, .6);
}
.i-card .btn-cart:hover {
  background-color: #9c2058;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(179, 42, 101, .8);
}

.i-card .btn-view {
  background-color: rgba(255, 255, 255, .15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.i-card .btn-view:hover {
  background-color: rgba(255, 255, 255, .3);
  border-color: rgba(255, 255, 255, .7);
  transform: translateY(-2px);
}

.i-card .btn-cart.is-added {
  background-color: #16a34a !important;
  box-shadow: 0 4px 14px -4px rgba(22, 163, 74, .6);
  pointer-events: none;
}
.i-card .btn-cart.is-loading {
  opacity: .75;
  pointer-events: none;
}

/* ═══════════════ PAGINATION ═══════════════ */
.index-carousel .pagination-wrapper {
  display: flex; justify-content: center; margin-top: 15px;
}
.index-carousel .main-carousel-pagination {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 30px; padding: 0 12px;
  background-color: #fff; border-radius: var(--br-round);
  box-shadow: 0 2px 6px -2px rgba(0,0,0,.08);
}
.index-carousel .swiper-pagination-bullet {
  width: 10px; height: 10px; border-radius: 999px;
  background: var(--c-grey-light-4); opacity: 1;
  transition: 0.2s ease; margin: 0 !important;
}
.index-carousel .swiper-pagination-bullet-active {
  background-color: var(--c-red-3); width: 24px;
}

/* ═══════════════════════════════════════════════════════
   TABLET (max 991px)
═══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .single-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .side-cards { display: none; }
  .card-large.slider { height: 380px; }

  .card-large.slider .wrapper {
    bottom: 14px !important;
    left: 14px !important;
    right: 14px !important;
    width: auto !important;
    max-width: none !important;
    padding: 10px 14px 10px 10px;
    gap: 12px;
    box-sizing: border-box !important;
  }
  .card-large.slider .thumb { width: 60px; height: 60px; }
  .card-large.slider .thumb .icon-container { padding: 8px; }
  .card-large.slider .details {
    flex: 1 !important; max-width: none !important; gap: 4px;
  }
  .card-large.slider .details .title { font-size: .92rem; }
  .card-large.slider .tag { font-size: .66rem; padding: 1px 8px 2px; }

  .index-carousel .index-cards-wrapper { height: 380px; }
  .i-card .wrapper { padding: 14px; }
  .i-card .thumb { width: 72px; height: 72px; }
  .i-card .details .title { font-size: .9rem; }
  .i-card .price .value { font-size: 1rem; }
}

/* ═══════════════════════════════════════════════════════
   MOBILE (max 560px) — هاور با لمس فعال
═══════════════════════════════════════════════════════ */
@media (max-width: 560px) {
  .card-large.slider { height: 340px; }
  .index-carousel .index-cards-wrapper { height: 340px; }

  .card-large.slider .wrapper {
    bottom: 10px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: none !important;
    padding: 8px 12px 8px 8px;
    box-sizing: border-box !important;
  }
  .card-large.slider .thumb { width: 52px; height: 52px; }
  .card-large.slider .details {
    flex: 1 !important; max-width: none !important;
  }
  .card-large.slider .details .title { font-size: .85rem; }

  .i-card .wrapper { padding: 12px; }
  .i-card .thumb { width: 62px; height: 62px; }
  .i-card .details .title { font-size: .85rem; }
  .i-card .price .value { font-size: .95rem; }

  /* در موبایل، پس‌زمینه کارت با لمس تیره نشه (چون لایه هاور خودش تیره می‌کنه) */
  .i-card.is-touched .wrapper { background-color: var(--c-grey-dark-5); }
  .i-card.is-touched .details .title { color: #f8f4f7; }
  .i-card.is-touched .details .tag {
    background-color: rgba(255,255,255,.15);
    color: #f8f4f7;
  }

  /* دکمه‌ها در موبایل کمی جمع‌وجورتر */
  .i-card .hover-actions { gap: 6px; }
  .i-card .btn-cart,
  .i-card .btn-view {
    padding: 8px 10px;
    font-size: .72rem;
    gap: 4px;
  }
  .i-card .btn-cart svg,
  .i-card .btn-view svg { width: 14px; height: 14px; }
  .i-card .hover-title { font-size: .9rem; }
}

/* ═══════════════════════════════════════════════════════
   DESKTOP (min 992px)
═══════════════════════════════════════════════════════ */
@media (min-width: 992px) {
  .index-carousel .page-container {
    padding: 20px 0 40px;
    background: linear-gradient(0deg, var(--white) 0%, var(--c-grey-light-7) 100%);
  }
  .index-carousel .page-width { padding: 20px; }
  .index-carousel .main-carousel {
    border-radius: var(--br-4);
    overflow: hidden;
  }
}

/* ═══════════════ DARK MODE ═══════════════ */
[data-theme="dark"] .card-large.slider .wrapper {
  background-color: rgba(30, 27, 34, 0.65);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .card-large.slider .details .title { color: #f8f4f7; }
[data-theme="dark"] .side-discount {
  background: linear-gradient(135deg, #2a1a24 0%, #1e1219 100%);
  border-color: #3a1f2a;
}
[data-theme="dark"] .side-best {
  background: linear-gradient(135deg, #2a2518 0%, #1e1a10 100%);
  border-color: #3a3220;
}
[data-theme="dark"] .side-badge { background: rgba(255,255,255,.1); color: #f8f4f7; }
[data-theme="dark"] .side-discount .side-badge { color: #e879a8; }
[data-theme="dark"] .side-best .side-badge { color: #f5d17a; }
[data-theme="dark"] .side-title { color: #f8f4f7; }
[data-theme="dark"] .i-card .wrapper { background-color: #1e1b22; border-color: #2a242f; }
[data-theme="dark"] .i-card .details .title { color: #f8f4f7; }
[data-theme="dark"] .i-card .thumb { background-color: #2a242f; }
[data-theme="dark"] .i-card .details .tag {
  background-color: #2a242f;
  color: #b8aeba;
}
[data-theme="dark"] .i-card .price .old-price { color: #7a6f7d; }
[data-theme="dark"] .index-carousel .page-container {
  background: linear-gradient(0deg, #0e0c11 0%, #16131a 100%);
}