/* ── DIRECTORY PAGE LAYOUT ────────────────────────────────── */
.dir-layout {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
  gap: 20px;
  align-items: flex-start;
}

/* ── SIDEBAR ──────────────────────────────────────────────── */
.dir-sidebar {
  width: 210px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
}
.dir-search-form { margin-bottom: 16px; }
.dir-search-wrap {
  display: flex; align-items: center; gap: 7px;
  background: white; border: 1.5px solid #e8e8e0;
  border-radius: 7px; padding: 7px 10px; margin-bottom: 7px;
}
.dir-search-wrap i { color: #aaa; font-size: 14px; flex-shrink: 0; }
.dir-search-wrap input { flex:1; border:none; outline:none; font-size:13px; color:#333; }
.dir-search-btn {
  width: 100%; background: #1B4332; color: white;
  border: none; border-radius: 7px; padding: 8px;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.dir-search-btn:hover { background: #144226; }

.sb-section { margin-bottom: 20px; }
.sb-label {
  font-size: 10px; font-weight: 800; color: #D4A017;
  text-transform: uppercase; letter-spacing: .7px;
  margin-bottom: 7px; padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}
.sb-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: #555; padding: 6px 8px;
  border-radius: 6px; cursor: pointer; transition: all .15s;
  text-decoration: none; margin-bottom: 2px;
}
.sb-item:hover, .sb-item.active {
  background: #f0fdf4; color: #1B4332; font-weight: 600;
}
.sb-city {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: #555; padding: 5px 8px;
  border-radius: 6px; cursor: pointer; transition: all .15s;
  text-decoration: none; margin-bottom: 2px;
}
.sb-city:hover, .sb-city.active {
  background: #f0fdf4; color: #1B4332; font-weight: 600;
}
.sb-cnt {
  background: #eee; color: #888; font-size: 10px;
  font-weight: 700; padding: 1px 6px; border-radius: 99px;
}

/* ── MAIN AREA ────────────────────────────────────────────── */
.dir-main { flex: 1; min-width: 0; }

.dir-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 8px;
}
.dir-count { font-size: 14px; color: #555; }
.dir-count strong { color: #1B4332; font-weight: 800; }

/* ── BUSINESS ROW CARDS ───────────────────────────────────── */
.biz-list { display: flex; flex-direction: column; gap: 10px; }
.biz-row {
  background: white; border: 1px solid #e8e8e0;
  border-radius: 12px; padding: 16px;
  cursor: pointer; transition: all .2s;
  text-decoration: none; display: block; color: inherit;
}
.biz-row:hover { border-color: #1B4332; box-shadow: 0 3px 16px rgba(27,67,50,.09); }
.biz-row.featured {
  border-color: #D4A017;
  background: linear-gradient(135deg, rgba(212,160,23,.04), white);
}
.featured-label {
  font-size: 10px; font-weight: 800; color: #D4A017;
  margin-bottom: 9px; display: flex; align-items: center; gap: 4px;
}
.biz-row-inner { display: flex; gap: 13px; }
.biz-thumb {
  width: 64px; height: 64px; border-radius: 10px;
  background: #F7F6F0; display: flex; align-items: center;
  justify-content: center; font-size: 28px; flex-shrink: 0;
}
.biz-info { flex: 1; min-width: 0; }
.biz-top-row {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 8px; margin-bottom: 5px;
}
.biz-name { font-size: 15px; font-weight: 700; color: #1B4332; }
.biz-name-ar {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 12px; color: #888; direction: rtl;
}
.biz-badges { display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; }
.biz-meta-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: #888; margin-bottom: 5px; flex-wrap: wrap;
}
.biz-cat { font-weight: 600; color: #555; }
.biz-price { font-weight: 700; color: #1B4332; }
.biz-loc { display: flex; align-items: center; gap: 3px; }
.biz-desc { font-size: 12px; color: #777; line-height: 1.5; margin-bottom: 8px; }
.biz-actions-row { display: flex; gap: 7px; flex-wrap: wrap; }
.biz-action-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: #555;
  background: #F7F6F0; border: 1px solid #e8e8e0;
  padding: 4px 10px; border-radius: 6px; transition: all .15s;
}
.biz-action-btn:hover { border-color: #1B4332; color: #1B4332; }

/* ── EMPTY STATE ──────────────────────────────────────────── */
.dir-empty {
  text-align: center; padding: 60px 24px;
  background: white; border-radius: 12px; border: 1px solid #e8e8e0;
}
.dir-empty h3 { font-size: 18px; font-weight: 700; color: #1B4332; margin-bottom: 8px; }
.dir-empty p  { font-size: 14px; color: #888; }
.dir-empty a  { color: #1B4332; font-weight: 600; }

/* ── PAGINATION ───────────────────────────────────────────── */
.pagination {
  display: flex; gap: 6px; justify-content: center;
  margin-top: 24px; flex-wrap: wrap;
}
.page-btn {
  background: white; border: 1px solid #e8e8e0; border-radius: 6px;
  padding: 7px 13px; font-size: 13px; color: #555;
  cursor: pointer; transition: all .15s; text-decoration: none;
}
.page-btn:hover, .page-btn.active {
  background: #1B4332; color: white; border-color: #1B4332;
}

/* ── ADD BUSINESS STRIP ───────────────────────────────────── */
.dir-cta-strip {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; background: #1B4332; border-radius: 10px;
  padding: 16px 20px; margin-top: 20px; flex-wrap: wrap;
}
.dir-cta-strip strong { color: white; font-size: 14px; font-weight: 700; display: block; margin-bottom: 3px; }
.dir-cta-strip span  { color: rgba(255,255,255,.6); font-size: 12px; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 700px) {
  .dir-layout   { flex-direction: column; }
  .dir-sidebar  { width: 100%; position: static; }
  .biz-top-row  { flex-direction: column; }
  .dir-cta-strip { flex-direction: column; text-align: center; }
}

/* ── RTL directory ────────────────────────────────────────── */
body.rtl .dir-layout    { flex-direction: row-reverse; }
body.rtl .biz-row-inner { flex-direction: row-reverse; }
body.rtl .biz-top-row   { flex-direction: row-reverse; }
body.rtl .biz-meta-row  { flex-direction: row-reverse; }
body.rtl .biz-actions-row { flex-direction: row-reverse; }
body.rtl .sb-city       { flex-direction: row-reverse; }
body.rtl .dir-header    { flex-direction: row-reverse; }


/* Scoped to the filtered directory so other pages retain their styling. */
.dir-layout { display:grid; grid-template-columns:240px minmax(0,1fr); gap:32px; width:100%; max-width:1240px; margin:0 auto; padding:28px 24px 56px; box-sizing:border-box; align-items:start; }
.dir-layout *, .dir-layout *::before, .dir-layout *::after { box-sizing:border-box; }
.dir-layout .dir-sidebar, .dir-layout .dir-main { min-width:0; width:auto; }
.dir-layout .dir-header { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; margin-bottom:24px; }
.dir-layout .dir-count { font-size:14px; line-height:1.6; }
.dir-layout .dir-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:20px; }
.dir-layout .biz-card { display:flex; align-items:flex-start; gap:18px; width:100%; min-width:0; margin:0; padding:24px; border:1px solid #d9e3dc; border-radius:14px; background:#fff; color:#263c31; text-decoration:none; box-shadow:0 3px 12px rgba(27,67,50,.05); }
.dir-layout .biz-card:hover { border-color:#2d6a4f; box-shadow:0 5px 18px rgba(27,67,50,.10); }
.dir-layout .biz-card:focus-visible { outline:3px solid #c99413; outline-offset:3px; }
.dir-layout .biz-icon { display:flex; align-items:center; justify-content:center; flex:0 0 52px; width:52px; height:52px; margin:0; border-radius:12px; background:#f0f7f2; font-size:27px; }
.dir-layout .biz-body { flex:1; min-width:0; }
.dir-layout .biz-cat { margin:0 0 6px; font-size:12px; line-height:1.5; font-weight:600; color:#66776c; }
.dir-layout .biz-name { margin:0; font-size:21px; line-height:1.35; font-weight:800; color:#1b4332; overflow-wrap:anywhere; }
.dir-layout .biz-name-ar { position:static; float:none; display:table; width:auto; max-width:100%; margin:6px 0 0; font-family:'Noto Naskh Arabic',serif; font-size:18px; line-height:1.6; direction:rtl; text-align:right; color:#6a756e; overflow-wrap:anywhere; }
.dir-layout .biz-meta { display:flex; flex-wrap:wrap; gap:8px 20px; margin-top:14px; font-size:14px; line-height:1.6; color:#5c6961; }
.dir-layout .biz-meta span { display:inline-flex; align-items:baseline; gap:5px; overflow-wrap:anywhere; }
.dir-layout .biz-badges { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.dir-layout .biz-badges:empty { display:none; }
.dir-layout .biz-badges > span { display:inline-block; padding:4px 10px; border-radius:20px; font-size:12px; line-height:1.5; font-weight:700; }
.dir-layout .badge-halal, .dir-layout .badge-zabiha { background:#edf9f0; color:#23683d; }
.dir-layout .badge-arabic { background:#eef4ff; color:#294caa; }
.dir-layout .badge-feat { background:#fff8e7; color:#8b550b; }
.dir-layout .dir-cta-strip { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px; margin-top:28px; padding:22px; border:1px solid #d9e3dc; border-radius:14px; background:#f0f7f2; }
.dir-layout .dir-cta-strip strong, .dir-layout .dir-cta-strip span { display:block; line-height:1.6; }
.dir-layout .dir-cta-strip strong { color:#1b4332; opacity:1; }
.dir-layout .dir-cta-strip span { color:#465c50; opacity:1; }
.dir-layout .dir-cta-strip a.btn-green { background:#1b4332; color:#fff; opacity:1; }
@media (max-width:760px) {
  .dir-layout { grid-template-columns:minmax(0,1fr); gap:24px; padding:20px 16px 40px; }
  .dir-layout .dir-sidebar { position:static; height:auto; max-height:none; }
  .dir-layout .biz-card { padding:18px; gap:12px; }
  .dir-layout .biz-icon { flex-basis:42px; width:42px; height:42px; font-size:23px; }
  .dir-layout .biz-name { font-size:19px; }
  .dir-layout .biz-meta { flex-direction:column; gap:6px; }
}

.dir-layout .pagination { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:6px; margin:28px 0 8px; padding:0; }
.dir-layout .pagination .page-btn { display:inline-flex; align-items:center; justify-content:center; width:auto; min-width:38px; height:38px; margin:0; padding:0 10px; border:1px solid transparent; border-radius:9px; background:transparent; color:#526158; font-size:14px; font-weight:600; line-height:1; text-decoration:none; box-shadow:none; }
.dir-layout .pagination .page-btn:hover { background:#e7efe9; color:#1b4332; }
.dir-layout .pagination .page-btn.active { background:#1b4332; color:#fff; border-color:#1b4332; }
.dir-layout .pagination .page-btn:focus-visible { outline:3px solid #c99413; outline-offset:2px; }
.dir-layout .pagination .page-direction { padding:0 12px; background:#fff; border-color:#d9e3dc; }
.dir-layout .pagination .page-ellipsis { display:inline-flex; align-items:center; justify-content:center; width:24px; color:#758078; }
@media (max-width:420px) {
  .dir-layout .pagination { gap:3px; }
  .dir-layout .pagination .page-btn { min-width:32px; height:36px; padding:0 7px; font-size:13px; }
  .dir-layout .pagination .page-direction { padding:0 8px; }
  .dir-layout .pagination .page-ellipsis { width:16px; }
}

/* Keep desktop filters within the viewport and scroll them independently. */
@media (min-width:761px) {
  .dir-layout .dir-sidebar {
    position:sticky;
    top:96px;
    align-self:start;
    height:auto;
    min-height:0;
    max-height:calc(100vh - 120px);
    max-height:calc(100dvh - 120px);
    overflow-y:auto;
    overflow-x:hidden;
    overscroll-behavior-y:contain;
    scrollbar-width:thin;
    scrollbar-color:#9aad9f transparent;
    scrollbar-gutter:stable;
    padding-right:10px;
  }
  .dir-layout .dir-sidebar:focus-visible { outline:2px solid #2d6a4f; outline-offset:4px; }
}
/* Scrollable desktop filters; collapsible mobile filters. */
.mobile-filters{min-width:0;position:sticky;top:96px}.mobile-filters>summary{display:none}.dir-layout .mobile-filters .dir-sidebar{position:static;max-height:calc(100dvh - 120px)}.dir-layout .biz-icon{overflow:hidden}.dir-layout .biz-icon img{width:100%;height:100%;object-fit:cover}.dir-search-wrap input{min-width:0}.sb-item,.sb-city{min-height:36px}.sb-label{color:#8a650d}
@media(max-width:760px){.mobile-filters{position:static;border:1px solid #d9e3dc;border-radius:12px;background:white}.mobile-filters>summary{display:block;padding:16px;font-weight:700;color:#1b4332;cursor:pointer;list-style:none}.mobile-filters>summary::after{content:' +';float:right}.mobile-filters[open]>summary::after{content:' −'}.dir-layout .mobile-filters .dir-sidebar{padding:0 16px 16px;max-height:65dvh;overflow-y:auto}.dir-layout .dir-count{font-size:13px}.dir-layout .dir-header{margin-bottom:16px}.dir-search-wrap input{font-size:16px}.sb-item,.sb-city{min-height:44px}}

@media(max-width:600px){.directory-map-search{height:auto!important;display:grid!important;grid-template-columns:minmax(0,1fr);overflow:visible!important}.directory-map-search>div{min-width:0;min-height:48px;border-right:0!important;padding:12px!important}.directory-map-search>button{min-height:48px;border-radius:0 0 7px 7px;padding:12px!important}.directory-map-search input{font-size:16px!important}.directory-map-search .city-drop{z-index:30}}

.map-panel-header{flex-wrap:wrap;gap:14px}
