/* ── Layout ─────────────────────────────────────────────────────────────── */
body { display:flex; flex-direction:column; min-height:100vh; }
body > div.container-fluid { flex:1; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  background: #1a3a5c;
  padding: 8px 0;
}
.site-logo {
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: -.5px;
}
.site-logo strong { color: #5bc8f5; }
.site-logo span   { color: #8ab4cc; font-size:.85rem; }
.site-logo:hover  { color:#fff; }

.topbar-user .btn-outline-light { border-color: rgba(255,255,255,.4); }

/* ── Search bar ──────────────────────────────────────────────────────────── */
.searchbar {
  background: #2356a0;
  padding: 14px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.search-form { width:100%; }
.search-inner {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  max-width: 860px;
  margin: 0 auto;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.search-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 6px 16px;
  min-width: 0;
}
.search-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6c6c6c;
  margin-bottom: 1px;
}
.search-input {
  border: none;
  outline: none;
  font-size: .95rem;
  color: #222;
  background: transparent;
  width: 100%;
}
.search-input:focus-visible {
  outline: 2px solid #1a3a5c;
  outline-offset: -2px;
}
.search-input::placeholder { color: #767676; }
.search-divider {
  width: 1px;
  height: 36px;
  background: #e0e0e0;
  flex-shrink: 0;
}
.search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #e8431a;
  color: #fff;
  border: none;
  padding: 0 24px;
  height: 56px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.search-btn:hover { background: #c73a16; }

@media (max-width: 575px) {
  .search-inner { border-radius:6px; flex-wrap:wrap; }
  .search-field  { padding: 6px 12px; }
  .search-divider { display:none; }
  .search-btn    { width:100%; justify-content:center; height:44px; }
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar-wrapper {
  position: sticky;
  top: 16px;
}
.sidebar-nav { font-size: .875rem; }
.sidebar-heading {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #6c6c6c;
  padding: 0 0 8px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 4px;
}
.sidebar-btn {
  font-size: .875rem;
  font-weight: 500;
  color: #1a3a5c;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-btn::after {
  /* Bootstrap accordion arrow — keep it */
}
.sidebar-cat-link {
  color: #1a3a5c;
  text-decoration: none;
  flex: 1;
}
.sidebar-cat-link:hover { color: #2356a0; text-decoration: underline; }
.accordion-item { border:none !important; }
.accordion-button { box-shadow: none !important; background:none !important; }
.accordion-button:not(.collapsed) { color: #2356a0; }

.sidebar-sublist {
  margin: 0;
  padding: 0 0 8px 12px;
  border-left: 2px solid #e5e7eb;
}
.sidebar-sublink {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #444;
  text-decoration: none;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: .82rem;
}
.sidebar-sublink:hover { background:#f0f4ff; color:#2356a0; }
.sidebar-sublink.active { background:#e8f0fe; color:#2356a0; font-weight:600; }
.sidebar-count {
  font-size: .72rem;
  color: #6c6c6c;
  margin-left: 4px;
  white-space: nowrap;
}

/* Mobile offcanvas browse button */
.offcanvas-browse-btn {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

/* ── Home page ───────────────────────────────────────────────────────────── */
.page-title   { font-size:1.5rem; font-weight:700; margin-bottom:.25rem; }
.section-heading { font-size:1rem; font-weight:700; text-transform:uppercase;
                   letter-spacing:.05em; color:#555; margin-bottom:.75rem; }
.cat-card {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  text-decoration: none;
  color: #1a3a5c;
  font-size: .85rem;
  height: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.cat-card:hover { border-color:#2356a0; box-shadow:0 2px 8px rgba(35,86,160,.1); color:#2356a0; }
.cat-name { font-weight: 600; }
.cat-count { font-size:.72rem; color:#6c6c6c; margin-top:2px; }

/* County grid */
.county-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.county-link {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-size: .8rem;
  color: #444;
  text-decoration: none;
  transition: all .15s;
}
.county-link:hover { background:#2356a0; border-color:#2356a0; color:#fff; }

/* ── Business profile page ───────────────────────────────────────────────── */
.biz-header { background: #fff; }
.biz-logo   { border-color: #e5e7eb !important; }
.biz-stars  { letter-spacing: .05em; }

/* Dashed border card for claim CTA */
.card.border-dashed { border: 2px dashed #c8d6e5 !important; }

/* Address dl in sidebar */
address { font-style: normal; line-height: 1.7; color: #444; }

/* ── Business listing cards ──────────────────────────────────────────────── */
.biz-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.biz-card:hover {
  border-left-color: #2356a0;
  box-shadow: 0 3px 12px rgba(35,86,160,.1);
  transform: translateY(-1px);
  color: inherit;
  text-decoration: none;
}
.biz-card:hover .biz-card-name { color: #2356a0; }

.biz-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -.5px;
}
/* 8-colour palette keyed by first letter */
.biz-av-0 { background: #2356a0; }
.biz-av-1 { background: #0d7a5f; }
.biz-av-2 { background: #7c3aed; }
.biz-av-3 { background: #b45309; }
.biz-av-4 { background: #0891b2; }
.biz-av-5 { background: #be185d; }
.biz-av-6 { background: #15803d; }
.biz-av-7 { background: #9f1239; }

.biz-card-body   { flex: 1; min-width: 0; }
.biz-card-name   { font-weight: 600; font-size: .95rem; color: #1a1a2e; line-height: 1.3; transition: color .15s; }
.biz-card-cat    { display: inline-block; font-size: .72rem; color: #2356a0; background: #eff6ff;
                   border: 1px solid #bfdbfe; border-radius: 20px; padding: 1px 8px; margin-top: 3px; }
.biz-card-loc    { font-size: .8rem; color: #6b7280; margin-top: 3px; }
.biz-card-arrow  { color: #d1d5db; font-size: 1.1rem; flex-shrink: 0; transition: color .15s; }
.biz-card:hover .biz-card-arrow { color: #2356a0; }

.biz-verified    { font-size: .65rem; background: #dcfce7; color: #166534;
                   border: 1px solid #bbf7d0; border-radius: 20px;
                   padding: 1px 7px; vertical-align: middle; margin-left: 5px; }

/* Listing grid wrapper */
.biz-list { display: flex; flex-direction: column; gap: 8px; }

/* ── Star rating input ───────────────────────────────────────────────────── */
.star-input       { display: inline-flex; gap: 4px; }
.star-input .star { font-size: 1.6rem; color: #d1d5db; cursor: pointer;
                    line-height: 1; transition: color .1s; user-select: none; }
.star-input .star.active,
.star-input .star:hover { color: #f59e0b; }

/* ── Home hero ───────────────────────────────────────────────────────────── */
.home-hero {
  background: linear-gradient(135deg, #1a3a5c 0%, #2356a0 100%);
  border-radius: 12px;
  padding: 48px 40px;
  margin-bottom: 2rem;
  color: #fff;
}
.home-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; }
.home-hero p  { color: rgba(255,255,255,.8); font-size: 1.05rem; }
.home-stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px 16px;
  text-align: center;
}
.home-stat-num  { font-size: 1.6rem; font-weight: 800; color: #1a3a5c; line-height: 1; }
.home-stat-label{ font-size: .78rem; color: #6b7280; margin-top: 4px; }

/* How it works steps */
.how-step       { text-align: center; padding: 20px 10px; }
.how-step-num   { width: 40px; height: 40px; border-radius: 50%;
                  background: #2356a0; color: #fff; font-weight: 700;
                  font-size: 1.1rem; display: flex; align-items: center;
                  justify-content: center; margin: 0 auto 12px; }
.how-step-title { font-weight: 700; font-size: .95rem; margin-bottom: 4px; }
.how-step-desc  { font-size: .82rem; color: #6b7280; }

/* Recent claimed cards */
.recent-biz-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 8px;
  text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.recent-biz-card:hover { border-color: #2356a0; box-shadow: 0 2px 8px rgba(35,86,160,.1); color: inherit; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer a:hover { color: #333 !important; text-decoration: underline !important; }

/* ── Review empty state ──────────────────────────────────────────────────── */
.review-empty-state {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
}
.review-empty-stars {
  font-size: 2rem;
  letter-spacing: .1em;
  color: #d1d5db;
  /* animate stars in on load */
  animation: stars-fade-in .6s ease forwards;
}
@keyframes stars-fade-in {
  from { color: #d1d5db; }
  to   { color: #f59e0b; }
}

/* ── Review CTA card (logged-out) ────────────────────────────────────────── */
.review-cta-card {
  background: #f8faff;
  border: 1.5px dashed #bfdbfe;
}

/* ── Business logo thumbnail in cards ───────────────────────────────────── */
.biz-logo-sm {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
}

/* ── Recently viewed (sidebar widget) ───────────────────────────────────── */
.rv-list { list-style: none; padding: 0; margin: 0; }
.rv-item a {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0;
  font-size: .82rem;
  color: #1a3a5c;
  text-decoration: none;
  border-bottom: 1px solid #f3f4f6;
}
.rv-item a:hover { color: #2356a0; }
.rv-item .rv-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Open now badge (already uses Bootstrap badge, this is just a helper) ─ */
.open-now-badge { white-space: nowrap; }

/* ── Print styles ────────────────────────────────────────────────────────── */
@media print {
  .topbar, .searchbar, footer, .sidebar-wrapper, aside,
  .offcanvas-browse-btn, .btn, nav.breadcrumb, #shareBtn,
  .biz-card-arrow, .copy-phone, script { display: none !important; }
  body { font-size: 11pt; color: #000; }
  .biz-header { border: 1px solid #ccc !important; }
  a { color: #000 !important; text-decoration: none !important; }
  .col-lg-8 { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
  .card { border: 1px solid #ccc !important; page-break-inside: avoid; }
}

/* ── Reduced-motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .biz-card, .cat-card, .county-link, .recent-biz-card {
    transition: none !important;
    transform: none !important;
  }
}
