/* ============================================================
   BizNiz.ma Map Pages CSS
   Colors: --navy #19376D  --gold #FFA800  --gold-dark #D98F00
   ============================================================ */

/* ── Loader ── */
body.loading { overflow: hidden; }
.biz-loader {
    position: fixed; inset: 0;
    background: white;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 99999;
    transition: opacity .5s, visibility .5s;
}
.biz-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.biz-loader img { width: 140px; margin-bottom: 28px; }
.biz-loader-bar-wrap {
    width: 220px; height: 4px;
    background: rgba(0,0,0,.1);
    border-radius: 4px; overflow: hidden;
    margin-bottom: 16px;
}
.biz-loader-bar {
    height: 100%; width: 0;
    background: linear-gradient(90deg, #FFA800, #D98F00);
    border-radius: 4px;
    transition: width .3s ease;
}
.biz-loader-text { color: #6b7280; font-size: 13px; font-family: 'Poppins', sans-serif; }

/* ── Map container (main non-city page) ── */
.map-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 0;
}
#map {
    height: 500px;
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
}
.red-bar {
    height: 3px; width: 100px;
    background: linear-gradient(135deg, #FFA800, #D98F00);
    margin-bottom: 20px;
    border-radius: 2px;
}

/* ── Search bar ── */
.search-container {
    margin-bottom: 20px;
    display: flex; gap: 10px;
    max-width: 600px;
}
.search-input {
    flex: 1; padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px; font-size: 15px;
    outline: none; font-family: 'Poppins', sans-serif;
    transition: border-color .2s;
}
.search-input:focus { border-color: #FFA800; }
.search-button {
    padding: 12px 22px;
    background: linear-gradient(135deg, #FFA800, #D98F00);
    color: white; border: none; border-radius: 8px;
    cursor: pointer; font-size: 15px;
    font-family: 'Poppins', sans-serif; font-weight: 600;
    transition: opacity .2s;
}
.search-button:hover { opacity: .88; }
.error-message { color: #e53e3e; margin-top: 6px; display: none; font-size: 13px; }

/* ── Type filter ── */
.filter-container {
    display: flex; gap: 12px;
    align-items: center; margin-bottom: 16px;
    flex-wrap: wrap;
}
.type-filter-dropdown { position: relative; }
.type-filter-button {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    border: 2px solid #FFA800; color: #19376D;
    background: white; border-radius: 8px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: background .15s;
}
.type-filter-button:hover { background: rgba(255,168,0,.08); }
.type-filter-menu {
    position: absolute; top: calc(100% + 4px); left: 0;
    background: white; border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    z-index: 500; min-width: 210px;
    display: none; max-height: 280px; overflow-y: auto;
}
.type-filter-menu.open { display: block; z-index: 1500; }
.type-filter-option {
    padding: 8px 14px; font-size: 13px;
    cursor: pointer; color: #374151;
    border-bottom: 1px solid #f3f4f6;
    font-family: 'Poppins', sans-serif;
}
.type-filter-option:last-child { border-bottom: none; }
.type-filter-option:hover { background: #fff7e6; color: #19376D; }
.type-filter-option.active { background: #19376D; color: white; }
.clear-filters {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #FFA800, #D98F00);
    color: white; border: none; border-radius: 8px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: 'Poppins', sans-serif;
}
.clear-filters:hover { opacity: .88; }

/* ── Stats counter ── */
.statistics-section { padding: 3rem 0; }
.counter-box {
    background: white; border-radius: 14px; padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    border-top: 3px solid #FFA800;
    transition: transform .3s;
}
.counter-box:hover { transform: translateY(-4px); }
.counter-number { font-size: 2.5rem; font-weight: 800; color: #19376D; margin-bottom: .4rem; }
.counter-label { font-size: 1rem; color: #6b7280; }

/* ── Popup ── */
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.leaflet-popup-content { margin: 16px 5px 15px 5px !important; }
.leaflet-control-attribution a[title="A JS library for interactive maps"] { display: none !important; }

/* ──────────────────────────────────────────
   SPLIT VIEW (city page)
   ────────────────────────────────────────── */
.split-wrapper {
    display: flex;
    height: calc(100vh - 64px);
    margin-top: 64px;
    overflow: hidden;
}
.cards-panel {
    width: 40%; overflow-y: auto;
    padding: 16px 20px; background: #fff;
    border-right: 1px solid #e8e8f0;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}
.map-panel { width: 60%; position: relative; flex-shrink: 0; }
.map-panel #map {
    height: 100% !important; width: 100% !important;
    border-radius: 0 !important; box-shadow: none !important;
}

/* ── City heading ── */
.city-h1 {
    font-size: 1.25rem; font-weight: 700; color: #19376D;
    margin: 8px 0 4px; line-height: 1.3;
    font-family: 'Poppins', sans-serif;
}
.city-count-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFA800, #D98F00);
    color: white; font-size: 12px; font-weight: 700;
    padding: 3px 10px; border-radius: 12px; margin-bottom: 12px;
}

/* ── Business cards (in split view) ── */
.church-card {
    display: flex; gap: 12px;
    border-radius: 16px; border: 2px solid #e8e8f0;
    padding: 12px; margin-bottom: 10px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
    background: white;
}
.church-card:hover { border-color: #FFA800; box-shadow: 0 2px 10px rgba(255,168,0,.18); }
.church-card.active {
    border-color: #FFA800;
    background: rgba(255,168,0,.05);
    box-shadow: 0 2px 10px rgba(255,168,0,.25);
}
.church-card-img {
    width: 76px; height: 76px;
    object-fit: cover; border-radius: 10px; flex-shrink: 0;
}
.church-card-img-placeholder {
    width: 76px; height: 76px; border-radius: 10px;
    background: linear-gradient(135deg, #FFA800, #D98F00);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: white; font-size: 26px;
}
.church-card-body { flex: 1; min-width: 0; }
.church-card-name {
    font-weight: 700; font-size: 13px; color: #19376D;
    margin-bottom: 3px; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.church-card-type {
    display: inline-block;
    background: rgba(255,168,0,.15); color: #19376D;
    font-size: 10px; font-weight: 600;
    padding: 2px 7px; border-radius: 8px; margin-bottom: 4px;
}
.church-card-address {
    font-size: 11px; color: #888; margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4;
}
.church-card-footer { display: flex; align-items: center; justify-content: space-between; }
.church-card-link {
    display: inline-block; background: #19376D;
    color: white; padding: 4px 10px; border-radius: 10px;
    font-size: 11px; font-weight: 600; text-decoration: none;
    transition: background .15s;
}
.church-card-link:hover { background: #FFA800; color: #19376D; text-decoration: none; }

/* ── Load more ── */
.load-more-cards {
    display: block; width: 100%; padding: 10px;
    background: #fafafa; border: 1px dashed #FFA800;
    border-radius: 12px; color: #19376D;
    font-size: 13px; font-weight: 600; text-align: center;
    cursor: pointer; transition: background .15s; margin-top: 4px;
    font-family: 'Poppins', sans-serif;
}
.load-more-cards:hover { background: rgba(255,168,0,.08); }

/* ── Show All Businesses button ── */
.show-all-btn {
    display: block; width: 100%; padding: 11px;
    background: #19376D; border: none;
    border-radius: 12px; color: #fff;
    font-size: 13px; font-weight: 600; text-align: center;
    cursor: pointer; transition: background .15s; margin-top: 8px;
    font-family: 'Poppins', sans-serif; text-decoration: none;
}
.show-all-btn:hover { background: #FFA800; color: #fff; }

/* ── View-on-map button (mobile) ── */
.view-on-map-btn {
    display: none;
    position: absolute; bottom: 50%; left: 50%;
    transform: translate(-50%, 50%);
    background: rgba(20,20,20,.88); color: white;
    border: none; border-radius: 50px; padding: 11px 24px;
    font-size: 15px; font-weight: 700; cursor: pointer;
    z-index: 500; align-items: center; gap: 8px;
    white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,.35);
    font-family: 'Poppins', sans-serif;
}
.view-on-map-btn:hover { background: #000; }

/* ── Tablet + Mobile responsive ── */
@media (max-width: 1024px) {
    .map-container { padding: 72px 16px 0; }
    .split-wrapper { flex-direction: column; height: auto; overflow: visible; margin-top: 64px; }
    .map-panel {
        order: -1; width: 100%; height: 220px;
        position: relative; overflow: hidden; flex-shrink: 0;
    }
    .map-panel #map {
        height: 220px !important;
        pointer-events: none;
        filter: blur(4px); opacity: .5;
        transition: filter .3s, opacity .3s;
    }
    .map-panel.map-expanded { position: fixed !important; inset: 0; width: 100vw !important; height: 100vh !important; z-index: 9999; overflow: visible; }
    .map-panel.map-expanded #map { height: 100% !important; pointer-events: all; filter: none !important; opacity: 1 !important; }
    .map-panel.map-expanded .view-on-map-btn { display: flex !important; bottom: 80px; top: auto; left: 50%; transform: translateX(-50%); }
    .cards-panel { width: 100%; border-right: none; border-top: 1px solid #e8e8f0; max-height: none; overflow-y: visible; }
    .view-on-map-btn { display: flex; }
    .map-panel #map { height: 450px !important; }
    .search-container { max-width: 100%; }
    .search-input { min-width: 0; font-size: 14px; padding: 10px; }
    .search-button { padding: 10px 14px; font-size: 14px; white-space: nowrap; }
    .biz-listing-container { padding: 80px 16px 40px; }
    .church-card-img, .church-card-img-placeholder { width: 64px; height: 64px; }
}

/* ── Single listing page ── */
.biz-listing-container { max-width: 1200px; margin: 0 auto; padding: 80px 20px 60px; }
.biz-info-card {
    border-radius: 16px; padding: 1.5rem; margin-bottom: 1rem;
    color: white; font-family: 'Poppins', sans-serif;
}
.biz-info-card h5 { font-size: 1.3rem; font-weight: 700; margin-bottom: .6rem; }
.biz-info-card ul { padding-left: 1.2rem; margin: 0; font-size: 1rem; line-height: 1.8; }
.biz-info-card p { font-size: 1rem; margin: 0; line-height: 1.7; }
.hoverable-card { transition: transform .2s; }
.hoverable-card:hover { transform: translateY(-2px); }

/* ── Review cards ── */
.review-card {
    background: white; border-radius: 16px; overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    border: 2px solid #FFA800;
}
.review-card .review-img { height: 180px; object-fit: cover; width: 100%; }
.review-card .review-stars-badge {
    position: absolute; top: 10px; left: 10px;
    background: rgba(255,255,255,.95); padding: 5px 10px;
    border-radius: 10px; font-size: 11px; font-weight: 600;
}
.review-card .card-body { padding: 16px; }
.review-card .review-text { font-size: 13px; color: #555; line-height: 1.6; margin-bottom: 10px; }
.review-card .review-author { font-size: 13px; font-weight: 700; color: #19376D; }

/* ── Nearby businesses ── */
.nearby-card {
    border-radius: 16px; border: 2px solid #e8e8f0;
    overflow: hidden; transition: border-color .2s;
    text-decoration: none; color: inherit;
    display: block;
}
.nearby-card:hover { border-color: #FFA800; text-decoration: none; color: inherit; }
.nearby-card img { height: 180px; object-fit: cover; width: 100%; }
.nearby-card-placeholder {
    height: 180px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #FFA800, #D98F00);
    color: white; font-size: 42px;
}
.nearby-card .card-body { padding: 16px; }
.nearby-card h5 { font-size: 14px; font-weight: 700; color: #19376D; margin-bottom: 4px; }
.nearby-card .nearby-meta { font-size: 12px; color: #888; margin-bottom: 10px; }
.nearby-card .nearby-link {
    display: inline-flex; align-items: center; gap: 5px;
    background: #19376D; color: white; padding: 6px 14px;
    border-radius: 10px; font-size: 12px; font-weight: 600;
    text-decoration: none;
}
.nearby-card .nearby-link:hover { background: #FFA800; color: #19376D; text-decoration: none; }

/* ── FAQ accordion ── */
.biz-faq .accordion-item { border: 1px solid #e5e7eb; margin-bottom: 8px; border-radius: 10px !important; overflow: hidden; }
.biz-faq .accordion-button { font-weight: 600; font-size: 14px; font-family: 'Poppins', sans-serif; background: white; color: #19376D; }
.biz-faq .accordion-button:not(.collapsed) { background: #fff7e6; color: #19376D; box-shadow: none; }
.biz-faq .accordion-button::after { filter: hue-rotate(200deg) saturate(3); }

/* ── Breadcrumb ── */
.biz-breadcrumb { font-size: 13px; color: #aaa; margin-bottom: 12px; }
.biz-breadcrumb a { color: #aaa; text-decoration: none; }
.biz-breadcrumb a:hover { color: #FFA800; }
.biz-breadcrumb span { color: #19376D; font-weight: 600; }
