/*
==============================================
      HOME PAGE PRODUCT SECTIONS
==============================================
*/

.product-section {
  padding: 4rem 0;
  position: relative;
}

/* Section Header Styling */
.section-header {
  margin-bottom: 3.5rem;
  text-align: center;
}

.section-header h2 {
  font-family: 'Cairo', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
  padding-bottom: 0.75rem;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 3px;
  background-color: var(--primary-blue, #ff6ae0);
  border-radius: 2px;
}

.section-header p {
  font-size: 1.1rem;
  color: #6c757d;
  max-width: 600px;
  margin: 0.5rem auto 0;
  line-height: 1.5;
}

/* Product Card Enhancements */
.product-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.product-card {
  border: 1px solid #f0f0f0;
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: #fff;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card.clickable-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.08);
}

/* Card Image */
.product-card .card-img-container {
  overflow: hidden;
  position: relative;
  background-color: #f8f9fa;
}

.product-card .card-img-top {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card.clickable-card:hover .card-img-top {
  transform: scale(1.07);
}

/* Badges (Discount & Limited) */
.discount-ribbon,
.limited-quantity {
  position: absolute;
  top: 15px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  z-index: 3;
  border-radius: 6px;
  text-align: center;
  line-height: 1.5;
}

.discount-ribbon {
  left: 15px;
  background: linear-gradient(135deg, var(--primary-blue),var(--primary-blue-dark));
}

.limited-quantity {
  right: 15px;
  background-color: #1a1a1a;
  color: var(--primary-blue);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Card Body */
.product-card .card-body {
  padding: 1.25rem;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-grow: 1;
}

.product-card .card-title {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: 'Cairo', sans-serif;
  color: #343a40;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.3px;
}

/* Price styling */
.price-container {
  margin-top: auto;
  padding-top: 1rem;
}

.price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-blue, #ff6ae0);
}

.original-price {
  font-size: 0.95rem;
  color: #6c757d;
  text-decoration: line-through;
  margin-right: 0.5rem;
}

.savings-info {
  font-size: 0.85rem;
  font-weight: 500;
  color: #198754;
  display: block;
  margin-top: 0.25rem;
}

/* Action Section (Button & Stock) */
.product-card .action-section {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-card-button {
  background-color: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 8px;
  transition: all 0.3s ease;
  padding: 12px;
  width: 100%;
  margin-bottom: 0.75rem;
}

.product-card.clickable-card .product-card-button:hover {
  background-color: var(--primary-blue);
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  color: #fff;
}

.stock-status {
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

.in-stock-status {
  color: #198754;
}

.out-of-stock-status {
  color: #dc3545;
}

/* Out of Stock Styling */
.out-of-stock-card {
  position: relative;
}

.out-of-stock-card .card-img-container::after {
  content: 'نفذ المخزون';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  z-index: 2;
  backdrop-filter: grayscale(0.5);
}

.out-of-stock-card .card-body,
.out-of-stock-card .discount-ribbon,
.out-of-stock-card .limited-quantity {
  opacity: 0.7;
}

.out-of-stock-card .btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
}

/* Responsive Adjustments */

@media (max-width: 767.98px) {
  /* Stack badges vertically on small screens if both exist */
  .product-card .limited-quantity {
    top: 10px;
    right: 10px;
    font-size: 0.7rem; /* Slightly smaller font */
    padding: 5px 10px;
  }

  .product-card .discount-ribbon {
    top: 52px; /* Position below the limited quantity badge */
    right: 10px;
    left: auto; /* Override the default left positioning */
    border-radius: 20px; /* Symmetrical radius */
    width: fit-content;
    font-size: 0.7rem;
    padding: 5px 10px;
  }
}

@media (max-width: 991.98px) {
  .section-header h2 {
    font-size: 2.2rem;
  }
  .product-section {
    padding: 3rem 0;
  }
}

@media (max-width: 767.98px) {
  .section-header h2 {
    font-size: 2rem;
  }
  .section-header p {
    font-size: 1rem;
  }
}

@media (max-width: 575.98px) {
  .product-card .card-title {
    font-size: 0.95rem;
  }
  .price {
    font-size: 1.2rem;
  }
  .product-card-button {
    font-size: 0.9rem;
    padding: 10px;
  }
  .discount-ribbon, .limited-quantity {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
}
