
:root {
  --home-hero-height:
    clamp(190px, 53.5vw, 230px);

  --home-card-width:
    clamp(136px, 40vw, 176px);

  --home-card-body-height: 96px;
}


/* ==================
   10) HERO SLIDER
===================== */
.hero-section {
  padding: 14px 14px 6px;
}
.slider {
  position: relative;
}

.slider-viewport {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-lg);
  background: #EEF8FD;
  touch-action: pan-y;
}

.slide {
  min-width: 100%;
  flex: 0 0 100%;
  height: var(--home-hero-height);
  overflow: hidden;
  background: #EEF8FD;
  user-select: none;
}
.slides {
  display: flex;
  direction: ltr;
  transform: translate3d(0, 0, 0);
  transition: none;
  will-change: transform;
}



.slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

.dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
  direction: ltr;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 3px rgba(15, 41, 49, 0.18);
}

.dot.active {
  width: 19px;
  background: #eefbfe;
}



/* ==================
   11) HOME CATEGORIES
===================== */
.categories-section {
  margin-top: 8px;
  padding: 8px 14px 10px;
}
.categories {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 0 2px;
  scrollbar-width: none;
}

.categories::-webkit-scrollbar {
  display: none;
}

.category-card {
  width: 72px;
  min-width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: none;
}

.category-img {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 0;
  background: var(--card);
}

.category-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-name {
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}


/* ==================
   12) HOME SECTIONS
===================== */
.section {
  padding: 12px 10px 0;
}

.section + .section {
  margin-top: 20px;
}

.section-frame {
  padding: 9px 0 10px;
  border: 1px solid #d6f1f8;
  border-radius: var(--radius-md);
  background: #eefbfe;
  overflow: hidden;
}



.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  padding: 0 9px;
}

.section-title {
  position: relative;
  color: var(--text-dark);
  font-size: 13.8px;
  font-weight: 500;
  line-height: 1.5;
  padding-right: 0;
}

.section-title::before {
  content: none;
}

.section-link {
  height: 25px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid rgba(15, 41, 49, 0.08);
  color: var(--text-dark);
  font-size: 10.6px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

/* ==================
   13) PRODUCT ROW / GRID
===================== */
.products-row {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 12px 6px;
  scroll-padding-inline: 12px;
  scroll-snap-type: none;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.products-row::-webkit-scrollbar {
  display: none;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}


/* ==================
   14) PRODUCT CARD
===================== */
/* ==================
   PRODUCT CARDS
===================== */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(   var(--home-card-width) +   var(--home-card-body-height) );
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: none;
}

.product-card:active {
  transform: none;
  border-color: transparent;
}

.product-card:hover .product-image img {
  transform: none;
}

.products-row .product-card {
  width: var(--home-card-width);
  min-width: var(--home-card-width);
  flex: 0 0 var(--home-card-width);
  max-width: var(--home-card-width);
  scroll-snap-align: start;
}

.product-image {
  width: 100%;
  height: var(--home-card-width);
  flex: 0 0 var(--home-card-width);
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img {
  width: 94%;
  height: 94%;
  object-fit: contain;
}

.product-body {
  height: var(--home-card-body-height);
  flex: 0 0 96px;
  padding: 0 7px 5px;
  display: flex;
  flex-direction: column;
}

.product-title {
  margin: 0;
  padding-top: 1px;
  min-height: 38px;
  color: #173640;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  text-align: right;
  direction: rtl;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-pricing {
  width: 100%;
  min-height: 31px;
  margin-top: auto;
  padding-top: 0;
  
  padding-left: 0; 
  direction: rtl;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center; 
  gap: 1px;
  text-align: center;
}

.product-old-row {
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center; 
}

.product-price {
  color: var(--price);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center; 
  width: 100%;
}

.product-old-price {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: line-through;
  text-decoration-thickness: 0.6px;
  text-decoration-color: rgba(120, 130, 145, 0.9);
}

.product-old-price::after {
  content: none;
}



.product-discount-badge,
.discount-badge {
  position: absolute;
  left: 0;
  top: auto;
bottom: 18px;
  transform: none;

  min-width: 26px;
  height: 18px;
  padding: 0 6px;

  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  background: var(--discount);
  color: #ffffff;

  font-size: 10px;
  font-weight: 600;
  line-height: 18px;

  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}
/* ==================
   15) PRODUCT CARD - INACTIVE / OUT OF STOCK
===================== */
.product-card.is-inactive {
  isolation: isolate;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.product-card.is-inactive:hover {
  transform: none;
  box-shadow: none;
}

.product-card.is-inactive .product-image img {
  opacity: 0.82;
  filter: saturate(0.82);
}

.product-card.is-inactive .product-title,
.product-card.is-inactive .product-price,
.product-card.is-inactive .product-old-price {
  opacity: 0.76;
}

.product-card.is-inactive::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.out-of-stock-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 20;
  padding: 6px 9px;
  border-radius: var(--radius-pill);
  background: #e11d48;
  color: #ffffff;
  font-size: 10.8px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}


/* =========================================================
   SHIMMER BASE
========================================================= */

.home-hero-skeleton,
.category-card-skeleton .category-img,
.category-card-skeleton .category-name,
.section-title-skeleton,
.section-link-skeleton,
.product-card-skeleton .product-image,
.product-title-skeleton,
.product-price-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--skeleton-base) !important;
}

.home-hero-skeleton::after,
.category-card-skeleton .category-img::after,
.category-card-skeleton .category-name::after,
.section-title-skeleton::after,
.section-link-skeleton::after,
.product-card-skeleton .product-image::after,
.product-title-skeleton::after,
.product-price-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;

  background:
    linear-gradient(
      100deg,
      transparent 20%,
      var(--skeleton-shine) 50%,
      transparent 80%
    );

  transform: translateX(110%);
  animation: homeSkeletonShimmer 1.25s linear infinite;
  pointer-events: none;
}

@keyframes homeSkeletonShimmer {
  from {
    transform: translateX(110%);
  }

  to {
    transform: translateX(-110%);
  }
}

/* =========================================================
   HERO SKELETON
========================================================= */

.hero-section-skeleton {
  padding: 14px 14px 6px;
}

.hero-section-skeleton .slider {
  position: relative;
  width: 100%;
}

.hero-section-skeleton .slider-viewport {
  position: relative;

  width: 100%;
  height: var(--home-hero-height);

  overflow: hidden;

  border: 0;
  border-radius: var(--radius-lg);

  background: transparent;
}

.home-hero-skeleton {
  display: block;

  width: 100%;
  height: var(--home-hero-height);

  border-radius: var(--radius-lg);
}

.home-dots-skeleton {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 5;

  margin: 0;

  transform: translateX(-50%);

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  direction: ltr;
}

.home-dots-skeleton .dot {
  width: 6px;
  height: 6px;

  border: 0;
  border-radius: var(--radius-pill);

  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.home-dots-skeleton .dot.active {
  width: 19px;
  background: #ffffff;
}

/* =========================================================
   CATEGORY SKELETON
========================================================= */

.category-card-skeleton {
  width: 72px;
  min-width: 72px;
  flex: 0 0 72px;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.category-card-skeleton .category-img {
  display: block;

  width: 54px;
  height: 54px;
  flex: 0 0 54px;

  border: 0;
  border-radius: var(--radius-md);
}

.category-card-skeleton .category-name {
  display: block !important;

  width: 54px !important;
  height: 12px !important;
  min-height: 12px !important;

  margin: 0;

  border-radius: 6px;

  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

/* برای طبیعی‌تر شدن عرض نام دسته‌ها */
.category-card-skeleton:nth-child(2n) .category-name {
  width: 43px !important;
}

.category-card-skeleton:nth-child(3n) .category-name {
  width: 61px !important;
}

/* =========================================================
   SECTION SKELETON
========================================================= */

.section-skeleton {
  padding: 12px 10px 0;
}

.section-skeleton + .section-skeleton {
  margin-top: 20px;
}

.section-skeleton .section-frame {
  padding: 9px 0 10px;

  overflow: hidden;

  border: 1px solid #d6f1f8;
  border-radius: var(--radius-md);

  background: #eefbfe;
}

.section-skeleton .section-head {
  min-height: 25px;
  margin-bottom: 7px;
  padding: 0 9px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title-skeleton {
  width: 110px;
  height: 18px;

  border-radius: 8px;
}

.section-link-skeleton {
  width: 65px;
  height: 25px;

  border-radius: var(--radius-pill);
}

/* تنوع ظاهری عنوان بخش‌ها */
.section-skeleton:nth-child(2n) .section-title-skeleton {
  width: 88px;
}

.section-skeleton:nth-child(3n) .section-title-skeleton {
  width: 132px;
}

/* =========================================================
   PRODUCT ROW SKELETON
========================================================= */

.section-skeleton .products-row {
  display: flex;

  gap: 9px;

  padding: 2px 12px 6px;

  overflow-x: hidden;
  overflow-y: hidden;

  scroll-snap-type: none;
}

/* =========================================================
   PRODUCT CARD SKELETON
========================================================= */

.products-row .product-card-skeleton {
  position: relative;

  width: var(--home-card-width);
  min-width: var(--home-card-width);
  max-width: var(--home-card-width);
  height: calc(   var(--home-card-width) +   var(--home-card-body-height) );
  flex: 0 0 var(--home-card-width);

  overflow: hidden;

  border: 0;
  border-radius: var(--radius-sm);

  background: #ffffff;

  box-shadow: none;

  display: flex;
  flex-direction: column;
}

.product-card-skeleton .product-image {
  display: block;

  width: 100%;
  height: var(--home-card-width);
  min-height: var(--home-card-width);
  flex: 0 0 var(--home-card-width);

  padding: 0;

  border-radius:
    var(--radius-sm)
    var(--radius-sm)
    0
    0;
}

.product-card-skeleton .product-body {
  width: 100%;
  height: var(--home-card-body-height);
  flex: 0 0 96px;

  padding: 7px 7px 5px;

  background: #ffffff;

  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.product-title-skeleton {
  width: 88%;
  height: 32px;

  margin: 0;

  border-radius: 7px;
}

.product-price-skeleton {
  width: 62%;
  height: 16px;

  margin:
    auto
    auto
    4px;

  border-radius: 8px;
}

/* تنوع عرض متن کارت‌ها */
.product-card-skeleton:nth-child(2n) .product-title-skeleton {
  width: 73%;
}

.product-card-skeleton:nth-child(3n) .product-title-skeleton {
  width: 94%;
}

.product-card-skeleton:nth-child(2n) .product-price-skeleton {
  width: 52%;
}

.home-load-error {
  margin: 14px;
  padding: 14px;

  border: 1px dashed rgba(225, 29, 72, 0.22);
  border-radius: var(--radius-md);

  background: #fff5f7;
  color: #b42345;

  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

/* =========================================================
   FEATURED SECTION
   فقط سکشن اول
========================================================= */

.section-featured .section-frame {
    padding: 9px 0 10px;

    border: 1px solid #d6f1f8;
    border-radius: var(--radius-md);

    background: #eefbfe;

    overflow: hidden;
}


/* =========================================================
   NORMAL SECTIONS
   سکشن‌های بعدی
========================================================= */

.section-normal {
    padding-top: 18px;
}

.section-normal + .section-normal {
    margin-top: 4px;
}

.section-normal .section-frame {
    padding: 0;

    border: 0;
    border-radius: 0;

    background: transparent;

    overflow: hidden;
}

.section-normal .section-head {
    min-height: 30px;

    margin-bottom: 9px;
    padding: 0 4px;
}

.section-normal .section-title {
    position: relative;

    padding-right: 11px;

    color: #173640;

    font-size: 13.8px;
    font-weight: 600;
}

.section-normal .section-title::before {
    content: "";

    position: absolute;
    top: 50%;
    right: 0;

    width: 4px;
    height: 16px;

    border-radius: 10px;

    background: #46c8dd;

    transform: translateY(-50%);
}

.section-normal .section-link {
    height: auto;
    padding: 3px 0;

    border: 0;
    border-radius: 0;

    background: transparent;

    color: #6e969d;

    font-size: 10px;
    font-weight: 500;
}

.section-normal .products-row {
    padding-right: 4px;
    padding-left: 4px;
    padding-bottom: 6px;
}
.section-normal .product-card {
    border: 1px solid rgba(23, 54, 64, 0.10);
}
/* =========================================================
   HOME RESPONSIVE SIZES
========================================================= */

@media (
  min-width: 600px
) and (
  max-width: 899px
) {

  :root {
    --home-hero-height: 300px;
    --home-card-width: 176px;
  }

  .category-card-skeleton {
    flex-basis: 72px;
  }
}


@media (min-width: 900px) {

  :root {
    --home-hero-height:
      clamp(320px, 30vw, 390px);

    --home-card-width: 190px;
  }

  .category-card-skeleton {
    width: 92px;
    min-width: 92px;
    flex-basis: 92px;
  }

  .category-card-skeleton .category-img {
    width: 66px;
    height: 66px;
    flex-basis: 66px;
  }

  .product-card {
    transition:
      transform 0.18s ease,
      border-color 0.18s ease;
  }
}


@media (
  min-width: 900px
) and (
  hover: hover
) and (
  pointer: fine
) {

  .product-card:hover {
    transform: translateY(-3px);
  }

  .category-card:hover {
    transform: translateY(-2px);
  }
}