/* ═══════════════════════════════════════════════════════════════════════════
   directory.css — Business Directory listing (Minimal/Clean redesign)
═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout ── */
.dir-content  { flex: 1; overflow-x: hidden; min-width: 0; }
.dir-header   { padding: var(--space-lg) var(--space-xl) 0; }
.dir-head-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-lg); }
.dir-head-right { display: flex; align-items: center; gap: var(--space-lg); flex-shrink: 0; }
.dir-title    { font-size: var(--text-3xl) !important; font-weight: 700 !important; color: var(--text-primary) !important; margin-bottom: 6px; }
.dir-subtitle { font-size: var(--text-sm) !important; color: var(--text-muted); }
.results-count        { font-size: var(--text-base) !important; color: var(--text-secondary); }
.results-count strong { color: var(--text-primary); font-weight: 700 !important; }

/* ── View toggle ── */
.view-toggle { display: flex; gap: 6px; }
.view-toggle-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-nav);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all 0.2s; cursor: pointer;
}
.view-toggle-btn:hover { border-color: var(--border-hover); color: var(--text-secondary); }
.view-toggle-btn.active { background: var(--primary); border-color: var(--primary); color: #fff !important; }
.view-toggle-btn svg    { width: 16px; height: 16px; }

/* ═══════════════════════════════════════════
   FILTER BAR
   FIX #1:  topbar search hidden on mobile
   FIX #2:  page-btn min-width so last page not narrow
   FIX #8:  search box wider (300px)
   FIX #10: dropdown arrow icon on all selects
═══════════════════════════════════════════ */
.filter-bar {
  display: flex; align-items: flex-end; gap: var(--space-lg);
  padding: var(--space-lg) var(--space-xl);
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: var(--space-lg); flex-wrap: wrap;
}
.filter-bar-group { display: flex; flex-direction: column; gap: 6px; }
.filter-bar-label { font-size: var(--text-xs) !important; font-weight: 600 !important; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* FIX #10: all selects have down-arrow + height */
.filter-bar-select {
  height: 40px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 32px 0 12px;
  font-size: var(--text-sm) !important; font-weight: 500 !important;
  color: var(--text-primary) !important;
  outline: none; appearance: none; -webkit-appearance: none;
  cursor: pointer; min-width: 150px;
  /* Chevron down icon — clearly shows these are listboxes */
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 5l4 4 4-4' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color 0.2s, background 0.2s;
}
.filter-bar-select:hover { border-color: var(--border-hover); }
.filter-bar-select:focus { border-color: var(--primary); background: var(--bg-input); box-shadow: 0 0 0 3px rgba(0,102,204,0.1); }

/* FIX #8: search group wider */
.filter-bar-search-group .filter-search-wrap input { width: 300px; }

.filter-search-wrap { position: relative; }
.filter-search-wrap input {
  height: 40px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 12px 0 38px;
  font-size: var(--text-sm) !important; font-weight: 500 !important;
  color: var(--text-primary) !important; outline: none;
  width: 300px; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.filter-search-wrap input::placeholder { color: var(--placeholder) !important; font-weight: 400 !important; }
.filter-search-wrap input:hover        { border-color: var(--border-hover); }
.filter-search-wrap input:focus        { border-color: var(--primary); background: var(--bg-input); box-shadow: 0 0 0 3px rgba(0,102,204,0.1); }
.filter-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
}

/* Sort pushed right */
.sort-group { margin-left: auto; }

/* ── Body ── */
.dir-body { display: flex; padding: 1rem 1.5rem 1.5rem; }

/* ── Sidebar ── */
.filter-sidebar { width: 260px; flex-shrink: 0; margin-right: var(--space-xl); }
.filter-sidebar-inner {
  background: var(--bg-nav); border: 1px solid var(--border);
  border-radius: 12px; padding: var(--space-lg); box-shadow: var(--shadow-sm);
  position: sticky; top: var(--space-lg);
}
.filter-sidebar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-lg); padding-bottom: var(--space-lg); border-bottom: 1px solid var(--border); }
.filter-sidebar-title  { font-size: var(--text-lg) !important; font-weight: 700 !important; color: var(--text-primary); }
.filter-clear-btn      { font-size: var(--text-xs) !important; color: var(--primary); background: none; border: none; padding: 0; cursor: pointer; font-weight: 600; transition: opacity 0.2s; }
.filter-clear-btn:hover { opacity: 0.7; }
.filter-group          { margin-bottom: var(--space-lg); padding-bottom: var(--space-lg); border-bottom: 1px solid var(--border); }
.filter-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.filter-group-title    { font-size: var(--text-xs) !important; font-weight: 700 !important; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.filter-group-select {
  width: 100%; height: 36px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 28px 0 10px; font-size: var(--text-sm) !important;
  color: var(--text-primary) !important; outline: none; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 5l4 4 4-4' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  margin-bottom: 8px; cursor: pointer; transition: border-color 0.2s;
}
.filter-group-select:hover { border-color: var(--border-hover); }
.filter-group-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,102,204,0.1); }
.filter-checkbox-item, .filter-radio-item {
  display: flex; align-items: center; justify-content: space-between; padding: 6px 0;
  transition: color 0.15s;
}
.filter-checkbox-item:hover, .filter-radio-item:hover { color: var(--text-primary); }
.filter-checkbox-left, .filter-radio-left { display: flex; align-items: center; gap: 8px; }
.filter-checkbox-item input[type="checkbox"],
.filter-radio-item   input[type="radio"]  { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.filter-checkbox-label, .filter-radio-label { font-size: var(--text-sm) !important; color: var(--text-secondary); cursor: pointer; }
.filter-checkbox-count { font-size: var(--text-xs) !important; color: var(--text-muted); font-weight: 500; }
.show-more-btn { font-size: var(--text-sm) !important; color: var(--primary); background: none; border: none; padding: 4px 0; display: flex; align-items: center; gap: 4px; cursor: pointer; font-weight: 600; transition: opacity 0.2s; }
.show-more-btn:hover { opacity: 0.8; }
.show-more-btn svg { width: 11px; height: 11px; }
.filter-divider { border: none; border-top: 1px solid var(--border); margin: var(--space-md) 0; }
.apply-filters-btn { width: 100%; height: 40px; background: var(--primary); color: #fff !important; border: none; border-radius: 8px; font-size: var(--text-sm) !important; font-weight: 600 !important; margin-top: var(--space-lg); cursor: pointer; transition: background 0.2s; }
.apply-filters-btn:hover { background: var(--primary-hover); }

/* ── Cards area ── */
.cards-area { flex: 1; min-width: 0; }

/* ═══════════════════════════════════════════
   GRID — 3 columns (Minimal/Clean redesign)
═══════════════════════════════════════════ */
.grid-view { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.grid-card {
  background: var(--bg-nav); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; height: 100%;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.2s, border-color 0.2s;
}
.grid-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.grid-card-logo-wrap {
  height: 160px;
  display: flex; align-items: center; justify-content: center;
  background: #ffffff; border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.grid-card-logo-wrap img    { max-width: 72%; max-height: 72%; object-fit: contain; }
.grid-card-logo-initials    { font-size: 32px !important; font-weight: 700 !important; }

/* Badges in card body — shown only when present */
.grid-card-badges {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  margin-bottom: 6px;
}

/* Featured badge — gold star pill */
.grid-card-featured {
  display: flex; align-items: center; gap: 5px;
  background: rgba(251,191,36,.15); border: 1px solid rgba(251,191,36,.55);
  color: #b45309 !important; font-size: 11px !important; font-weight: 600 !important;
  padding: 3px 10px; border-radius: 99px;
}
.grid-card-featured svg { width: 11px; height: 11px; fill: #d97706; flex-shrink: 0; }

body.dark-mode .grid-card-featured { background: rgba(251,191,36,.20); border-color: rgba(251,191,36,.5); color: #fbbf24 !important; }
body.dark-mode .grid-card-featured svg { fill: #fbbf24; }

/* Verified badge — green pill */
.grid-card-verified {
  display: flex; align-items: center; gap: 4px;
  background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.35);
  color: #059669 !important; font-size: 11px !important; font-weight: 500 !important;
  padding: 3px 9px; border-radius: 99px;
}
.grid-card-verified svg { width: 10px; height: 10px; stroke: #059669; }

/* Bookmark */
.grid-card-bookmark {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid #e5e7eb; background: rgba(255,255,255,.95);
  display: flex; align-items: center; justify-content: center;
  color: #9ca3af; cursor: pointer; transition: all .15s;
}
.grid-card-bookmark svg { width: 13px; height: 13px; }
.grid-card-bookmark:hover,
.grid-card-bookmark.is-saved { border-color: var(--accent); color: var(--accent); background: #fff; }

.grid-card-body { padding: 1rem; background: var(--bg-card-body); flex: 1; display: flex; flex-direction: column; }
.grid-card-name {
  font-size: 15px !important; font-weight: 700 !important;
  color: var(--text-primary) !important; line-height: 1.3;
  height: 2.6em; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 5px;
}
.grid-card-sector   { font-size: var(--text-sm) !important; color: var(--primary) !important; font-weight: 600 !important; margin-bottom: 8px; }
.grid-card-location { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs) !important; color: var(--text-muted); margin-bottom: 4px; }
.grid-card-location svg { width: 12px; height: 12px; stroke: var(--text-muted); flex-shrink: 0; }
.grid-card-coverage { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs) !important; color: var(--text-muted); margin-bottom: 10px; }
.grid-card-coverage svg { width: 12px; height: 12px; stroke: var(--text-muted); flex-shrink: 0; }
.grid-card-chips    { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; margin-top: 8px; }
.chip               { font-size: var(--text-xs) !important; padding: 4px 10px; border-radius: 99px; background: var(--bg-chip); color: var(--text-secondary) !important; border: 1px solid var(--border); font-weight: 500 !important; transition: all 0.2s; }
.chip:hover { border-color: var(--primary); color: var(--primary) !important; background: rgba(0,102,204,0.05); }
.card-chip-count    { font-size: var(--text-xs) !important; padding: 4px 10px; border-radius: 99px; background: rgba(0,102,204,0.1); color: var(--primary) !important; border: 1px solid rgba(0,102,204,0.2); font-weight: 600 !important; }
.grid-card-footer   { border-top: 1px solid var(--border); padding-top: 12px; margin-top: auto; }

.view-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 38px; background: var(--primary);
  border: 1px solid var(--primary); border-radius: 8px;
  font-size: var(--text-sm) !important; font-weight: 600 !important;
  color: #fff !important; transition: all 0.2s;
  text-decoration: none !important; cursor: pointer;
}
.view-btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.view-btn svg   { width: 14px; height: 14px; stroke: #fff; }

/* ═══════════════════════════════════════════
   LIST VIEW
═══════════════════════════════════════════ */
.list-view { display: flex; flex-direction: column; gap: 12px; }
.list-card { background: var(--bg-nav); border: 1px solid var(--border); border-radius: 12px; display: flex; align-items: stretch; transition: box-shadow 0.2s, border-color 0.2s; overflow: hidden; box-shadow: var(--shadow-sm); }
.list-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); }
.list-card-logo  { width: 110px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: #ffffff; border-right: 1px solid var(--border); padding: .875rem; }
.list-card-logo img { max-width: 85px; max-height: 85px; object-fit: contain; }
.list-card-logo-initials { font-size: 20px !important; font-weight: 700 !important; }
.list-card-body  { flex: 1; padding: .875rem 1.1rem; min-width: 0; }
.list-card-top   { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 3px; gap: 8px; }
.list-card-name  { font-size: 15px !important; font-weight: 600 !important; color: var(--text-primary) !important; }
.list-card-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.list-card-verified { display: flex; align-items: center; gap: 4px; background: rgba(16,185,129,.10); border: 1px solid rgba(16,185,129,.30); color: #059669 !important; font-size: 10px !important; font-weight: 500 !important; padding: 2px 8px; border-radius: 99px; }
.list-card-verified svg { width: 9px; height: 9px; stroke: #059669; }
.list-card-featured-badge { display: flex; align-items: center; gap: 4px; background: rgba(251,191,36,.15); border: 1px solid rgba(251,191,36,.5); color: #b45309 !important; font-size: 10px !important; font-weight: 600 !important; padding: 2px 8px; border-radius: 99px; }
.list-card-featured-badge svg { width: 9px; height: 9px; fill: #d97706; }
.list-bookmark-btn { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border); background: none; display: flex; align-items: center; justify-content: center; color: var(--text-faint); cursor: pointer; transition: all .15s; flex-shrink: 0; }
.list-bookmark-btn svg { width: 12px; height: 12px; }
.list-bookmark-btn:hover, .list-bookmark-btn.is-saved { color: var(--accent); border-color: var(--accent); background: var(--bg-active); }
.list-card-sector { font-size: 12px !important; color: var(--accent-light) !important; font-weight: 500 !important; margin-bottom: 5px; }
.list-card-desc   { font-size: 12px !important; color: var(--text-muted); line-height: 1.55; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-card-contacts { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.list-card-contact  { display: flex; align-items: center; gap: 4px; font-size: 12px !important; color: var(--text-muted); }
.list-card-contact svg { width: 11px; height: 11px; stroke: var(--text-muted); flex-shrink: 0; }
.list-card-side   { width: 200px; flex-shrink: 0; border-left: 1px solid var(--border); padding: .875rem 1rem; display: flex; flex-direction: column; justify-content: space-between; background: var(--bg-card-body); }
.list-card-meta   { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.list-card-meta-row { display: flex; align-items: center; gap: 5px; font-size: 12px !important; color: var(--text-muted); }
.list-card-meta-row svg { width: 11px; height: 11px; stroke: var(--text-muted); flex-shrink: 0; }
.list-card-services { font-size: 11px !important; color: var(--text-muted); padding: 3px 8px; background: var(--bg-chip); border-radius: 5px; border: 1px solid var(--border); }
.list-view-profile-btn { display: flex; align-items: center; gap: 4px; font-size: 13px !important; color: var(--accent-light) !important; background: none; border: none; padding: 0; font-weight: 500 !important; cursor: pointer; }
.list-view-profile-btn svg { width: 12px; height: 12px; }

/* ── Empty state ── */
.empty-state       { text-align: center; padding: 3.5rem 2rem; }
.empty-state-title { font-size: 16px !important; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500 !important; }
.empty-state-sub   { font-size: 13px !important; color: var(--text-muted); }

/* ── Pagination
   FIX #2: min-width on page-btn so 4-digit page numbers (e.g. 3039) are not narrow ── */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 0 0; flex-wrap: wrap; gap: 10px; }
.page-btn {
  min-width: 36px; height: 32px; padding: 0 6px;
  border-radius: 7px; border: 1px solid var(--border); background: var(--bg-nav);
  font-size: 13px !important; color: var(--text-secondary) !important;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s; cursor: pointer; white-space: nowrap;
}
.page-btn:hover:not(:disabled) { border-color: var(--border-hover); color: var(--text-primary) !important; }
.page-btn.active   { background: var(--accent); border-color: var(--accent); color: #fff !important; font-weight: 500 !important; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-ellipsis     { height: 32px; display: flex; align-items: center; justify-content: center; font-size: 13px !important; color: var(--text-faint); padding: 0 4px; }
.per-page-select   {
  height: 32px; background: var(--bg-nav); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 28px 0 9px; font-size: 13px !important;
  color: var(--text-primary) !important; outline: none; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 5l4 4 4-4' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center; cursor: pointer;
}

/* ── Misc ── */
.saved-count-badge {
  margin-left: auto; min-width: 18px; height: 18px;
  background: var(--accent); color: #fff !important;
  font-size: 10px !important; font-weight: 700 !important;
  border-radius: 99px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0 5px; line-height: 1;
}
.toast {
  position: fixed; bottom: 1.25rem; left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: var(--bg-nav); border: 1px solid var(--border-hover);
  border-radius: 8px; padding: 9px 16px;
  font-size: 13px !important; color: var(--text-primary) !important;
  z-index: 2000; transition: transform .22s ease;
  white-space: nowrap; pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════
   LIGHT MODE
═══════════════════════════════════════════ */
body:not(.dark-mode) .grid-card-logo-wrap { background: #fff; }
body:not(.dark-mode) .grid-card-body      { background: #f8f9fa; }
body:not(.dark-mode) .list-card-logo      { background: #fff; }
body:not(.dark-mode) .list-card-side      { background: #f8f9fa; }
body:not(.dark-mode) .grid-card-bookmark  { background: #fff; border-color: #e5e7eb; color: #9ca3af; }
body:not(.dark-mode) .grid-card-bookmark:hover,
body:not(.dark-mode) .grid-card-bookmark.is-saved { border-color: var(--primary); color: var(--primary); background: #fff; }
body:not(.dark-mode) .chip                { background: #fff; border-color: #e5e7eb; color: #6b7280; }
body:not(.dark-mode) .card-chip-count     { background: rgba(0,102,204,.08); color: var(--primary); border-color: rgba(0,102,204,.2); }
body:not(.dark-mode) .view-btn            { color: #fff !important; background: var(--primary); border-color: var(--primary); }
body:not(.dark-mode) .view-btn svg        { stroke: #fff; }
body:not(.dark-mode) .view-btn:hover      { background: var(--primary-hover); border-color: var(--primary-hover); }
body:not(.dark-mode) .apply-filters-btn   { background: var(--primary); }
body:not(.dark-mode) .page-btn.active     { background: var(--primary); border-color: var(--primary); }
body:not(.dark-mode) .filter-bar          { background: #fff; }
body:not(.dark-mode) .filter-bar-select,
body:not(.dark-mode) .filter-search-wrap input { background: #fff; border-color: #e5e7eb; color: #111827; }
body:not(.dark-mode) .toast               { background: #fff; border-color: #e5e7eb; }
body:not(.dark-mode) .filter-sidebar-inner{ box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* ═══════════════════════════════════════════
   DARK MODE
═══════════════════════════════════════════ */
body.dark-mode .grid-card-logo-wrap   { background: #222; }
body.dark-mode .grid-card-body        { background: #1a1a1a; }
body.dark-mode .list-card-logo        { background: #222; }
body.dark-mode .list-card-side        { background: #1a1a1a; }
body.dark-mode .grid-card-bookmark    { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); color: #6b7280; }
body.dark-mode .grid-card-bookmark:hover,
body.dark-mode .grid-card-bookmark.is-saved { border-color: #0066CC; color: #0066CC; background: rgba(0,166,81,.1); }
body.dark-mode .chip                  { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.09); color: #9ca3af; }
body.dark-mode .card-chip-count       { background: rgba(0,102,204,.2); color: #0066CC; border-color: rgba(0,166,81,.3); }
body.dark-mode .view-btn              { color: #0066CC !important; border-color: rgba(255,255,255,.09); }
body.dark-mode .view-btn svg          { stroke: #0066CC; }
body.dark-mode .view-btn:hover        { border-color: #0066CC; background: rgba(0,102,204,.15); }
body.dark-mode .toast                 { background: #1a1a1a; border-color: rgba(255,255,255,.15); }
body.dark-mode .filter-bar            { background: #111; }
body.dark-mode .filter-bar-select,
body.dark-mode .filter-search-wrap input { background: #1a1a1a; border-color: rgba(255,255,255,.09); color: #f9fafb; }

/* ═══════════════════════════════════════════
   RESPONSIVE
   FIX #1: topbar search hidden on mobile
   FIX #2: page-btn wraps gracefully
═══════════════════════════════════════════ */

@media (max-width: 1100px) { .grid-view { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 900px)  { .filter-sidebar { display: none; } .dir-body { padding: .875rem 1rem 1.25rem; } }
@media (max-width: 768px)  {
  .filter-bar { padding: .75rem 1rem; gap: 8px; }
  .filter-bar-select { height: 44px; font-size: 13px !important; min-width: 110px; }
  .filter-search-wrap input,
  .filter-bar-search-group .filter-search-wrap input { height: 44px; font-size: 13px !important; width: 100%; }
  .sort-group    { display: none; }
  .list-card-side{ display: none; }
  .list-card-logo{ width: 80px; }
}
@media (max-width: 640px)  {
  .dir-header   { padding: 1rem 1rem 0; }
  .dir-head-row { flex-direction: column; align-items: flex-start; }
  .dir-body     { padding: .875rem 1rem 1.25rem; }
  .grid-view    { grid-template-columns: 1fr;}
  .page-body    { padding-bottom: 60px; }
  /* Hide desktop shell on mobile, show mobile shell */
  .app-shell.dir-shell { display: none !important; }
  .mobile-bottom-toolbar { display: none !important; }
  .dir-mob-shell { display: flex !important; }
}
@media (max-width: 400px)  {
  .grid-view  { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar-select,
  .filter-search-wrap input { width: 100%; min-width: 0; }
}

/* ── Mobile Pagination ────────────────────────────────────────────────────── */
.mob-pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 8px;
  border-top: 1px solid var(--border);
  margin-bottom: 4px;
}
.mob-page-btn {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-nav);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.mob-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.mob-page-info { font-size: 13px; color: var(--text-muted); }

/* ── Mobile Bottom Toolbar ────────────────────────────────────────────────── */
.mobile-bottom-toolbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
  z-index: 100;
  justify-content: space-around;
}
.mobile-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: color 0.15s;
  background: none;
  border: none;
}
.mobile-tab-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.mobile-tab-item.active { color: var(--accent); }
.mobile-tab-item:hover { color: var(--accent); }
@media (max-width: 640px) {
  .mobile-bottom-toolbar { display: flex; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   DIRECTORY MOBILE SHELL — hidden by default, shown only ≤640px
══════════════════════════════════════════════════════════════════════════════ */
.dir-mob-shell {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-page);
  font-family: 'Inter', sans-serif;
  padding-bottom: 70px;
}

/* Topbar reuses mob-topbar-* classes from tenders.css shared via theme */
.dir-mob-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Chip dropdowns — reuse .mob-chip-dropdown pattern */
.mob-chip-dropdown.dir-mob-dropdown {
  max-height: 260px;
  overflow-y: auto;
}

/* ── Directory mobile card list ──────────────────────────────────────────── */
.dir-mob-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 8px 12px 12px;
}
.dir-mob-list.dir-mob-list-view {
  grid-template-columns: 1fr;
  gap: 0;
}
.dir-mob-card {
  display: flex;
  align-items: stretch;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}
/* Grid view: stack vertically */
.dir-mob-list:not(.dir-mob-list-view) .dir-mob-card {
  flex-direction: column;
}
.dir-mob-list:not(.dir-mob-list-view) .dir-mob-card-left {
  width: 100%;
  height: 80px;
  border-bottom: 1px solid var(--border);
}
/* List view: keep horizontal, add bottom margin */
.dir-mob-list.dir-mob-list-view .dir-mob-card {
  margin-bottom: 10px;
}
.dir-mob-card-left {
  width: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* background: var(--bg-chip); */
}
.dir-mob-logo-img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; }
.dir-mob-logo-initials {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}
.dir-mob-card-body { flex: 1; padding: 12px 14px; min-width: 0; }
.dir-mob-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.dir-mob-card-name { font-size: 15px; font-weight: 700; color: var(--text-primary); line-height: 1.25; flex: 1; }
.dir-mob-card-badges { display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; }
.dir-mob-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
}
.dir-mob-badge-verified { background: #d1fae5; color: #065f46; }
.dir-mob-badge-featured { background: #fef3c7; color: #92400e; }
body.dark-mode .dir-mob-badge-verified { background: rgba(16,185,129,0.2); color: #34d399; }
body.dark-mode .dir-mob-badge-featured { background: rgba(251,191,36,0.2); color: #fcd34d; }
.dir-mob-card-sector { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
.dir-mob-card-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.dir-mob-card-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.dir-mob-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
/* Shared drawer styles (reused from mob-* in tenders.css but defined locally for directory) */
.mob-topbar-brand { display: flex; align-items: center; gap: 10px; }
.mob-topbar-logo { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--primary); overflow: hidden; }
.mob-topbar-titles { display: flex; flex-direction: column; line-height: 1.1; }
.mob-topbar-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.mob-topbar-sub { font-size: 11px; color: var(--text-muted); }
.mob-topbar-actions { display: flex; align-items: center; gap: 6px; }
.mob-topbar-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: none; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.mob-page-title { font-size: 26px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; }
.mob-page-subtitle { font-size: 13px; color: var(--text-muted); margin: 0; }
.mob-search-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--bg-nav); border-bottom: 1px solid var(--border); }
.mob-search-wrap { flex: 1; position: relative; }
.mob-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.mob-search-input { width: 100%; box-sizing: border-box; padding: 10px 12px 10px 38px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 14px; background: var(--bg-input-alt); color: var(--text-primary); outline: none; }
.mob-search-input:focus { border-color: var(--border-focus); }
.mob-filter-icon-btn { width: 42px; height: 42px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg-nav); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.mob-filter-chips-wrap { position: relative; background: var(--bg-nav); border-bottom: 1px solid var(--border); }
.mob-filter-chips-row { display: flex; align-items: center; gap: 8px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; background: var(--bg-nav); }
.mob-filter-chips-row::-webkit-scrollbar { display: none; }
.mob-filter-chip { display: flex; align-items: center; gap: 5px; padding: 7px 14px; border: 1.5px solid var(--border); border-radius: 20px; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; background: var(--bg-nav); color: var(--text-secondary); flex-shrink: 0; transition: all 0.15s; }
.mob-filter-chip-all { border-color: var(--accent); color: var(--accent); background: rgba(0,102,204,0.07); }
.mob-filter-chip.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.mob-results-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 14px 16px 8px; }
.mob-results-count { display: flex; gap: 0; align-items: baseline; }
.mob-results-bold { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.mob-results-label { font-size: 13px; color: var(--text-secondary); }
.mob-chip-dropdown { display: none; position: absolute; top: calc(100% - 2px); left: 16px; right: auto; z-index: 300; background: var(--bg-nav); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); min-width: 200px; max-width: calc(100vw - 32px); max-height: 60vh; overflow-y: auto; flex-direction: column; gap: 4px; }
.mob-chip-dropdown.open { display: flex; }
.mob-chip-dd-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-primary); padding: 7px 0; cursor: pointer; }
.mob-chip-dd-row input { accent-color: var(--accent); cursor: pointer; }
.mob-chip-dd-option { text-align: left; background: none; border: none; font-size: 14px; color: var(--text-primary); padding: 8px 0; cursor: pointer; border-radius: 6px; font-family: inherit; }
.mob-chip-dd-option:hover, .mob-chip-dd-option.selected { color: var(--accent); font-weight: 600; }
.mob-drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 200; }
.mob-drawer-overlay.open { display: block; }
.mob-filters-drawer { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-nav); border-radius: 18px 18px 0 0; z-index: 201; transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.4,0,0.2,1); max-height: 80vh; display: flex; flex-direction: column; }
.mob-filters-drawer.open { transform: translateY(0); }
.mob-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.mob-drawer-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.mob-drawer-header-right { display: flex; align-items: center; gap: 12px; }
.mob-drawer-clear { font-size: 13px; color: var(--accent); background: none; border: none; cursor: pointer; font-weight: 500; }
.mob-drawer-close { background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
.mob-drawer-body { flex: 1; overflow-y: auto; padding: 12px 20px; }
.mob-drawer-section { margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.mob-drawer-section:last-child { border-bottom: none; }
.mob-drawer-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 10px; }
.mob-drawer-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-primary); padding: 6px 0; cursor: pointer; }
.mob-drawer-row input { accent-color: var(--accent); cursor: pointer; }
.mob-drawer-footer { padding: 12px 20px; border-top: 1px solid var(--border); }
.mob-drawer-apply { width: 100%; padding: 13px; background: var(--accent); color: #fff; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; }
.dir-show-more-btn { font-size: 12px; color: var(--accent); background: none; border: none; padding: 4px 0; cursor: pointer; font-weight: 500; display: flex; align-items: center; gap: 4px; }

