.section-title {
  margin: 1rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: var(--y-font-family);
  flex-wrap: wrap;
}

.section-title img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.section-title--divider {
  margin: 0.75rem 1rem;
  flex-wrap: nowrap;
}

.section-title--divider img {
  flex-shrink: 0;
  width: auto;
  height: 32px;
  max-width: 56px;
  object-fit: contain;
  display: block;
  vertical-align: middle;
}

.section-title::before,
.section-title::after {
  content: "";
  flex: 1;
  min-width: 60px;
  max-width: 300px;
  height: 1px;
  background: var(--y-color-text-dark, #333);
  border-radius: 1px;
}

.section-title--divider.section-title::before,
.section-title--divider.section-title::after {
  height: 1px;
  min-width: 40px;
  max-width: 280px;
  background: var(--y-color-text-dark, #2c2c2c);
}

[data-y="top-products-logo"] {
  overflow-x: clip;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  max-width: 100vw;
  margin-inline: calc(50% - 50vw);
  padding: 1rem 0;
  box-sizing: border-box;
}

[data-y="top-products-logo"] .section-title {
  margin: 0 auto;
  width: 100%;
  justify-content: center;
}

[data-y="top-products-logo"] .section-title--divider img {
  width: 80px;
  height: 80px;
  max-width: 80px;
}

/* خطوط يمين ويسار الصورة كما في التصميم المرجعي */
[data-y="top-products-logo"] .section-title--divider::before,
[data-y="top-products-logo"] .section-title--divider::after {
  content: "";
  flex: 1;
  min-width: 40px;
  max-width: 280px;
  height: 1px;
  background: #000;
  border-radius: 0;
  align-self: center;
}

.section {
  display: grid;
  grid-template-columns: 2fr 1.25fr;
  align-items: center;
  padding: 1rem 5%;
  margin-bottom: 4rem;
  gap: 2rem;
  box-sizing: border-box;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.img-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 1rem;
}

.img-container h1 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  text-align: center;
  font-weight: 700;
  color: var(--y-color-text-dark, #333);
  font-family: var(--y-font-alt);
  margin: 0;
}

.img-container img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
}

.section2 {
  grid-template-columns: 1.25fr 2fr;
}

.section2 .products {
  order: 2;
}

/* قسم العروض في الرئيسية: منع امتداد البطاقة عند وجود منتج واحد */
[data-y="offers-sec"] .section2 .products {
  justify-content: start;
}

[data-y="offers-sec"] .section2 .product-card {
  max-width: 280px;
  justify-self: start;
}

/* بانر بعرض كامل من أقصى اليمين إلى أقصى اليسار، بدون border-radius */
.banner {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 2rem;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.banner img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

main {
  margin: 0;
}

.design-img {
  max-width: 100%;
  height: auto;
  margin: 0;
  display: block;
}

.product-card-pricing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.product-card-price-new {
  font-weight: bold;
  font-size: 1.2rem;
}

.product-card-price-old {
  color: #999;
  text-decoration: line-through;
  font-size: 1rem;
}

.product-card {
  position: relative;
}

.product-card .offer-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--y-color-crimson);
  color: #fff;
  padding: 0.3rem 0.6rem 0.3rem 1rem;
  font-size: 0.8rem;
  border-radius: 0 16px 0 50px;
  font-weight: bold;
  z-index: 1;
}

@media (max-width: 820px) {
  .section {
    grid-template-columns: 1fr;
    justify-content: center;
    text-align: center;
    gap: 1.5rem;
    padding: 1rem 1rem 2rem;
    margin-bottom: 2rem;
  }

  .section.section2 {
    grid-template-columns: 1fr;
  }

  .section.section2 .products {
    order: 2;
  }

  .section-title::before,
  .section-title::after {
    min-width: 40px;
    max-width: 120px;
  }

  .section-title {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.5rem;
  }

  .section-title img {
    width: 60px;
    height: 60px;
  }

  .img-container {
    order: 1;
    margin: 0;
    border-radius: 0;
    width: 100%;
    padding: 0 0.5rem;
  }

  .img-container h1 {
    font-size: 1.5rem;
  }

  .img-container img {
    height: auto;
    border-radius: 8px;
    width: 100%;
  }

  .products {
    padding: 0 0.5rem;
    gap: 0.75rem;
    order: 2;
    grid-template-columns: repeat(2, 1fr);
  }

  .product-card-price-new {
    font-size: 1rem;
  }

  .product-card-price-old {
    font-size: 0.875rem;
  }

  .banner {
    padding: 0;
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 0.75rem 0.75rem 1.5rem;
  }

  .products {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .img-container h1 {
    font-size: 1.25rem;
  }
}

