/* ===================================================
   Trending Deals Section – Deals4all.ai Design v2
   =================================================== */

#trending-deals-section {
  font-family: 'Inter', Arial, sans-serif;
  background: #fff;
  padding: 28px 24px;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  border: 1px solid #E2E8F0;
  max-width: 100%;
}

#trending-deals-section .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

#trending-deals-section .header h2 {
  margin: 0;
  font-size: 1.35em;
  font-weight: 800;
  color: #1E293B;
  letter-spacing: -0.01em;
}

#trending-deals-section .subtitle {
  color: #64748B;
  font-size: 0.93em;
  margin-top: 3px;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-actions button {
  color: #1E293B;
  background: #F1F5F9;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-weight: 600;
  font-size: 0.9em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.header-actions #btn-viewall {
  background: #F97316;
  color: #fff;
}

.header-actions #btn-viewall:hover {
  background: #EA6C0A;
}

.header-actions #btn-filter:hover {
  background: #E2E8F0;
}

/* ---- Category Button Carousel ---- */
.category-btn-carousel-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 20px;
  position: relative;
}

.category-btn-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  align-items: center;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1 1 auto;
  padding-bottom: 2px;
}

.category-btn-row::-webkit-scrollbar { display: none; }

.category-btn {
  border: 1.5px solid #E2E8F0;
  background: #fff;
  color: #1E293B;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.88em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  outline: none;
  white-space: nowrap;
  flex: 0 0 auto;
}

.category-btn.active,
.category-btn:hover,
.category-btn:focus {
  background: #F97316;
  color: #fff;
  border-color: #F97316;
}

.cat-scroll-btn {
  background: #F1F5F9;
  color: #64748B;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.1em;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 2px;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  z-index: 3;
  outline: none;
  user-select: none;
  flex: 0 0 auto;
}

.cat-scroll-btn:disabled { opacity: 0.35; cursor: default; }

.cat-scroll-btn:hover:not(:disabled) {
  background: #F97316;
  color: #fff;
}

/* ---- Category Dropdown (filter) ---- */
#filter-row {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.93em;
}

.category-label {
  font-weight: 600;
  color: #1E293B;
}

.category-select {
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  padding: 7px 32px 7px 12px;
  font-size: 0.93em;
  min-width: 150px;
  background: #fff url('data:image/svg+xml;utf8,<svg width="19" height="10" viewBox="0 0 19 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 2L9.5 8L17 2" stroke="%2364748B" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat right 10px center / 16px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  color: #1E293B;
  transition: border-color 0.15s;
}

.category-select:focus { border-color: #F97316; }

/* ---- Deals Grid ---- */
.deals-grid {
  display: grid;
  grid-gap: 20px;
  margin-bottom: 24px;
  min-height: 280px;
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1400px) { .deals-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1100px) { .deals-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 780px)  { .deals-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .deals-grid { grid-template-columns: 1fr; } }

/* ---- Deal Card ---- */
.deal-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  border: 1px solid #E2E8F0;
  padding: 14px 14px 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  box-sizing: border-box;
  transition: box-shadow 0.2s, transform 0.18s;
  min-height: 400px;
}

.deal-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.11);
  transform: translateY(-3px);
}

.deal-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 50px;
  background: #10B981;
  color: #fff;
  font-weight: 700;
  font-size: 0.82em;
  z-index: 2;
  letter-spacing: 0.2px;
}

.deal-badge.yellow { background: #F59E0B; color: #fff; }
.deal-badge.red    { background: #EF4444; color: #fff; }
.deal-badge.blue   { background: #3B82F6; color: #fff; }
.deal-badge.far        { background: #64748B; color: #fff; }
.deal-badge.good       { background: #10B981; color: #fff; }
.deal-badge.great      { background: #F97316; color: #fff; }
.deal-badge.amazing    { background: #8B5CF6; color: #fff; }
.deal-badge.doorbuster { background: #EF4444; color: #fff; }

.deal-fav {
  position: absolute;
  top: 12px;
  right: 12px;
  cursor: pointer;
  font-size: 1.3em;
  color: #CBD5E1;
  transition: color 0.15s;
}

.deal-fav:hover { color: #EF4444; }

.deal-img-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  position: relative;
  flex: 0 0 auto;
  background: #F8FAFC;
  border-radius: 10px;
  min-height: 160px;
  padding: 10px 0;
}

.deal-card img {
  max-height: 200px;
  min-height: 120px;
  max-width: 95%;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
}

.deal-eye {
  cursor: pointer;
  font-size: 1.2em;
  color: #94A3B8;
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 50%;
  padding: 5px 7px 3px;
  transition: background 0.15s, color 0.15s;
  z-index: 1;
  border: 1px solid #E2E8F0;
  line-height: 1;
}

.deal-eye:hover, .deal-eye:focus {
  color: #F97316;
  background: #FFF7ED;
  outline: none;
}

.deal-tags {
  margin: 20px 0 6px;
  min-height: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.deal-tag {
  display: inline-block;
  padding: 2px 9px;
  font-size: 0.78em;
  border-radius: 50px;
  background: #EFF6FF;
  color: #3B82F6;
  font-weight: 600;
}

.deal-tag.purple { background: #F3F0FF; color: #7C3AED; }
.deal-tag.yellow { background: #FFFBEB; color: #D97706; }
.deal-tag.orange { background: #FFF7ED; color: #EA580C; }
.deal-tag.green  { background: #ECFDF5; color: #059669; }
.deal-tag.pink   { background: #FFF1F2; color: #E11D48; }
.deal-tag.blue   { background: #EFF6FF; color: #2563EB; }

.deal-title {
  font-weight: 700;
  font-size: 0.97em;
  margin-bottom: 4px;
  color: #1E293B;
  line-height: 1.35;
}

.deal-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 1.3em;
  font-weight: 800;
  color: #F97316;
  margin-bottom: 3px;
}

.deal-oldprice {
  text-decoration: line-through;
  font-size: 0.7em;
  color: #94A3B8;
  font-weight: 400;
}

.deal-rating {
  color: #F59E0B;
  font-size: 0.92em;
  margin-bottom: 4px;
}

.deal-rating .reviews {
  color: #94A3B8;
  font-size: 0.88em;
  margin-left: 4px;
}

.deal-desc {
  color: #64748B;
  font-size: 0.88em;
  margin-bottom: 12px;
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s, margin 0.2s, opacity 0.23s;
}

.deal-desc.active {
  max-height: 100px;
  margin-top: 8px;
  opacity: 1;
}

.deal-card .deal-btn {
  background: #0F172A;
  color: #fff;
  border-radius: 8px;
  border: none;
  padding: 10px 0;
  width: 100%;
  font-size: 0.92em;
  font-weight: 700;
  cursor: pointer;
  margin-top: auto;
  margin-bottom: 16px;
  transition: background 0.15s;
}

.deal-card .deal-btn:hover { background: #1E293B; }

/* ---- Load More button ---- */
#trending-deals-section .actions { text-align: center; margin-top: 8px; }

#btn-loadmore {
  background: #F1F5F9;
  color: #1E293B;
  padding: 11px 36px;
  font-size: 0.93em;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

#btn-loadmore:hover { background: #E2E8F0; }

/* Mobile adjustments */
@media (max-width: 600px) {
  #trending-deals-section { padding: 18px 12px; }
  .category-btn { font-size: 0.82em; padding: 5px 12px; }
  .cat-scroll-btn { width: 28px; height: 28px; font-size: 1em; }
}
