:root {
  /* Nepal flag inspired theme */
  --primary: #DC143C;        /* Crimson red */
  --primary-dark: #B01030;   /* Darker crimson */
  --secondary: #003893;      /* Nepal blue */
  --dark: #001F5B;           /* Deep navy blue */
  --gray: #5a6a7a;
  --light: #f5f7fa;
  --border: #dde3ea;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 31, 91, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--dark);
  background: #fff;
  line-height: 1.5;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

a { text-decoration: none; color: inherit; }

/* Top Bar */
.top-bar {
  background: var(--dark);
  color: #cbd5e1;
  font-size: 13px;
  padding: 8px 0;
}
.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.top-links { display: flex; gap: 18px; }
.top-links a:hover { color: var(--primary); }

/* Header */
.header {
  background: #fff;
  border-bottom: 3px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0, 31, 91, 0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.logo-icon { font-size: 30px; }
.logo-text strong { font-size: 20px; font-weight: 800; }
.logo-text span { color: var(--primary); font-weight: 800; font-size: 20px; }
.logo-text small { display: inline; font-size: 13px; color: var(--gray); font-weight: 600; margin-left: 0; }

.search-box {
  margin-left: auto;
  flex: 0 1 480px;
  display: flex;
  min-width: 0;
}
.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  min-width: 0;
}
.search-box input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 11px 40px 11px 14px;
  border: 2px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-size: 15px;
  outline: none;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}
.search-box input:focus { border-color: var(--primary); }
.search-box input::placeholder {
  color: #94a3b8;
  opacity: 1;
}
.clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: none;
  background: #e2e8f0;
  color: #64748b;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: background 0.15s, color 0.15s;
}
.clear-btn:hover {
  background: #cbd5e1;
  color: #1a1a2e;
}
.clear-btn.visible {
  display: flex;
}
.search-box #searchBtn {
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0 18px;
  border-radius: 0 8px 8px 0;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.search-box #searchBtn:hover { background: var(--primary-dark); }

.btn-add {
  background: #fff;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.btn-add:hover { background: var(--primary); color: #fff; }

/* Advertisement slots */
.ad-slot {
  padding: 12px 0;
  background: #f1f5f9;
}
.ad-slot-top {
  border-bottom: 1px solid var(--border);
}
.ad-slot-mid {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ad-slot-bottom {
  border-top: 1px solid var(--border);
  background: #eef2f7;
}
.ad-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 6px;
  text-align: center;
}
.ad-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 90px;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.2s, background 0.2s;
}
.ad-banner:hover {
  border-color: var(--primary);
  background: #fff8f9;
}
.ad-banner-wide {
  max-width: 100%;
}
.ad-content {
  text-align: center;
  padding: 16px 20px;
}
.ad-content strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}
.ad-content span {
  display: block;
  font-size: 13px;
  color: var(--gray);
}
.ad-banner-promo {
  border-style: solid;
  border-color: #f5b0bc;
  background: linear-gradient(135deg, #fff5f7 0%, #fff 50%, #eef4ff 100%);
}
.ad-banner-promo:hover {
  border-color: var(--primary);
  background: linear-gradient(135deg, #ffe8ed 0%, #fff 50%, #e4ecff 100%);
}
.ad-badge {
  display: inline-block !important;
  background: var(--primary);
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 14px !important;
  border-radius: 6px;
  margin-bottom: 10px;
  line-height: 1.2;
}
.ad-promo strong {
  font-size: 20px;
  color: var(--dark);
  margin-bottom: 6px;
}
.ad-promo span:not(.ad-badge):last-of-type {
  font-size: 14px;
  color: #475569;
}
.ad-banner-list {
  border-style: solid;
  border-color: #93c5fd;
  background: linear-gradient(135deg, #eff6ff 0%, #fff 55%, #f0fdf4 100%);
}
.ad-banner-list:hover {
  border-color: var(--secondary);
  background: linear-gradient(135deg, #dbeafe 0%, #fff 55%, #dcfce7 100%);
}
.ad-badge-blue {
  background: var(--secondary) !important;
  color: #ffffff !important;
}
.ad-list-promo strong {
  font-size: 18px;
}
.ad-list-promo span:not(.ad-badge) {
  font-size: 14px;
  color: #475569;
}
.ad-list-promo span b {
  color: var(--primary);
  font-weight: 800;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #fff0f3 0%, #e8eef8 50%, #dce6f5 100%);
  padding: 48px 0 40px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  margin-bottom: 12px;
}
.hero h1 span { color: var(--primary); }
.hero p {
  color: var(--gray);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto 28px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}
.stat {
  text-align: center;
}
.stat strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}
.stat span {
  font-size: 13px;
  color: var(--gray);
}

/* Categories */
.categories-section {
  padding: 40px 0 20px;
}
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.cat-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.cat-card:hover,
.cat-card.active {
  border-color: var(--primary);
  background: #fff0f3;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.cat-icon { font-size: 28px; margin-bottom: 6px; }
.cat-name { font-size: 13px; font-weight: 600; }
.cat-count { font-size: 11px; color: var(--gray); margin-top: 2px; }

/* Listings */
.listings-section {
  padding: 30px 0 50px;
}
.listings-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.listings-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.02em;
}
.result-info { color: var(--gray); font-size: 14px; margin-top: 4px; }

.filter-bar {
  display: flex;
  gap: 10px;
}
.filter-bar select {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  outline: none;
}
.filter-bar select:focus { border-color: var(--primary); }

.shops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
  gap: 16px;
}

.shop-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}
.shop-card:hover {
  border-color: #f5b0bc;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.shop-image {
  width: calc(100% + 36px);
  margin: -18px -18px 14px;
  border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--light);
}
.shop-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.shop-top {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
}
.shop-emoji {
  width: 52px;
  height: 52px;
  background: var(--light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.shop-meta h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}
.shop-category {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 4px;
}
.shop-pan {
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
  letter-spacing: 0.02em;
}
.shop-divider {
  height: 1px;
  background: var(--border);
  margin: 0 0 12px;
}
.shop-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.shop-detail-row {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
  align-items: flex-start;
  flex-wrap: nowrap;
  min-width: 0;
}
.shop-detail-row .label {
  flex: 0 0 78px;
  color: var(--gray);
  font-size: 12px;
  font-weight: 500;
}
.shop-detail-row .value {
  flex: 1;
  min-width: 0;
  color: var(--dark);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.shop-detail-row .value a {
  color: var(--secondary);
  overflow-wrap: anywhere;
}
.shop-detail-row .value a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.shop-desc {
  font-size: 13px;
  color: #475569;
  margin-bottom: 12px;
  flex: 1;
}
.shop-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}
.shop-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag {
  font-size: 11px;
  background: #f1f5f9;
  color: var(--gray);
  padding: 3px 8px;
  border-radius: 4px;
}
.map-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  background: #eef4ff;
  border: 1px solid #c7d7f5;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: all 0.15s;
}
.map-link:hover {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}
.shop-actions {
  margin-top: 12px;
}
.wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: #25d366;
  padding: 10px 14px;
  border-radius: 10px;
  white-space: nowrap;
  transition: all 0.15s;
}
.wa-btn:hover {
  background: #1eb958;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}
.wa-icon {
  width: 18px;
  height: 18px;
}
.wa-btn-disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  filter: none;
}
.wa-btn-disabled:hover {
  background: #cbd5e1;
  box-shadow: none;
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  padding: 8px 0 4px;
}
.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--dark);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--primary);
  color: var(--primary);
  background: #fff0f3;
}
.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-ellipsis {
  padding: 0 4px;
  color: var(--gray);
  font-weight: 600;
}

/* Empty */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; color: var(--dark); margin-bottom: 6px; }
.empty-state p { margin-bottom: 16px; }

.btn-primary {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); }

/* Areas */
.areas-section {
  background: var(--light);
  padding: 48px 0;
}
.areas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.area-card {
  background: #fff;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.area-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--primary);
}
.area-card p { font-size: 14px; color: var(--gray); }

/* Add Section */
.add-section {
  padding: 50px 0;
}
.add-box {
  background: linear-gradient(135deg, var(--dark) 0%, #2d3748 100%);
  color: #fff;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}
.add-box h2 { font-size: 24px; margin-bottom: 8px; }
.add-box p { color: #94a3b8; margin-bottom: 20px; }
.add-box .btn-primary { background: var(--primary); }

/* Footer */
.footer {
  background: var(--dark);
  color: #94a3b8;
  padding-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  padding-bottom: 36px;
}
.footer-col h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 14px;
}
.footer-col a, .footer-col p {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  color: #94a3b8;
}
.footer-col a:hover { color: var(--primary); }
.footer-wa a {
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-bottom {
  border-top: 1px solid #334155;
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  color: #64748b;
}

/* Responsive */
@media (max-width: 900px) {
  .shops-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
  }
  .logo {
    flex-shrink: 0;
  }
  .logo-icon { font-size: 26px; }
  .logo-text strong, .logo-text span { font-size: 17px; }
  .logo-text small { display: inline; font-size: 14px; margin-top: 0; }
  .search-box {
    order: 3;
    max-width: 100%;
    width: 100%;
    flex: 1 1 100%;
  }
  .search-input-wrap {
    flex: 1;
    min-width: 0;
  }
  .search-box input {
    font-size: 16px; /* prevents iOS zoom on focus */
    padding: 12px 40px 12px 14px;
  }
  .search-box input::placeholder {
    color: #64748b;
    opacity: 1;
  }
  .search-box #searchBtn {
    padding: 0 16px;
    height: auto;
  }
  .btn-add { display: none; }
  .top-links { display: none; }
  .hero-stats { gap: 24px; }
  .shops-grid { grid-template-columns: 1fr; }
  .listings-header {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar {
    width: 100%;
  }
  .filter-bar select { flex: 1; min-width: 0; }
  .shop-detail-row .label { flex: 0 0 70px; }
  .pagination { gap: 4px; }
  .page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .ad-banner { min-height: 70px; }
  .ad-content strong { font-size: 14px; }
  .ad-content span { font-size: 12px; }
  .ad-slot { padding: 10px 0; }
  .logo-text strong,
  .logo-text span { font-size: 17px; }
  .logo-icon { font-size: 24px; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cat-card { padding: 12px 8px; }
  .cat-name { font-size: 11px; }
  .filter-bar { width: 100%; flex-direction: column; }
  .filter-bar select { width: 100%; }
  .shop-card { padding: 14px; }
  .shop-detail-row {
    flex-direction: column;
    gap: 2px;
  }
  .shop-detail-row .label {
    flex: none;
    font-size: 11px;
  }
  .listings-header h2 { font-size: 20px; }
  .hero { padding: 32px 0 28px; }
  .page-btn { min-width: 34px; height: 34px; font-size: 12px; }
  .search-box #searchBtn {
    padding: 0 14px;
    font-size: 14px;
  }
}
