/* =============================================
   DealsBazaar - Main Stylesheet
   CouponDunia-inspired Design
   ============================================= */

:root {
  --primary: #e53935;
  --primary-dark: #b71c1c;
  --primary-light: #ffebee;
  --secondary: #ff6f00;
  --dark: #1a1a2e;
  --gray-100: #f8f9fa;
  --gray-200: #f0f0f0;
  --text-muted: #6c757d;
  --border: #e0e0e0;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f5f5;
  color: #333;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ---- Topbar ---- */
.topbar {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  font-size: 12px;
}

/* ---- Header ---- */
.site-header {
  background: #fff;
  border-bottom: 3px solid var(--primary);
  z-index: 1000;
}

.logo-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  background: var(--primary);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.logo-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.search-input {
  border-radius: 25px 0 0 25px !important;
  border: 2px solid var(--primary);
  border-right: none;
  padding: 10px 20px;
  font-size: 14px;
  height: 44px;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: none;
}

.search-btn {
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--primary);
  border-radius: 0 25px 25px 0;
  padding: 0 20px;
  height: 44px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-btn:hover { background: var(--primary-dark); }

.navbar-nav .nav-link {
  color: #333 !important;
  font-weight: 500;
  padding: 6px 12px !important;
  border-radius: 6px;
  transition: all 0.2s;
}

.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
  background: var(--primary-light);
  color: var(--primary) !important;
}

/* ---- Category Bar ---- */
.category-bar { overflow: hidden; }

.category-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-scroll::-webkit-scrollbar { display: none; }

.category-pill {
  white-space: nowrap;
  padding: 5px 14px;
  border-radius: 20px;
  background: #f0f0f0;
  color: #555;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.category-pill:hover, .category-pill.active {
  background: var(--primary);
  color: #fff;
}

/* ---- Hero Banner ---- */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, #ff5722 100%);
  color: #fff;
  padding: 40px 0;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.hero-stats {
  display: flex;
  gap: 30px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
  background: rgba(255,255,255,0.15);
  padding: 12px 20px;
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.hero-stat .number {
  font-size: 24px;
  font-weight: 800;
  display: block;
}

.hero-search-big {
  max-width: 600px;
  margin: 20px auto 0;
}

.hero-search-big .form-control {
  height: 52px;
  border-radius: 12px 0 0 12px;
  border: none;
  font-size: 15px;
  padding-left: 20px;
}

.hero-search-big .btn {
  height: 52px;
  border-radius: 0 12px 12px 0;
  padding: 0 24px;
}

/* ---- Section Titles ---- */
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title .title-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .title-bar::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--primary);
  border-radius: 2px;
}

.section-title .view-all {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  border: 1px solid var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  transition: all 0.2s;
}

.section-title .view-all:hover {
  background: var(--primary);
  color: #fff;
}

/* ---- Coupon Card ---- */
.coupon-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.25s ease;
  position: relative;
  height: 100%;
}

.coupon-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--primary);
}

.coupon-card .store-logo-wrap {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fafafa;
}

.coupon-card .store-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 4px;
}

.coupon-card .store-logo-placeholder {
  width: 50px;
  height: 50px;
  background: var(--primary-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
}

.coupon-card .store-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.coupon-card .card-body-custom {
  padding: 14px;
}

.coupon-card .coupon-title {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.coupon-card .coupon-discount {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}

.coupon-card .coupon-expiry {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.coupon-card .expiring-soon { color: #ff6f00; font-weight: 600; }

.badge-verified {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-exclusive {
  background: #fce4ec;
  color: var(--primary);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-type {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

.btn-get-coupon {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-get-coupon:hover { background: var(--primary-dark); transform: scale(1.01); }

/* Deal type card - darker */
.coupon-card.deal-card .btn-get-coupon {
  background: var(--secondary);
}
.coupon-card.deal-card .btn-get-coupon:hover { background: #e65100; }

/* ---- Featured Stores ---- */
.store-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  transition: all 0.25s;
  cursor: pointer;
}

.store-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--primary);
}

.store-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 6px;
  margin-bottom: 10px;
}

.store-card .store-card-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.store-card .store-offer-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- Category Cards ---- */
.category-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  transition: all 0.25s;
  display: block;
  color: #333;
}

.category-card:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.category-card .cat-icon {
  font-size: 30px;
  margin-bottom: 10px;
  display: block;
}

.category-card .cat-name {
  font-size: 13px;
  font-weight: 600;
}

/* ---- Blog Cards ---- */
.blog-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.25s;
}

.blog-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.blog-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.blog-card .blog-body { padding: 16px; }

.blog-card .blog-title {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.blog-card .blog-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Coupon Code Modal ---- */
.coupon-code-box {
  border: 2px dashed var(--primary);
  border-radius: 10px;
  padding: 14px;
  background: #fff8f8;
}

.coupon-code-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.coupon-code-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 3px;
  font-family: monospace;
}

.btn-copy-code {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  letter-spacing: 1px;
}

.btn-copy-code:hover { background: var(--primary-dark); }

/* ---- Tabs ---- */
.nav-tabs .nav-link {
  color: #666;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
  border-radius: 0;
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: none;
}

.nav-tabs { border-bottom: 2px solid var(--border); }

/* ---- Ad Spaces ---- */
.ad-space { text-align: center; margin: 10px 0; }

/* ---- Pagination ---- */
.page-link {
  color: var(--primary);
  border-radius: 8px !important;
  margin: 0 2px;
}

.page-link:hover, .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--dark);
  color: #aaa;
}

.footer-top { border-bottom: 1px solid rgba(255,255,255,0.08); }

.footer-logo-text {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.footer-heading {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.footer-links li { margin-bottom: 7px; }

.footer-links a {
  color: #aaa;
  font-size: 13px;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--primary); padding-left: 3px; }

.footer-bottom {
  background: rgba(0,0,0,0.2);
}

.social-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  transition: transform 0.2s;
}

.social-btn:hover { transform: scale(1.15); color: #fff; }
.social-btn.facebook { background: #1877f2; }
.social-btn.twitter { background: #000; }
.social-btn.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-btn.youtube { background: #ff0000; }
.social-btn.telegram { background: #0088cc; }

/* ---- Sidebar ---- */
.sidebar-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 20px;
}

.sidebar-card .sidebar-card-header {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
}

.sidebar-card .sidebar-card-body { padding: 16px; }

/* ---- Sticky Sidebar ---- */
.sticky-sidebar { position: sticky; top: 80px; }

/* ---- Hot deals ribbon ---- */
.coupon-card .ribbon {
  position: absolute;
  top: 10px;
  right: -5px;
  background: var(--secondary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 3px 0 0 3px;
  letter-spacing: 0.5px;
}

.coupon-card .ribbon::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -5px;
  border-left: 5px solid #e65100;
  border-bottom: 5px solid transparent;
}

/* ---- Loading Spinner ---- */
.loading-spinner {
  text-align: center;
  padding: 40px;
}

/* ---- Breadcrumb ---- */
.breadcrumb-section {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.breadcrumb { margin: 0; font-size: 13px; }
.breadcrumb-item a { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-muted); }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 60px;
  color: #ddd;
  margin-bottom: 16px;
}

/* ---- Filter Bar ---- */
.filter-bar {
  background: #fff;
  padding: 15px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  color: #555;
}

.filter-pill:hover, .filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
  .hero-section { padding: 25px 0; }
  .hero-stats { gap: 10px; }
  .section-title { font-size: 17px; }
  .coupon-card .coupon-discount { font-size: 16px; }
  .logo-name { font-size: 19px; }
}

@media (min-width: 1200px) {
  .container { max-width: 1200px; }
}

/* Retina / HiDPI */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .store-logo, .blog-card img, .store-card img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.coupon-card { animation: fadeInUp 0.3s ease forwards; }

/* ---- Utilities ---- */
.bg-primary-light { background: var(--primary-light) !important; }
.text-primary { color: var(--primary) !important; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.fw-500 { font-weight: 500; }
