/* =========================================================
   قسم Best Selling
   تنسيق مستقل حتى لا يتأثر هذا القسم بكروت المنتجات العامة
   ========================================================= */

.best-selling-featured-section {
  position: relative;
}

.best-selling-featured-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 258px;
  gap: 20px;
  padding: 30px 30px 28px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.06);
}

.best-selling-featured-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.best-selling-featured-title {
  display: block;
  width: 100%;
  margin: 0 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  text-align: left;
  align-self: flex-start;
}

/* كارتات قسم Best Selling */
.best-selling-featured-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.best-selling-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  aspect-ratio: 1 / 1.06;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  padding: 10px;
}

.best-selling-card__media {
  display: block;
  padding: 0;
  flex: 0 0 75%;
  min-height: 0;
  text-decoration: none;
}

.best-selling-card__image-panel {
  position: relative;
  border-radius: 12px;
  padding: 0;
  height: 100%;
  min-height: 0;
  background: #ffffff;
  border: 0;
  box-shadow: none;
}

.best-selling-card__image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
}

.best-selling-card__image {
  width: 100%;
  height: 85%;
  max-height: 85%;
  object-fit: contain;
  display: block;
}

.best-selling-card__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 0 0 auto;
  padding: 6px 4px 0;
  align-items: center;
  text-align: center;
}

.best-selling-card__title {
  color: #2b313c;
  text-decoration: none;
  font-size: 0.76rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.35em;
}

.best-selling-card__short {
  display: none;
}

.best-selling-card__prices {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 0 0 auto;
  padding: 3px 2px 0;
}

.best-selling-card__price-now {
  color: #c53030;
  font-size: 0.81rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.best-selling-card__price-old {
  color: rgba(107, 114, 128, 0.82);
  font-size: 0.74rem;
  line-height: 1.1;
  text-decoration: line-through;
  text-decoration-thickness: 1.4px;
}

.best-selling-card__footer {
  display: none;
}

/* زر إضافة للسلة داخل قسم Best Selling */
.best-selling-card__actions {
  display: none;
}

.best-selling-card__actions .ik-buybox {
  display: flex !important;
  justify-content: center;
  --ik-card-buybox-width: 132px;
  width: var(--ik-card-buybox-width) !important;
  min-width: var(--ik-card-buybox-width) !important;
}

.best-selling-card__actions .ik-add-to-cart-btn,
.best-selling-card__actions .ik-buybox-pill {
  width: 100% !important;
  min-width: 100% !important;
  background: #fff !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}

.best-selling-card__actions .ik-add-to-cart-btn {
  min-height: 36px !important;
  padding: 0 16px !important;
  border: 1px solid rgba(229, 94, 94, 0.7) !important;
  color: #2b313c !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
}

.best-selling-card__actions .ik-buybox-pill {
  min-height: 36px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.best-selling-card__actions .ik-buybox-btn,
.best-selling-card__actions .ik-buybox-value {
  min-width: 36px !important;
  height: 36px !important;
}

.best-selling-card__actions .ik-buybox-btn {
  font-size: 1.18rem !important;
}

.best-selling-card__actions .ik-buybox-value {
  width: auto !important;
  min-width: 28px !important;
  font-size: 0.96rem !important;
  font-weight: 800 !important;
}

/* عرض جانبي خاص بقسم Best Selling */
.best-selling-featured-aside {
  min-width: 0;
  padding-left: 18px;
}

.best-selling-offer-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.best-selling-offer-card__head {
  padding: 6px 12px 18px;
  text-align: center;
}

.best-selling-offer-card__title {
  color: #111827;
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.35;
}

.best-selling-offer-card__subtitle {
  margin-top: 6px;
  color: rgba(100, 116, 139, 0.95);
  font-size: 0.9rem;
}

.best-selling-offer-card__image {
  width: 100%;
  height: 560px;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  padding: 14px;
}

.best-selling-offer-card__footer {
  padding: 0 14px 14px;
}

.best-selling-offer-card__footer .btn {
  min-height: 42px;
  border-radius: 999px;
}

@media (max-width: 1200px) {
  .best-selling-featured-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 992px) {
  .best-selling-featured-shell {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .best-selling-offer-card__image {
    height: 360px;
  }

  .best-selling-featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 575.98px) {
  .best-selling-featured-shell {
    padding: 16px 10px 16px;
    gap: 14px;
    border-radius: 24px;
  }

  .best-selling-featured-title {
    margin-bottom: 0;
    padding-bottom: 16px;
  }

  .best-selling-featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .best-selling-card {
    border-radius: 14px;
    padding: 8px;
  }

  .best-selling-card__media {
    padding: 0;
  }

  .best-selling-card__image-panel {
    border-radius: 8px;
    min-height: 0;
  }

  .best-selling-card__image-wrap {
    min-height: 0;
  }

  .best-selling-card__image {
    height: 84%;
    max-height: 84%;
  }

  .best-selling-card__body {
    padding: 5px 3px 0;
  }

  .best-selling-card__title {
    font-size: 0.67rem;
    line-height: 1.22;
    font-weight: 600;
    min-height: 1.24em;
  }

  .best-selling-card__prices {
    gap: 4px;
    padding: 3px 3px 0;
  }

  .best-selling-card__footer {
    margin-top: 12px;
    padding: 0;
  }

  .best-selling-card__price-now {
    font-size: 0.85rem;
    font-weight: 700;
  }

  .best-selling-card__price-old {
    font-size: 0.72rem;
  }

  .best-selling-card__actions .ik-add-to-cart-btn,
  .best-selling-card__actions .ik-buybox-pill {
    min-width: 104px !important;
    min-height: 34px !important;
  }

  .best-selling-card__actions .ik-buybox-btn,
  .best-selling-card__actions .ik-buybox-value {
    min-width: 34px !important;
    height: 34px !important;
  }

  .best-selling-offer-card__image {
    height: 260px;
  }
}


/* =========================================================
   PATCH v20 - precise mobile offer card repair
   ========================================================= */
@media (max-width: 575.98px) {
  .best-selling-featured-section .best-selling-featured-shell {
    padding: 16px 10px 16px !important;
    gap: 12px !important;
  }

  .best-selling-featured-section .best-selling-featured-title {
    margin-bottom: 10px !important;
    padding-bottom: 12px !important;
  }

  .best-selling-featured-section .best-selling-featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .best-selling-featured-section .best-selling-card {
    border-radius: 16px !important;
    padding: 8px !important;
  }

  .best-selling-featured-section .best-selling-card__image-panel {
    border-radius: 12px !important;
  }

  .best-selling-featured-section .best-selling-card__image {
    height: 132px !important;
    max-height: 132px !important;
  }

  .best-selling-featured-section .best-selling-card__title {
    font-size: 0.76rem !important;
    line-height: 1.26 !important;
    font-weight: 600 !important;
    min-height: 2.15em !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
  }

  .best-selling-featured-section .best-selling-card__price-now {
    font-size: 0.88rem !important;
    font-weight: 800 !important;
  }

  .best-selling-featured-section .best-selling-featured-aside {
    padding-left: 0 !important;
  }

  .best-selling-featured-section .best-selling-offer-card {
    min-height: 468px !important;
    border-radius: 20px !important;
  }

  .best-selling-featured-section .best-selling-offer-card__head {
    padding: 0 !important;
    min-height: 0 !important;
  }

  .best-selling-featured-section .best-selling-offer-card__title,
  .best-selling-featured-section .best-selling-offer-card__subtitle {
    display: none !important;
  }

  .best-selling-featured-section .best-selling-offer-card__image {
    display: block !important;
    width: 100% !important;
    height: 312px !important;
    min-height: 312px !important;
    object-fit: cover !important;
    object-position: center center !important;
    padding: 12px !important;
    border-radius: 18px !important;
  }

  .best-selling-featured-section .best-selling-offer-card__footer {
    margin-top: auto !important;
    padding: 0 12px 12px !important;
  }

  .best-selling-featured-section .best-selling-offer-card__footer .btn {
    min-height: 42px !important;
    border-radius: 18px !important;
    color: #111827 !important;
    border-color: rgba(229, 57, 53, 0.42) !important;
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.94) 100%) !important;
    box-shadow: 0 0 0 1px rgba(229, 57, 53, 0.04), 0 7px 18px rgba(229, 57, 53, 0.10) !important;
    font-weight: 700 !important;
  }
}
