/**
 * Styling for the dynamic pages. Sits on top of the theme's own stylesheet and
 * borrows its tokens — the #ec2028 red, the card treatment, Roboto — so the
 * generated pages read as part of the same design.
 */

:root {
    --n49-red: #ec2028;
    --n49-ink: #3b3b3b;
    --n49-line: #e7e7e7;
    --n49-muted: #8a8a8a;
}

/* ------------------------------------------------------------- result rows */

.n49-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-size: 14px; }
.n49-row svg { flex: 0 0 auto; }
.n49-row a { color: var(--n49-ink); }
.n49-row a:hover { color: var(--n49-red); }

.n49-categories { font-size: 13px; color: var(--n49-muted); margin-top: 6px; }
.n49-categories a { color: var(--n49-muted); text-decoration: underline; }
.n49-categories a:hover { color: var(--n49-red); }

.n49-verified,
.n49-flag { display: inline-block; vertical-align: middle; margin-left: 5px; }
.n49-flag img { width: 20px; height: auto; border-radius: 50%; }

.info-box { position: relative; }
.info-box.is-ad { border-color: var(--n49-red); }

.n49-ad-flag {
    position: absolute; top: 10px; right: 10px;
    background: var(--n49-red); color: #fff;
    font-size: 11px; line-height: 1; letter-spacing: .04em;
    padding: 4px 7px; border-radius: 3px; text-transform: uppercase;
}

.n49-offer {
    background: #fff6f6; border: 1px solid var(--n49-red); border-radius: 6px;
    padding: 8px 12px; margin-top: 10px; font-size: 13px;
}
.n49-offer a { color: var(--n49-red); font-weight: 700; }

.n49-latest-review p { font-style: italic; color: #555; font-size: 13px; }
.n49-avatar { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; }

.n49-delivery {
    display: inline-block; padding: 5px 10px; margin-right: 6px;
    border: 1px solid var(--n49-line); border-radius: 6px;
    font-size: 12px; color: var(--n49-ink);
}
.n49-delivery:hover { border-color: var(--n49-red); color: var(--n49-red); }

/* ---------------------------------------------------------------- filters */

/* search-app's filter sidebar is collapsed by default and expands over the
   result list; the theme's overlay behaves the same way, so it is kept. The
   panel scrolls independently and closes with the same button that opened it. */
.directory .filters {
    max-height: calc(100vh - var(--n49-header-h, 62px));
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, .08);
}
.directory .filters .results { position: relative; }
.directory .filters .btn-filters { position: absolute; right: 16px; top: 14px; }

.filters .btn-tab { cursor: pointer; }
.filters .filter[hidden] { display: none; }

.btn-clear-filters.is-hidden { display: none; }

.filter-checkbox-wrapper {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 5px 0; cursor: pointer; overflow: hidden;
}
.filter-checkbox-check {
    flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px;
    border: 1px solid #c9c9c9; border-radius: 3px; background: #fff;
    position: relative;
}
.filter-checkbox-wrapper.checked .filter-checkbox-check {
    background: var(--n49-red); border-color: var(--n49-red);
}
.filter-checkbox-wrapper.checked .filter-checkbox-check::after {
    content: ''; position: absolute; left: 5px; top: 1px;
    width: 4px; height: 9px; border: solid #fff;
    border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.filter-checkbox-caption { font-size: 13px; line-height: 1.35; color: var(--n49-ink); }
.filter-checkbox-wrapper:hover .filter-checkbox-caption { color: var(--n49-red); }
.checkbox-val { color: var(--n49-muted); }

.show-all-button {
    display: inline-block; margin-top: 8px;
    color: var(--n49-red); font-size: 13px; font-weight: 700; cursor: pointer;
}
.show-all-button[hidden] { display: none; }

/* Minimum-rating rows */
.n49-rating-option {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 0; cursor: pointer;
}
.n49-rating-stars { margin: 0 !important; display: inline-block; vertical-align: middle; }
.n49-rating-label { font-size: 13px; color: var(--n49-muted); }
.n49-rating-option.selected .n49-rating-label { color: var(--n49-red); font-weight: 700; }
.n49-rating-clear { display: none; margin-left: auto; }
.n49-rating-clear svg { width: 18px; height: 18px; }
.n49-rating-option.selected .n49-rating-clear { display: inline-block; }

#n49-filter-reviews { width: 100%; accent-color: var(--n49-red); }
.search-filter-values { overflow: hidden; font-size: 12px; color: var(--n49-muted); margin-top: 4px; }
.search-filter-values .pull-left { float: left; }
.search-filter-values .pull-right { float: right; }

.n49-pagination { display: flex; flex-wrap: wrap; gap: 6px; padding: 16px; }
.n49-pagination .btn.active { background: var(--n49-red); color: #fff; border-color: var(--n49-red); }

/* ----------------------------------------------------------- autocomplete */

.n49-suggest {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 999;
    background: #fff; border: 1px solid var(--n49-line); border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    max-height: 320px; overflow-y: auto; margin-top: 4px;
}

.n49-suggest-item {
    padding: 9px 12px; cursor: pointer; font-size: 14px;
    display: flex; justify-content: space-between; gap: 10px;
}
.n49-suggest-item em { color: var(--n49-muted); font-style: normal; font-size: 12px; }
.n49-suggest-item:hover,
.n49-suggest-item.active { background: #f7f7f7; }

/* --------------------------------------------------------------- details */

.n49-status {
    border-radius: 6px; padding: 10px 14px; margin-bottom: 16px;
    font-weight: 700; font-size: 14px;
}
.n49-status-closed { background: #fdecec; color: #b71c1c; }
.n49-status-soon { background: #eaf5ea; color: #2e7d32; }

.n49-gallery { display: flex; gap: 4px; overflow: hidden; border-radius: 8px; }
.n49-gallery-item { flex: 1 1 0; min-width: 0; display: block; max-height: 320px; overflow: hidden; }
.n49-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.n49-gallery-video { position: relative; }
.n49-gallery-video::after {
    content: '▶'; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 34px; text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}

.n49-claimed { font-size: 13px; font-weight: 700; }
.n49-claimed.claimed { color: #2e7d32; }
.n49-claimed.unclaimed { color: var(--n49-red); }
.n49-updated { font-size: 12px; color: var(--n49-muted); }

.n49-social {
    display: inline-block; padding: 5px 10px; margin: 0 6px 6px 0;
    border: 1px solid var(--n49-line); border-radius: 6px; font-size: 12px;
}
.n49-social:hover { border-color: var(--n49-red); color: var(--n49-red); }

.n49-detail-block { margin-bottom: 14px; }
.n49-detail-block p { display: flex; align-items: center; gap: 6px; }

.n49-hours { list-style: none; margin: 6px 0 0; padding: 0; }
.n49-hours li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 3px 0; }
.n49-hours .hour-day { color: var(--n49-muted); }

.widget .content p { font-size: 13px; margin: 5px 0; }

/* ------------------------------------------------------------- review feed */

.reviews { margin-top: 10px; }

.reviews .review {
    padding: 18px 0;
    border-bottom: 1px solid var(--n49-line);
}
.reviews .review:last-of-type { border-bottom: 0; }

.n49-review-head { display: flex; align-items: flex-start; gap: 12px; }

.n49-review-avatar { flex: 0 0 44px; width: 44px; height: 44px; }
.n49-review-avatar img {
    width: 44px; height: 44px; border-radius: 50%;
    object-fit: cover; background: #f1f1f1;
}
.n49-review-avatar svg { width: 44px; height: 44px; }

.n49-review-meta { min-width: 0; }

.n49-review-author {
    font-size: 15px; font-weight: 700; color: var(--n49-ink);
    margin: 0 0 3px;
}

.n49-review-pinned {
    display: inline-block; margin-left: 6px; padding: 2px 7px;
    background: #f1f1f1; color: var(--n49-muted);
    border-radius: 10px; font-size: 11px; font-weight: 500;
}

.n49-review-sub {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    font-size: 12px; color: var(--n49-muted);
}
/* The star sprite comes from the theme; just neutralise the wrapper's own
   block-level margins so it sits inline with the date. */
.n49-review-stars { margin: 0 !important; display: inline-block; vertical-align: middle; }
.n49-review-stars .rating { display: inline-block; vertical-align: middle; }

.n49-review-title {
    font-weight: 700; color: var(--n49-ink);
    margin: 12px 0 4px; font-size: 14px;
}

/* The theme colours generic paragraphs inside cards like links; reviews are
   body copy and must read as such. */
.reviews .review p.n49-review-text {
    margin: 10px 0 0;
    color: var(--n49-ink);
    font-size: 14px;
    line-height: 1.55;
}

.n49-review-images { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.n49-review-images img {
    width: 84px; height: 84px; object-fit: cover; border-radius: 6px; display: block;
}

.n49-review-reply {
    margin: 12px 0 0 16px;
    padding: 10px 14px;
    background: #f7f7f7;
    border-left: 3px solid var(--n49-red);
    border-radius: 0 6px 6px 0;
}
.reviews .review .n49-review-reply p {
    margin: 0; color: var(--n49-ink); font-size: 13px; line-height: 1.5;
}
.n49-reply-head {
    font-weight: 700; font-size: 12px !important;
    color: var(--n49-muted) !important; margin-bottom: 4px !important;
}
.n49-reply-head time { font-weight: 400; margin-left: 8px; }

.n49-review-extra { display: none; }
.reviews.n49-show-all-reviews .n49-review-extra { display: block; }
.reviews.n49-show-all-reviews .n49-reviews-more-wrap { display: none; }
.n49-reviews-more-wrap { text-align: center; padding: 18px 0 0; }

.n49-platforms {
    display: flex; justify-content: center; flex-wrap: wrap;
    gap: 8px; margin-top: 10px;
}
.n49-platform {
    font-size: 12px; color: var(--n49-ink);
    border: 1px solid var(--n49-line); border-radius: 20px; padding: 4px 12px;
}
.n49-platform strong { margin-right: 5px; }
.n49-platform em { color: var(--n49-muted); font-style: normal; }

.n49-empty { color: var(--n49-muted); padding: 20px 0; }
.n49-center { justify-content: center; }

/* --------------------------------------------------------------- pricing */

.n49-pricing { padding: 60px 0; }
.n49-pricing-note { color: var(--n49-red); font-weight: 700; margin-top: 8px; }

.n49-plans { align-items: flex-start; gap: 24px; }

.n49-plan { padding: 26px 22px; text-align: center; height: 100%; position: relative; }
.n49-plan-featured { border: 2px solid var(--n49-red); }

.n49-plan-tag {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--n49-red); color: #fff; font-size: 11px;
    padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}

.n49-plan-price { font-size: 34px; font-weight: 700; color: var(--n49-ink); margin-top: 10px; }
.n49-plan-period { color: var(--n49-muted); font-size: 14px; }
.n49-plan-yearly { color: var(--n49-muted); font-size: 12px; margin-top: 4px; }

.n49-plan-features { list-style: none; margin: 22px 0 0; padding: 0; text-align: left; }
.n49-plan-features li { font-size: 13px; padding: 7px 0 7px 24px; position: relative; border-top: 1px solid var(--n49-line); }
.n49-plan-features li::before { position: absolute; left: 0; top: 7px; font-weight: 700; }
.n49-plan-features li.yes::before { content: '✓'; color: #2e7d32; }
.n49-plan-features li.no::before { content: '✕'; color: #c62828; }
.n49-plan-features li.no { color: var(--n49-muted); }

/* ------------------------------------------------- add-business / review */

.n49-submit { padding: 60px 0; }
.n49-submit-intro { max-width: 640px; margin: 10px auto 0; color: var(--n49-muted); }

.n49-submit-form {
    display: flex; gap: 10px; flex-wrap: wrap;
    justify-content: center; margin: 28px auto 0; max-width: 760px;
}
.n49-submit-form label { position: relative; flex: 1 1 240px; }
.n49-submit-form input {
    width: 100%; padding: 12px 16px;
    border: 1px solid var(--n49-line); border-radius: 24px; font-size: 14px;
}
.n49-submit-form input:focus { outline: none; border-color: var(--n49-red); }

.n49-submit-results { max-width: 760px; margin: 26px auto 0; }
.n49-submit-hit { margin-bottom: 14px; }
.n49-submit-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.n49-submit-status { text-align: center; color: var(--n49-muted); padding: 16px 0; }

.n49-submit-none { margin-top: 26px; color: var(--n49-muted); }
.n49-submit-none .btn { margin-left: 10px; }

.screen-reader-text {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------- layout */

.n49-notfound { padding: 80px 0; }
.n49-featured-spot:empty { display: none; }

/* ------------------------------------------------------------------ maps */

.acf-map .marker { display: none; }
.acf-map { background: #e8eaed; }

.n49-pin svg { display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }

.n49-map-popup { font: 400 13px/1.45 "Roboto", sans-serif; min-width: 160px; }
.n49-map-popup strong { display: block; font-size: 14px; margin-bottom: 2px; }
.n49-map-popup a { color: var(--n49-ink); }
.n49-map-popup a:hover { color: var(--n49-red); }
.n49-map-popup p { margin: 0; color: var(--n49-muted); }

/* The results column is arbitrarily tall, and the theme sizes the map at
   height:100% of the flex row — which made it stretch to thousands of pixels
   and never render. Pin the map column to the viewport and let the list
   scroll beside it. */
/* --n49-header-h is measured at runtime so the map neither hides under the
   sticky header nor overflows the viewport and scrolls. */
.directory .width-74 {
    position: sticky;
    top: var(--n49-header-h, 62px);
    align-self: flex-start;
    height: calc(100vh - var(--n49-header-h, 62px));
}
.directory .width-74 .acf-map { width: 100%; height: 100%; }

.n49-map-controls {
    position: absolute;
    z-index: 500;
    top: 12px; left: 50%;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px;
}

.n49-move-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff; border: 1px solid var(--n49-line); border-radius: 20px;
    padding: 7px 14px; font-size: 13px; cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .16); white-space: nowrap;
}
.n49-move-toggle input { margin: 0; }

.n49-redo-search {
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
    white-space: nowrap; font-size: 13px; padding: 8px 16px;
}
.n49-redo-search[hidden] { display: none; }

.n49-pin-active svg path { fill: #111; }

.n49-load-more-wrap { text-align: center; padding: 16px 20px; }
.n49-load-more[hidden] { display: none; }

.directory .content.n49-loading { opacity: .55; transition: opacity .12s; }

.acf-map.small { width: 100%; height: 220px; }

/* Same problem inside the filter panel, which is absolutely positioned to
   height:100% of that runaway column. */
.directory .filters {
    max-height: 100vh;
    overflow-y: auto;
}

/* ------------------------------------------------------------------ logos */

.info-box .img-wrap img {
    width: 100%;
    max-width: 90px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
}

@media (max-width: 800px) {
    .directory .width-74 { position: static; height: auto; }
    .directory .width-74 .acf-map { height: 320px; }
    .reviews .pl-60 { padding-left: 52px; }
}
