/* Purple Card Carousel (PCS) - Background Bleed Fix */

.pcs-wrapper {
	position: relative;
	--edge-color: #0F0726;
	--edge-width: 160px;
	--card-radius: 24px;
	--gap: 24px;
	--w0: 451px;
	--h0: 416px;
	--w1: 280px;
	--h1: 360px;
	--w2: 220px;
	--h2: 320px;
	--w3: 180px;
	--h3: 300px;
	--inner-gradient: #0F0726;
	/* offsets for spacing */
	--offset-near: 385px;
	--offset-mid: 640px;
	--offset-far: 900px;
	--offset-hidden: 1200px;
	
	/* Fix background bleed */
	overflow: hidden !important;
	background: transparent !important;
	isolation: isolate; /* ایجاد stacking context جدید */
}

.pcs-wrapper::before,
.pcs-wrapper::after {
	content: "";
	position: absolute;
	top: 0;
	width: var(--edge-width);
	height: 100%;
	z-index: 100; /* خیلی بالا */
	pointer-events: none;
}
.pcs-wrapper::before {
	left: 0;
	background: linear-gradient(to right, var(--edge-color), rgba(15, 7, 38, 0));
}
.pcs-wrapper::after {
	right: 0;
	background: linear-gradient(to left, var(--edge-color), rgba(15, 7, 38, 0));
}

.pcs-slider {
	position: relative;
	z-index: 1;
	overflow: hidden !important; /* مهم */
	isolation: isolate;
}

.pcs-track {
	display: block;
	position: relative;
	height: calc(var(--h0) + 80px);
	padding: 24px calc(var(--edge-width) + 8px);
	overflow: hidden !important; /* کلیدی برای جلوگیری از نشت */
	isolation: isolate;
	background: transparent;
}

.pcs-slide {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	display: block;
	text-decoration: none;
	color: inherit;
	width: var(--w3);
	height: var(--h3);
	transition: transform .45s ease, opacity .35s ease, width .35s ease, height .35s ease, filter .35s ease;
	opacity: .55;
	isolation: isolate; /* جدا کردن stacking context */
	contain: layout style paint; /* performance و جلوگیری از نشت */
}

/* positions */
.pcs-slide.pcs_pos_1 {
	width: var(--w0);
	height: var(--h0);
	transform: translate(-50%, -50%) scale(1);
	z-index: 10;
	opacity: 1;
	filter: none;
}
.pcs-slide.pcs_pos_2 {
	width: var(--w1);
	height: var(--h1);
	transform: translate(calc(-50% + var(--offset-near)), -50%) scale(.94);
	z-index: 9;
	opacity: .92;
	filter: blur(.5px);
}
.pcs-slide.pcs_pos_9 {
	width: var(--w1);
	height: var(--h1);
	transform: translate(calc(-50% - var(--offset-near)), -50%) scale(.94);
	z-index: 9;
	opacity: .92;
	filter: blur(.5px);
}
.pcs-slide.pcs_pos_3 {
	width: var(--w2);
	height: var(--h2);
	transform: translate(calc(-50% + var(--offset-mid)), -50%) scale(.82);
	z-index: 8;
	opacity: .8;
	filter: blur(1px);
}
.pcs-slide.pcs_pos_8 {
	width: var(--w2);
	height: var(--h2);
	transform: translate(calc(-50% - var(--offset-mid)), -50%) scale(.82);
	z-index: 8;
	opacity: .8;
	filter: blur(1px);
}
.pcs-slide.pcs_pos_4 {
	width: var(--w3);
	height: var(--h3);
	transform: translate(calc(-50% + var(--offset-far)), -50%) scale(.7);
	z-index: 7;
	opacity: .68;
	filter: blur(2px);
}
.pcs-slide.pcs_pos_7 {
	width: var(--w3);
	height: var(--h3);
	transform: translate(calc(-50% - var(--offset-far)), -50%) scale(.7);
	z-index: 7;
	opacity: .68;
	filter: blur(2px);
}
.pcs-slide.pcs_pos_5 {
	transform: translate(calc(-50% + var(--offset-hidden)), -50%) scale(.6);
	opacity: .45;
	z-index: 6;
	filter: blur(6px);
}
.pcs-slide.pcs_pos_6 {
	transform: translate(calc(-50% - var(--offset-hidden)), -50%) scale(.6);
	opacity: .45;
	z-index: 6;
	filter: blur(6px);
}

.pcs-card {
	position: relative;
	width: 100%;
	height: 100%;
	border-radius: var(--card-radius);
	overflow: hidden !important; /* مهم */
	box-shadow: 0 12px 40px rgba(0,0,0,.35);
	background: #000; /* fallback background */
	isolation: isolate;
	contain: layout style paint;
}
.pcs-card__img {
	width: 100%;
	height: 100%;
	min-width: 100%;
	min-height: 100%;
	object-fit: cover !important;
	object-position: center center;
	display: block;
	position: relative;
	z-index: 1;
}
.pcs-card__img-wrap {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden !important; /* کلیدی */
	isolation: isolate;
}
.pcs-card__img-wrap::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 70%;
	background: linear-gradient(to top, var(--inner-gradient), rgba(15,7,38,0));
	pointer-events: none;
	z-index: 2;
}

.pcs-card__content {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	padding: 18px 18px 20px 18px;
	color: #fff;
	z-index: 3;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.pcs-title {
	margin: 0 0 8px 0;
	line-height: 1.35;
	color: #fff;
}
.pcs-sub {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #cfd0d8;
}
.pcs-sub .pcs-sub__icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255,255,255,.08);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
}

/* wrapper جداگانه برای آیکون */
.pcs-icon-wrapper {
	position: absolute;
	display: inline-flex;
	flex-shrink: 0;
	z-index: 4;
}

/* ――――――― موقعیت‌های مختلف آیکون ――――――― */

/* آیکون بالا-چپ */
.pcs-icon-pos-top-left {
	top: 18px;
	left: 18px;
}

/* آیکون بالا-راست */
.pcs-icon-pos-top-right {
	top: 18px;
	right: 18px;
}

/* آیکون پایین-چپ */
.pcs-icon-pos-bottom-left {
	bottom: 20px;
	left: 18px;
}

/* آیکون پایین-راست */
.pcs-icon-pos-bottom-right {
	bottom: 20px;
	right: 18px;
}

.pcs-nav {
    position: absolute;
	top: 50%;
	transform: translateY(-50%);
    backdrop-filter: blur(4px);
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 8px !important;
    width: 44px !important;
    height: 64px !important;
    border-radius: 248px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    color: #fff !important;
    font-size: 18px;
	line-height: 44px;
	text-align: center;
	cursor: pointer;
	z-index: 200; /* خیلی بالاتر از همه */
}

.pcs-nav--prev { left: 16px; }
.pcs-nav--next { right: 16px; }
.pcs-nav svg { pointer-events: none; }

/* ――――――― تبلت: 768-991px ――――――― */
@media (min-width: 768px) and (max-width: 991px) {
  .pcs-wrapper {
    --edge-width: 56px;
    --w0: 72vw;  --h0: 54vw;
    --w1: 50vw;  --h1: 40vw;
    --w2: 42vw;  --h2: 34vw;
    --w3: 36vw;  --h3: 30vw;
    --offset-near: 40vw;
    --offset-mid:  62vw;
    --offset-far:  84vw;
    --offset-hidden: 112vw;
  }

  .pcs-slide { 
    width: auto !important; 
    max-width: none !important; 
  }

  .pcs-slide.pcs_pos_1 { width: var(--w0) !important; height: var(--h0) !important; }
  .pcs-slide.pcs_pos_2,
  .pcs-slide.pcs_pos_9 { width: var(--w1) !important; height: var(--h1) !important; }
  .pcs-slide.pcs_pos_3,
  .pcs-slide.pcs_pos_8 { width: var(--w2) !important; height: var(--h2) !important; }
  .pcs-slide.pcs_pos_4,
  .pcs-slide.pcs_pos_7 { width: var(--w3) !important; height: var(--h3) !important; }

  .pcs-track { padding: 16px calc(var(--edge-width) + 6px); }
}

/* ――――――― موبایل: ≤ 767px ――――――― */
@media (max-width: 767px) {
  .pcs-wrapper {
    --edge-width: 20px;
    --w0: 280px;
    --h0: 360px;
    --w1: 220px;
    --h1: 300px;
    --w2: 180px;
    --h2: 260px;
    --w3: 150px;
    --h3: 220px;
    --offset-near: 160px;
    --offset-mid: 280px;
    --offset-far: 400px;
    --offset-hidden: 550px;
  }

  .pcs-track {
    height: 440px;
    padding: 20px;
  }

  .pcs-slide {
    transition: all 0.4s ease;
  }

  .pcs-slide.pcs_pos_1 {
    width: 280px;
    height: 360px;
  }

  .pcs-slide.pcs_pos_2,
  .pcs-slide.pcs_pos_9 {
    width: 220px;
    height: 300px;
  }

  .pcs-slide.pcs_pos_3,
  .pcs-slide.pcs_pos_8 {
    width: 180px;
    height: 260px;
  }

  .pcs-slide.pcs_pos_4,
  .pcs-slide.pcs_pos_7 {
    width: 150px;
    height: 220px;
  }

  .pcs-slide.pcs_pos_5,
  .pcs-slide.pcs_pos_6 {
    opacity: 0;
    visibility: hidden;
  }
}

/* ――――――― موبایل خیلی کوچک: ≤ 480px ――――――― */
@media (max-width: 480px) {
  .pcs-wrapper {
    --edge-width: 15px;
    --w0: 240px;
    --h0: 320px;
    --w1: 190px;
    --h1: 270px;
    --w2: 150px;
    --h2: 230px;
    --w3: 120px;
    --h3: 200px;
    --offset-near: 140px;
    --offset-mid: 240px;
    --offset-far: 350px;
    --offset-hidden: 480px;
  }

  .pcs-track {
    height: 380px;
    padding: 15px;
  }

  .pcs-slide.pcs_pos_1 {
    width: 240px;
    height: 320px;
  }

  .pcs-slide.pcs_pos_2,
  .pcs-slide.pcs_pos_9 {
    width: 190px;
    height: 270px;
  }

  .pcs-slide.pcs_pos_3,
  .pcs-slide.pcs_pos_8 {
    width: 150px;
    height: 230px;
  }

  .pcs-slide.pcs_pos_4,
  .pcs-slide.pcs_pos_7 {
    width: 120px;
    height: 200px;
  }

  .pcs-nav {
    width: 36px;
    height: 48px;
  }

  .pcs-nav--prev { left: 8px; }
  .pcs-nav--next { right: 8px; }
}

/* ――――――― کنترل نمایش آیکون در دستگاه‌های مختلف ――――――― */
.pcs-icon-hide-all { display: none !important; }

/* ――――――― کنترل نمایش آیکون در دستگاه‌های مختلف ――――――― */
@media (max-width: 991px) {
  .pcs-icon-hide-tablet {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .pcs-icon-hide-mobile {
    display: none !important;
  }
}

/* ――――――― کنترل نمایش دکمه‌های ناوبری در دستگاه‌های مختلف ――――――― */
@media (max-width: 991px) {
  .pcs-nav-hide-tablet {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .pcs-nav-hide-mobile {
    display: none !important;
  }
}

@media (max-width: 991px) {
  .pcs-nav--prev { left: 10px; z-index: 250; }
  .pcs-nav--next { right: 10px; z-index: 250; }

  /* آیکون کنار توضیحات در تبلت و موبایل */
  .pcs-sub .pcs-sub__icon {
    width: 30px !important;
    height: 30px !important;
  }
}