/* =========================================
   Araam Layout Override
   مناسب للترتيب الجديد:
   قسم مميز بالأعلى + بانر + أحدث المنتجات
   ========================================= */


/* -----------------------------------------
   0) إلغاء تأثيرات قديمة كانت ترفع الأقسام
----------------------------------------- */

.s-block--products:first-of-type,
.products-section:first-of-type {
  margin-top: 0 !important;
  position: relative;
  z-index: 1;
}

.s-block--hero-slider + .s-block,
.hero-slider + .s-block,
.main-slider + .s-block {
  margin-top: 32px !important;
  position: relative !important;
  z-index: 1 !important;
}


/* -----------------------------------------
   1) القسم الأول (الأكثر طلباً / المميز)
----------------------------------------- */

.s-block--products:first-of-type {
  background: linear-gradient(135deg, #003f36 0%, #0d4a31 55%, #1f2616 100%) !important;
  border-radius: 28px !important;
  padding: 26px !important;
  margin-top: 28px !important;
  margin-bottom: 36px !important;
  box-shadow: 0 18px 44px rgba(0, 63, 54, 0.16) !important;
  overflow: hidden !important;
}

/* عنوان القسم الأول */
.s-block--products:first-of-type .s-block__title,
.s-block--products:first-of-type .s-block-title,
.s-block--products:first-of-type .section-title,
.s-block--products:first-of-type h2 {
  color: #ffffff !important;
  font-weight: 900 !important;
  margin-bottom: 22px !important;
}

.s-block--products:first-of-type .s-block__title::after,
.s-block--products:first-of-type .section-title::after {
  background: linear-gradient(90deg, #d6b05c, #f4e2a7) !important;
}


/* شبكة القسم الأول */
.s-block--products:first-of-type .s-products-list-wrapper,
.s-block--products:first-of-type .products-grid,
.s-block--products:first-of-type .grid-products,
.s-block--products:first-of-type .s-slider-block__items {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1.7fr !important;
  gap: 20px !important;
  align-items: stretch !important;
}

/* الكروت داخل القسم الأول */
.s-block--products:first-of-type .s-product-card-entry,
.s-block--products:first-of-type .product-card,
.s-block--products:first-of-type .salla-product-card {
  background: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12) !important;
  height: 100% !important;
}

/* أول منتج = المنتج المميز الكبير */
.s-block--products:first-of-type .s-product-card-entry:first-child,
.s-block--products:first-of-type .product-card:first-child,
.s-block--products:first-of-type .salla-product-card:first-child {
  grid-column: 3 !important;
  grid-row: 1 / span 2 !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 22px !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18) !important;
}

/* الصور في القسم الأول */
.s-block--products:first-of-type .s-product-card-image,
.s-block--products:first-of-type .product-card__image {
  background: #f7f9f8 !important;
  overflow: hidden !important;
}

/* صورة المنتج المميز */
.s-block--products:first-of-type .s-product-card-entry:first-child .s-product-card-image,
.s-block--products:first-of-type .product-card:first-child .product-card__image {
  aspect-ratio: 16 / 10 !important;
}

/* صور المنتجات الصغيرة */
.s-block--products:first-of-type .s-product-card-entry:not(:first-child) .s-product-card-image,
.s-block--products:first-of-type .product-card:not(:first-child) .product-card__image {
  aspect-ratio: 16 / 10 !important;
}

/* محتوى الكرت */
.s-block--products:first-of-type .s-product-card-content,
.s-block--products:first-of-type .product-card__content {
  padding: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
}

/* عنوان المنتج المميز */
.s-block--products:first-of-type .s-product-card-entry:first-child .s-product-card-content-title,
.s-block--products:first-of-type .product-card:first-child .product-card__title,
.s-block--products:first-of-type .s-product-card-entry:first-child h3,
.s-block--products:first-of-type .product-card:first-child h3 {
  font-size: 22px !important;
  line-height: 1.6 !important;
  font-weight: 900 !important;
  min-height: auto !important;
  margin-bottom: 10px !important;
  color: #17211f !important;
}

/* عنوان المنتجات الصغيرة */
.s-block--products:first-of-type .s-product-card-entry:not(:first-child) .s-product-card-content-title,
.s-block--products:first-of-type .product-card:not(:first-child) .product-card__title,
.s-block--products:first-of-type .s-product-card-entry:not(:first-child) h3,
.s-block--products:first-of-type .product-card:not(:first-child) h3 {
  font-size: 15px !important;
  line-height: 1.7 !important;
  font-weight: 800 !important;
  min-height: 48px !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* إظهار الوصف للمنتج المميز فقط */
.s-block--products:first-of-type .s-product-card-entry:first-child .s-product-card-content-subtitle,
.s-block--products:first-of-type .product-card:first-child .product-card__subtitle,
.s-block--products:first-of-type .s-product-card-entry:first-child p,
.s-block--products:first-of-type .product-card:first-child p {
  display: block !important;
  color: #5e6a67 !important;
  font-size: 14px !important;
  line-height: 1.8 !important;
  margin-bottom: 12px !important;
}

/* إخفاء أي وصف زائد في الكروت الصغيرة إن وجد */
.s-block--products:first-of-type .s-product-card-entry:not(:first-child) .s-product-card-content-subtitle,
.s-block--products:first-of-type .product-card:not(:first-child) .product-card__subtitle {
  display: none !important;
}

/* السعر في القسم الأول */
.s-block--products:first-of-type .s-product-card-price,
.s-block--products:first-of-type .product-card__price,
.s-block--products:first-of-type .price {
  color: #b42318 !important;
  font-weight: 900 !important;
  margin: 8px 0 12px !important;
}

/* الزر في القسم الأول */
.s-block--products:first-of-type .s-button-btn,
.s-block--products:first-of-type .add-to-cart,
.s-block--products:first-of-type button {
  margin-top: auto !important;
  height: 44px !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: #003f36 !important;
  border: 1px solid #b7cfc8 !important;
  font-weight: 800 !important;
}

.s-block--products:first-of-type .s-button-btn:hover,
.s-block--products:first-of-type .add-to-cart:hover,
.s-block--products:first-of-type button:hover {
  background: #003f36 !important;
  color: #ffffff !important;
  border-color: #003f36 !important;
}

/* لو فيه عدّاد/معلومات إضافية داخل المنتج المميز */
.s-block--products:first-of-type .s-product-card-entry:first-child .countdown,
.s-block--products:first-of-type .s-product-card-entry:first-child [class*="count"],
.s-block--products:first-of-type .product-card:first-child [class*="count"] {
  margin-top: 14px !important;
}


/* -----------------------------------------
   2) البانر الذي بعد القسم الأول
----------------------------------------- */

.s-block--products:first-of-type + .s-block--hero-slider,
.s-block--products:first-of-type + .hero-slider,
.s-block--products:first-of-type + .main-slider {
  margin-top: 26px !important;
}

.s-block--hero-slider,
.hero-slider,
.main-slider {
  min-height: 280px !important;
  max-height: 360px !important;
  border-radius: 28px !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 20% 20%, rgba(197, 154, 66, 0.12), transparent 30%),
    linear-gradient(135deg, #1e1b12 0%, #5a4618 100%) !important;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.12);
}

/* محتوى البانر */
.s-block--hero-slider .swiper-slide,
.hero-slider .swiper-slide,
.main-slider .swiper-slide {
  min-height: 280px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
}

/* نصوص البانر */
.s-block--hero-slider h1,
.s-block--hero-slider h2,
.hero-slider h1,
.hero-slider h2,
.main-slider h1,
.main-slider h2 {
  font-size: clamp(26px, 4vw, 54px) !important;
  line-height: 1.4 !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  max-width: 780px !important;
  margin: 0 auto 10px !important;
  text-align: center !important;
}

.s-block--hero-slider p,
.hero-slider p,
.main-slider p {
  color: rgba(255, 255, 255, 0.78) !important;
  text-align: center !important;
  font-size: 15px !important;
}

/* أسهم البانر */
.s-block--hero-slider .swiper-button-next,
.s-block--hero-slider .swiper-button-prev,
.hero-slider .swiper-button-next,
.hero-slider .swiper-button-prev,
.main-slider .swiper-button-next,
.main-slider .swiper-button-prev {
  width: 42px !important;
  height: 42px !important;
  background: rgba(255, 255, 255, 0.95) !important;
  border-radius: 50% !important;
  color: #003f36 !important;
}


/* -----------------------------------------
   3) الأقسام التالية (أحدث المنتجات وغيرها)
----------------------------------------- */

.s-block--products:not(:first-of-type) {
  background: transparent !important;
  padding-top: 18px !important;
  padding-bottom: 18px !important;
}

.s-block--products:not(:first-of-type) .s-products-list-wrapper,
.s-block--products:not(:first-of-type) .products-grid,
.s-block--products:not(:first-of-type) .grid-products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 26px !important;
}

.s-block--products:not(:first-of-type) .s-product-card-entry,
.s-block--products:not(:first-of-type) .product-card,
.s-block--products:not(:first-of-type) .salla-product-card {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  border: 1px solid #e6ebe9 !important;
  box-shadow: 0 10px 28px rgba(0, 63, 54, 0.07) !important;
}

.s-block--products:not(:first-of-type) .s-product-card-image,
.s-block--products:not(:first-of-type) .product-card__image {
  aspect-ratio: 16 / 10 !important;
  background: #f4f7f6 !important;
}

.s-block--products:not(:first-of-type) .s-product-card-image img,
.s-block--products:not(:first-of-type) .product-card__image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.s-block--products:not(:first-of-type) .s-product-card-content,
.s-block--products:not(:first-of-type) .product-card__content {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  padding: 16px !important;
}

.s-block--products:not(:first-of-type) .s-product-card-content-title,
.s-block--products:not(:first-of-type) .product-card__title,
.s-block--products:not(:first-of-type) h3 {
  min-height: 50px !important;
  font-size: 15px !important;
  line-height: 1.7 !important;
  font-weight: 800 !important;
}

.s-block--products:not(:first-of-type) .s-button-btn,
.s-block--products:not(:first-of-type) .add-to-cart,
.s-block--products:not(:first-of-type) button {
  margin-top: auto !important;
}


/* -----------------------------------------
   4) تحسين العناوين والمسافات
----------------------------------------- */

.s-block__title,
.s-block-title,
.section-title {
  margin-bottom: 24px !important;
}

.s-block__display-all,
.s-block__title a {
  color: #003f36 !important;
  font-weight: 800 !important;
}

.s-block__display-all:hover,
.s-block__title a:hover {
  color: #c59a42 !important;
}


/* -----------------------------------------
   5) Responsive
----------------------------------------- */

/* تابلت */
@media (max-width: 1023px) {
  .s-block--products:first-of-type .s-products-list-wrapper,
  .s-block--products:first-of-type .products-grid,
  .s-block--products:first-of-type .grid-products,
  .s-block--products:first-of-type .s-slider-block__items {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .s-block--products:first-of-type .s-product-card-entry:first-child,
  .s-block--products:first-of-type .product-card:first-child,
  .s-block--products:first-of-type .salla-product-card:first-child {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }

  .s-block--products:not(:first-of-type) .s-products-list-wrapper,
  .s-block--products:not(:first-of-type) .products-grid,
  .s-block--products:not(:first-of-type) .grid-products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .s-block--hero-slider,
  .hero-slider,
  .main-slider {
    min-height: 250px !important;
    max-height: 320px !important;
  }

  .s-block--hero-slider .swiper-slide,
  .hero-slider .swiper-slide,
  .main-slider .swiper-slide {
    min-height: 250px !important;
  }
}

/* جوال */
@media (max-width: 640px) {
  .s-block--products:first-of-type {
    padding: 16px !important;
    border-radius: 20px !important;
  }

  .s-block--products:first-of-type .s-products-list-wrapper,
  .s-block--products:first-of-type .products-grid,
  .s-block--products:first-of-type .grid-products,
  .s-block--products:first-of-type .s-slider-block__items,
  .s-block--products:not(:first-of-type) .s-products-list-wrapper,
  .s-block--products:not(:first-of-type) .products-grid,
  .s-block--products:not(:first-of-type) .grid-products {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .s-block--products:first-of-type .s-product-card-entry:first-child,
  .s-block--products:first-of-type .product-card:first-child,
  .s-block--products:first-of-type .salla-product-card:first-child {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .s-block--hero-slider,
  .hero-slider,
  .main-slider {
    min-height: 220px !important;
    max-height: 280px !important;
    border-radius: 20px !important;
  }

  .s-block--hero-slider .swiper-slide,
  .hero-slider .swiper-slide,
  .main-slider .swiper-slide {
    min-height: 220px !important;
    padding: 16px !important;
  }

  .s-block--hero-slider h1,
  .s-block--hero-slider h2,
  .hero-slider h1,
  .hero-slider h2,
  .main-slider h1,
  .main-slider h2 {
    font-size: 28px !important;
  }
}