.ft-hover-cards-wrapper {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

/* ساختار شبکه ثابت */
.ft-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  width: 100%;
}

@media (max-width: 991px) {
  .ft-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 576px) {
  .ft-cards-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ساختار اسلایدر کروسل */
.ft-carousel-outer {
  position: relative;
  width: 100%;
}

.ft-cards-carousel.swiper {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.ft-carousel-outer .swiper-wrapper {
  display: flex !important;
  height: auto;
}

.ft-carousel-outer .swiper-slide {
  flex-shrink: 0;
  height: auto;
  display: flex;
}

/* استایل پایه کارت‌ها */
.ft-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 1.5rem;
  width: 100%;
  height: 380px;
  text-align: center;
  color: #fff;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08), 
              0 2px 2px rgba(0,0,0,0.08), 
              0 4px 4px rgba(0,0,0,0.08), 
              0 8px 8px rgba(0,0,0,0.08);
  box-sizing: border-box;
  
  /* مقادیر پیش‌فرض انتقال حرکتی انیمیشن */
  --d: 700ms;
  --e: cubic-bezier(0.19, 1, 0.22, 1);
  --bg-image: none;
  --zoom-scale: 1.05;
  --text-resting-height: 60px;
  --overlay-start: rgba(0,0,0,0);
  --overlay-end: rgba(0,0,0,0.8);
}

/* تصویر پس‌زمینه کارت با زوم متغیر */
.ft-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 110%;
  background-size: cover;
  background-position: center;
  transition: transform calc(var(--d) * 1.5) var(--e);
  pointer-events: none;
  background-image: var(--bg-image);
  z-index: 0;
}

/* لایه همپوشانی تیره داینامیک */
.ft-card::after {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200%;
  pointer-events: none;
  background-image: linear-gradient(
    to bottom,
    var(--overlay-start) 0%,
    var(--overlay-end) 100%
  );
  transform: translateY(-50%);
  transition: transform calc(var(--d) * 2) var(--e);
  z-index: 0;
}

/* کانتینر متون داخل کارت */
.ft-card .content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  transition: transform var(--d) var(--e);
  z-index: 1;
}

.ft-card .content > * + * {
  margin-top: 1rem;
}

.ft-card .title {
  font-size: 1.3rem;
  font-weight: bold;
  line-height: 1.2;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.ft-card .copy {
  font-size: 1rem;
  font-style: italic;
  line-height: 1.4;
  margin: 0;
}

/* دکمه اکشن کارت */
.ft-card .btn {
  display: inline-block;
  cursor: pointer;
  padding: 0.75rem 1.5rem;
  font-size: 0.65rem;
  font-weight: bold;
  letter-spacing: 0.025rem;
  text-transform: uppercase;
  color: white;
  background-color: black;
  border: none;
  text-decoration: none;
  transition: all 0.3s ease;
}

/* هوور افکت کارت‌ها روی دسکتاپ و ابعاد بزرگتر */
@media (hover: hover) and (min-width: 600px) {
  .ft-card::after {
    transform: translateY(0);
  }
  
  /* موقعیت اولیه متغیر با توجه به ترنسلیت کانتینر */
  .ft-card .content {
    transform: translateY(calc(100% - var(--text-resting-height)));
  }
  
  .ft-card .content > *:not(.title) {
    opacity: 0;
    transform: translateY(1.5rem);
    transition: transform var(--d) var(--e),
                opacity var(--d) var(--e);
  }
  
  .ft-card:hover::before,
  .ft-card:focus-within::before {
    transform: translateY(-4%) scale(var(--zoom-scale));
  }

  .ft-card:hover::after,
  .ft-card:focus-within::after {
    transform: translateY(-50%);
  }

  .ft-card:hover .content,
  .ft-card:focus-within .content {
    transform: translateY(0);
  }

  .ft-card:hover .content > *:not(.title),
  .ft-card:focus-within .content > *:not(.title) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(var(--d) / 8);
  }
  
  .ft-card:focus-within::before,
  .ft-card:focus-within::after,
  .ft-card:focus-within .content,
  .ft-card:focus-within .content > *:not(.title) {
    transition-duration: 0s;
  }
}

/* استایل ناوبری و نقطه‌های اسلایدر */
.ft-carousel-outer .swiper-button-prev,
.ft-carousel-outer .swiper-button-next {
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ft-carousel-outer .swiper-button-prev::after,
.ft-carousel-outer .swiper-button-next::after {
  font-size: 16px;
}

.ft-carousel-outer .swiper-button-prev { left: 10px; }
.ft-carousel-outer .swiper-button-next { right: 10px; }

.ft-carousel-outer .swiper-pagination {
  position: relative;
  margin-top: 20px;
  text-align: center;
}

.ft-carousel-outer .swiper-pagination-bullet {
  background: #ccc;
  opacity: 1;
  width: 8px;
  height: 8px;
}

.ft-carousel-outer .swiper-pagination-bullet-active {
  background: #333;
}