/* ── Autocomplete ── */
#suggest-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 100;
    max-height: 320px;
    overflow-y: auto;
}
#suggest-box li {
    padding: .6rem 1rem;
    cursor: pointer;
    font-size: .9rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}
#suggest-box li:last-child { border-bottom: none; }
#suggest-box li:hover, #suggest-box li.active {
    background: #f0f9ff;
    color: #1d4ed8;
}
#suggest-box li strong { font-weight: 700; color: #111; }

/* ── Search hint ── */
.search-hint {
    font-size: .78rem;
    color: #6b7280;
    padding: .25rem .5rem;
    background: #f0f9ff;
    border-radius: 4px;
    margin-top: .25rem;
}

/* ── Filters bar ── */
.search-filters {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin: .75rem 0 1rem;
    align-items: center;
}
.filter-label { font-size: .8rem; color: #6b7280; font-weight: 600; }
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .25rem .75rem;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: .8rem;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}
.filter-chip:hover { border-color: #3b82f6; color: #1d4ed8; background: #eff6ff; }
.filter-chip.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.filter-chip.active:hover { background: #2563eb; }

/* ── Related searches ── */
.related-searches {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}
.related-searches h3 {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #6b7280;
    font-weight: 700;
    margin: 0 0 .6rem;
}
.related-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.related-chip {
    padding: .3rem .8rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: .82rem;
    color: #374151;
    text-decoration: none;
    transition: all .15s;
}
.related-chip:hover { border-color: #3b82f6; color: #1d4ed8; background: #eff6ff; }

/* ── Did you mean ── */
.did-you-mean {
    font-size: .9rem;
    color: #374151;
    margin-bottom: 1rem;
}
.did-you-mean a { color: #1d4ed8; font-style: italic; }
/* ===========================================
   MOBILE RESPONSIVE - append to respective CSS files
   Breakpoints: 768px (tablet), 480px (phone)
   =========================================== */

/* ============================================
   style.css additions
   ============================================ */

/* ---- Search results header ---- */
@media (max-width: 768px) {
  .results-header { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .75rem 1rem; }
  .search-form-top { width: 100%; max-width: none; }
  .search-form-top input[type="text"] { font-size: 16px; } /* prevent iOS zoom */
  .results-main { padding: .75rem 1rem; flex-direction: column; }
  .results-col { width: 100%; }
  .biz-panel { margin-bottom: 1rem; width: 100%; }
  .result-item { padding: .75rem 0; }
  .result-title { font-size: 1rem; }
  .result-url { font-size: .75rem; }
  .search-filters { gap: .3rem; }
  .filter-chip { font-size: .75rem; padding: .2rem .55rem; }
  /* Home page */
  .home-wrap { padding: 1.5rem 1rem; }
  .logo-large { font-size: 2.2rem; }
  .search-box { flex-direction: row; }
  .search-box input { font-size: 16px; }
  /* Pagination */
  .pagination { flex-wrap: wrap; gap: .3rem; justify-content: center; }
}

@media (max-width: 480px) {
  .logo-large { font-size: 1.8rem; }
  .results-header { padding: .5rem .75rem; }
  .results-main { padding: .5rem .75rem; }
  .biz-listing-row { flex-direction: column; align-items: flex-start; }
  .biz-listing-btns { width: 100%; }
  .biz-listing-btns a { flex: 1; text-align: center; }
}

/* ============================================
   admin.css additions
   ============================================ */

@media (max-width: 768px) {
  /* Collapse sidebar to top nav on mobile */
  .admin-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    overflow-y: visible;
    padding: .5rem;
  }
  .sidebar-logo { padding: .5rem .75rem; border-bottom: none; flex: 0 0 auto; }
  .sidebar-nav { display: flex; flex-direction: row; flex-wrap: wrap; gap: .25rem; padding: .25rem; width: 100%; }
  .sidebar-nav a { padding: .35rem .7rem; font-size: .78rem; border-radius: 6px; }
  .sidebar-footer { display: none; }
  .admin-main { padding: 1rem; min-height: auto; }
  .admin-topbar { flex-wrap: wrap; gap: .5rem; padding: .75rem 1rem; }
  /* Stats grid */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .stat-card { padding: .75rem; }
  .stat-num { font-size: 1.5rem; }
  /* Tables */
  .users-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .users th, .users td { padding: .4rem .5rem; font-size: .78rem; white-space: nowrap; }
  /* Tab nav */
  .tab-nav { gap: .25rem; }
  .tab-link { padding: .3rem .6rem; font-size: .75rem; }
  /* Search bar */
  .admin-search-form { flex-wrap: wrap; }
  .admin-search-form input { width: 100%; }
  /* Crawl activity */
  .crawl-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  /* Action buttons */
  .actions { flex-wrap: wrap; gap: .25rem; }
  .act-btn { padding: .25rem .5rem; font-size: .72rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-main { padding: .75rem; }
  .sidebar-nav a { font-size: .72rem; padding: .3rem .5rem; }
}

/* ============================================
   user.css additions
   ============================================ */

@media (max-width: 768px) {
  /* Dashboard header */
  .dash-header { flex-wrap: wrap; gap: .5rem; padding: .75rem 1rem; }
  .dash-nav { gap: .5rem; }
  .dash-nav a { font-size: .82rem; }
  /* Welcome section */
  .dash-welcome { padding: 1rem; }
  .dash-container { padding: 1rem; }
  /* Grid */
  .dash-grid { grid-template-columns: 1fr; gap: .75rem; }
  .dash-card { padding: 1rem; }
  .dash-card-wide { grid-column: 1; }
  /* Business listing */
  .biz-listing-row { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .biz-listing-btns { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); }
  .biz-listing-btns a { text-align: center; }
  /* Auth forms */
  .auth-card { padding: 1.5rem 1rem; margin: 1rem; }
  .form-row { grid-template-columns: 1fr; }
  /* Buttons */
  .btn-primary, .btn-secondary { width: 100%; text-align: center; padding: .65rem 1rem; }
}

@media (max-width: 480px) {
  .dash-header { padding: .5rem .75rem; }
  .dash-container { padding: .75rem; }
  .dash-welcome h1 { font-size: 1.25rem; }
  .biz-listing-btns { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   business.css additions
   ============================================ */

@media (max-width: 768px) {
  /* Knowledge panel */
  .biz-panel { padding: 1rem; }
  .biz-panel-header { flex-direction: column; gap: .5rem; }
  .biz-map-links { flex-wrap: wrap; gap: .4rem; }
  .biz-map-btn { flex: 1; text-align: center; min-width: 100px; }
  /* Hours table */
  .biz-hours-table { font-size: .82rem; }
  .biz-hours-table td, .biz-hours-table th { padding: .3rem .4rem; }
  /* OSM map */
  .biz-osm-wrap iframe { height: 160px; }
  /* Submit/manage forms */
  .biz-submit-wrap { padding: 1rem; }
  .biz-form label { font-size: .88rem; }
  .field-row { flex-direction: column; gap: .5rem; }
  /* Hours grid */
  .hours-header { grid-template-columns: 80px 50px 1fr 1fr 70px; font-size: .72rem; }
  .hours-row    { grid-template-columns: 80px 50px 1fr 1fr 70px; }
  .copy-hours-btn { font-size: .65rem; padding: .15rem .3rem; }
  /* Category grid */
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  /* Nearby grid */
  .nearby-grid { grid-template-columns: 1fr 1fr; }
  /* Reviews */
  .review-header { flex-wrap: wrap; gap: .3rem; }
  .star-picker label { font-size: 1.6rem; }
  /* Nearby controls */
  .nearby-controls { flex-direction: column; align-items: stretch; }
  .nearby-controls select { width: 100%; }
}

@media (max-width: 480px) {
  .biz-panel { padding: .75rem; }
  .biz-map-links { flex-direction: column; }
  .biz-map-btn, .biz-website-btn { width: 100%; text-align: center; }
  .hours-header { display: none; } /* hide header, labels on inputs instead */
  .hours-row { grid-template-columns: 1fr 40px 1fr 1fr; gap: .25rem; }
  .copy-hours-btn { display: none; } /* too small, use copy all buttons instead */
  .category-grid { grid-template-columns: 1fr; }
  .nearby-grid { grid-template-columns: 1fr; }
  .biz-category-list .biz-list-card { flex-direction: column; align-items: flex-start; }
}

/* ============================================
   search_enhancements.css additions
   ============================================ */

@media (max-width: 768px) {
  #suggest-box { border-radius: 0 0 8px 8px; }
  #suggest-box li { padding: .7rem 1rem; font-size: .88rem; }
  .related-searches { padding: .75rem 1rem; margin: 1rem 0; }
  .related-chip { font-size: .78rem; padding: .25rem .65rem; }
  .search-filters { padding: 0 .25rem; }
}

/* ============================================
   Global mobile utilities
   ============================================ */

/* Prevent horizontal scroll */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100vw; }
  img { max-width: 100%; height: auto; }
  table { max-width: 100%; }

  /* Touch-friendly tap targets */
  button, a, input[type="checkbox"], input[type="radio"] { min-height: 36px; }
  input[type="checkbox"], input[type="radio"] { min-height: auto; width: 18px; height: 18px; }

  /* Prevent iOS font size adjustment */
  * { -webkit-text-size-adjust: 100%; }

  /* Better scrollable tables */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
}
