/* ==============================================
   16. Offers Page (Grid v2 - 5-Card Grid)
============================================== */

/* تنسيق محتوى المحرر (Editor Content) */
.page-editor-content {
    margin-bottom: 40px; 
    text-align: center;
}
.page-editor-content h1,
.page-editor-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-main);
    margin-bottom: 15px;
}

.products-section {
  padding: 2rem 0;
  background-color: #ffffff;
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  grid-auto-rows: 220px; /* ارتفاع الصف للموبايل */
}

.product-card {
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative; 
}

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

.card-content {
  padding: 1.5rem 2rem;
  text-align: center;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.4);
  height: 100%;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.card-title {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: bold;
}

.card-btn {
  background-color: var(--color-main); 
  color: #ffffff;
  padding: 0.5rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
  text-decoration: none;
  display: inline-block;
}

.card-btn:hover {
  background-color: #15803d; 
}

.card-gradient {
  background: linear-gradient(to bottom right, #15803d, #166534);
  padding: 1rem;
  color: #ffffff;
  text-align: center;
}

.card-gradient h2 {
  font-size: 1.875rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.card-gradient p {
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  line-height: 1.625;
}

.card-gradient button,
.card-gradient a.btn-link {
  border: 2px solid #ffffff;
  color: #ffffff;
  padding: 0.5rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto;
  transition: all 0.3s;
  text-decoration: none;
}

.card-gradient button:hover,
.card-gradient a.btn-link:hover {
  background-color: #ffffff;
  color: #166534;
}

.card-overlay {
  position: relative;
}

.overlay-content {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.6),
    transparent
  );
  display: flex;
  align-items: center;
  z-index: 2;
}

.overlay-text {
  padding: 1.5rem 2rem;
  color: #ffffff;
}

.overlay-text h2 {
  font-size: 1.875rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
}

.overlay-text p {
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.625;
  max-width: 20rem;
}

.overlay-text button,
.overlay-text a.btn-link {
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: gap 0.3s;
  text-decoration: none;
}

.overlay-text button:hover,
.overlay-text a.btn-link:hover {
  gap: 0.75rem;
}

/* --- Responsive ( هام جداً للشبكة ) --- */

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 220px;
  }
  .card-title {
    font-size: 2.25rem;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px;
  }
  
  /* تطبيق أحجام الكروت من تصميم Tailwind */
  .card-tall {
    grid-row: span 2;
    height: 100%;
  }
  .card-wide {
    grid-column: span 2;
  }
}