/* Top Deals Catalog & Deal Cards Styling */

.deals-page-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}
.deals-hero {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
}
.deals-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.deals-hero-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  margin: 0;
}
.deals-nav-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  padding: 4px 6px;
}
.deals-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  padding: 4px 10px;
  border-radius: 9999px;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.deals-nav-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}
.deals-nav-btn.is-active {
  background-color: #0f766e;
  color: #ffffff;
  font-weight: 700;
}
.deals-nav-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.deals-explanation {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 0.85rem 0;
  max-width: 900px;
}
.deals-generation-meta {
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.deals-generation-meta .live-indicator {
  display: inline-block;
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
}
.deals-generation-meta .live-indicator.is-pending {
  background-color: #f59e0b;
}

.deals-empty-state {
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
  background: #ffffff;
  margin-top: 1rem;
}

/* 3 Tabbed Sections (4 cards each in 2x2 grid + See More footer) */
.shelf-section {
  margin-bottom: 3rem;
  position: relative;
}
.shelf-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.shelf-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.shelf-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}
.shelf-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
}
.deals-tabs-bar {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 2px solid #cbd5e1;
  margin-bottom: 1.1rem;
  scrollbar-width: none;
}
.deals-tabs-bar::-webkit-scrollbar {
  display: none;
}
.deals-tab-btn {
  position: relative;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px 8px 0 0;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.deals-tab-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.deals-tab-btn.is-active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  border-color: #93c5fd;
  border-bottom: 3px solid #2563eb;
  box-shadow: 0 -2px 6px rgba(37, 99, 235, 0.08);
}
.deals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.deals-more-container {
  margin-top: 14px;
}
.deals-toggle-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.deals-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  padding: 8px 22px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}
.deals-toggle-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.deals-toggle-btn.is-expanded {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.shelf-footer {
  margin-top: 0.9rem;
  display: flex;
  justify-content: flex-end;
}
.shelf-see-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 7px 14px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.shelf-see-more-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

@media (max-width: 960px) {
  .deals-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .deals-hero-header { flex-direction: column; }
  .deals-nav-bar { width: 100%; justify-content: space-between; }
  .shelf-header { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .shelf-footer { justify-content: stretch; }
  .shelf-see-more-btn { width: 100%; justify-content: center; }
}
.deal-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  min-height: 165px;
}
.deal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}
.deal-card-media {
  position: relative;
  width: 230px;
  min-width: 230px;
  background: #f1f5f9;
  overflow: hidden;
  user-select: none;
}
.deal-card-media-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}
.deal-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.deal-card-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 4;
  pointer-events: none;
}
.deal-card-fav-wrap {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
}
.deal-card-fav-wrap .favorite-toggle-btn i {
  font-size: 0.8rem;
}
.deal-card-placeholder {
  width: 100%;
  height: 100%;
}
.deal-card-body {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 5px;
}
.deal-top-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.2;
}
.deal-price-current {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}
.deal-price-current .price-unit {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}
.deal-inline-sep {
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.85rem;
}
.deal-sqm-pill {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}
.deal-card-discount {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}
.deal-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
  margin: 1px 0 0;
}
.deal-card-title a {
  color: inherit;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.deal-card-title a:hover {
  color: #2563eb;
}
.deal-location-row {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deal-specs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.74rem;
  color: #475569;
}
.deal-spec-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 1px 6px;
  border-radius: 50px;
  font-weight: 600;
}
.deal-badges-wrap {
  margin-top: auto;
  padding-top: 2px;
}
.deal-badges-wrap .tags {
  margin-bottom: 0 !important;
  gap: 4px;
}
.deal-badges-wrap .tag {
  margin-bottom: 0 !important;
}
@media (max-width: 600px) {
  .deal-card {
    flex-direction: column;
  }
  .deal-card-media {
    width: 100%;
    min-width: 100%;
    height: 180px;
  }
}
