/*
 * Code-Only Search Results Page
 * Namespace: nvm-sr-
 * Palette: purple #6f4165 / #47184f, orange #e38d29 -> #c8751b, verified green #22a447
 */

.nvm-sr-page {
    max-width: 1200px;
    margin: 0 auto;
    /* top padding clears the site's fixed 80px header */
    padding: 100px 16px 60px;
    direction: rtl;
    /* body text uses Assistant; titles override to Heebo below */
    font-family: 'Assistant', sans-serif;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

/* Titles use Heebo */
.nvm-sr-title,
.nvm-sr-title *,
.nvm-sr-card-name,
.nvm-sr-card-name a,
.nvm-sr-filter-title,
.nvm-sr-panel-title {
    font-family: 'Heebo', sans-serif;
}

.nvm-sr-searchbar {
    margin-bottom: 22px;
}

.nvm-sr-title {
    text-align: center;
    margin: 8px 0 20px;
}

.nvm-sr-infolinks {
    max-width: 760px;
    margin: 0 auto 8px;
}

/* ---------- Layout ---------- */
/* RTL: first grid track (sidebar) sits on the right, results on the left */
.nvm-sr-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}

/* Sidebar on the right (track 1), results on the left (track 2) in RTL.
   grid-row:1 keeps both on the same row despite the DOM order (results first). */
.nvm-sr-sidebar {
    grid-column: 1;
    grid-row: 1;
}

.nvm-sr-results-col {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

/* ---------- Toolbar (count + sort) ---------- */
.nvm-sr-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.nvm-sr-count {
    font-size: 15px;
    color: #6f4165;
    font-weight: 600;
}

.nvm-sr-count-num {
    font-weight: 800;
    font-size: 18px;
}

.nvm-sr-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nvm-sr-sort label {
    font-size: 14px;
    font-weight: 700;
    color: #47184f;
}

.nvm-sr-sort-select {
    border: 1px solid rgba(111, 65, 101, 0.35);
    border-radius: 10px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 14px;
    color: #47184f;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.nvm-sr-sort-select:focus {
    border-color: #6f4165;
    box-shadow: 0 0 0 3px rgba(111, 65, 101, 0.12);
}

.nvm-sr-reset-btn {
    border: none;
    background: rgba(111, 65, 101, 0.08);
    color: #6f4165;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .2s ease;
}

.nvm-sr-reset-btn:hover {
    background: rgba(111, 65, 101, 0.16);
}

/* ---------- Filter tags ---------- */
.nvm-sr-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.nvm-sr-tags .tag {
    background: #f0ecf4;
    color: #47184f;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
}

.nvm-sr-tags .tag-title {
    font-weight: 800;
}

/* ---------- Results grid ---------- */
.nvm-sr-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- Card ---------- */
/* RTL grid: image (media) in the right track, text (head + content) on the left */
.nvm-sr-card {
    position: relative;
    display: grid;
    grid-template-columns: 170px 1fr;
    grid-template-areas:
        "media head"
        "media content";
    column-gap: 20px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03), 0 12px 30px rgba(0, 0, 0, 0.04);
    transition: transform .2s ease, box-shadow .2s ease;
}

.nvm-sr-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06), 0 18px 40px rgba(0, 0, 0, 0.07);
}

/* Whole card is clickable: the name link is stretched over the entire card.
   Interactive bits (badges/tooltips and the "more details" link) are raised above it. */
.nvm-sr-card {
    cursor: pointer;
}

.nvm-sr-card-name a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.nvm-sr-card-badges {
    z-index: 2;
}

.nvm-sr-card-more {
    position: relative;
    z-index: 2;
}

/* Professional photo — fixed width, natural height so every image (whatever
   its ratio) is shown in full, with rounded corners on the image itself and a
   transparent background (no cropping, no letterbox bars). Registered photos
   are 492x608 and render at 170x210. */
.nvm-sr-card-media {
    grid-area: media;
    align-self: center;
    display: block;
    width: 170px;
    background: transparent;
    line-height: 0;
}

.nvm-sr-card-media img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
}

.nvm-sr-card-media.is-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 492 / 608;
    border-radius: 14px;
    background: linear-gradient(160deg, #efe8f1 0%, #e2d4e0 100%);
    color: #9a7d92;
    font-size: 60px;
}

.nvm-sr-card-content {
    grid-area: content;
    display: flex;
    flex-direction: column;
}

/* Badges (top-left corner) — top/left match the card padding so the badge
   band lines up with the name line (which has the same min-height as the seal) */
.nvm-sr-card-badges {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    /* swap the visual order of the seal and the online badge */
    flex-direction: row-reverse;
    gap: 8px;
}

/* Verified seal (inline SVG rosette + curved label) */
.nvm-sr-verified-seal {
    display: block;
    line-height: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.nvm-sr-seal-svg {
    display: block;
    width: 66px;
    height: 66px;
}

.nvm-sr-badge-online {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eaf3ff;
    color: #2196f3;
    font-size: 14px;
}

/* ---------- Tooltips ---------- */
.nvm-sr-tip {
    position: relative;
    display: inline-flex;
}

.nvm-sr-tip-box {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: max-content;
    max-width: 280px;
    background: #2b2b2b;
    color: #fff;
    text-align: right;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.55;
    z-index: 60;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    transition: opacity .15s ease;
    pointer-events: none;
    white-space: normal;
}

.nvm-sr-tip-box::before {
    content: "";
    position: absolute;
    bottom: 100%;
    /* tooltip is anchored at the badge's left edge, so the arrow points up
       from just under the badge */
    left: 14px;
    border: 7px solid transparent;
    border-bottom-color: #2b2b2b;
}

.nvm-sr-tip:hover .nvm-sr-tip-box,
.nvm-sr-tip:focus-within .nvm-sr-tip-box {
    visibility: visible;
    opacity: 1;
}

/* Card head: name + location.
   min-height matches the verified seal so the name line is vertically centered
   at the same level as the top-left badges. */
.nvm-sr-card-head {
    grid-area: head;
    display: flex;
    align-items: center;
    min-height: 66px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    margin-bottom: 12px;
}

.nvm-sr-card-nameline {
    display: flex;
    align-items: baseline;
    gap: 14px;
    max-width: 500px;
    flex-wrap: wrap;
}

.nvm-sr-card-name {
    margin: 0;
    font-size: 25px;
    font-weight: 800;
    line-height: 1.2;
    color: #47184f;
}

.nvm-sr-card-name a,
.nvm-sr-card-name a:link,
.nvm-sr-card-name a:visited,
.nvm-sr-card-name a:hover,
.nvm-sr-card-name a:active {
    color: #47184f;
    text-decoration: none;
}

.nvm-sr-card-name a:hover {
    text-decoration: none;
}

.nvm-sr-card-location {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    color: #47184f;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.nvm-sr-card-location .fa {
    color: #6f4165;
    /* keep the home glyph optically centered on the text line */
    align-self: center;
    font-size: 13px;
}

/* Rows */
.nvm-sr-card-row {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    margin-bottom: 12px;
    font-size: 15px;
}

.nvm-sr-card-headwrap {
    grid-area: head;
    min-width: 0;
}

.nvm-sr-card-service {
    color: #47184f;
    font-weight: 700;
}

.nvm-sr-card-specialties {
    color: #6f4165;
    font-weight: 700;
    line-height: 1.5;
}

.nvm-sr-card-coverage {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #47184f;
    font-weight: 500;
}

.nvm-sr-card-coverage .fa {
    color: #6f4165;
}

/* Location + online row — used on MOBILE only (desktop keeps location by the
   name and the online icon in the top badges) */
.nvm-sr-card-locrow {
    display: none;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nvm-sr-online-inline .nvm-sr-badge-online {
    width: 30px;
    height: 30px;
}

/* Foot: more link + meta */
.nvm-sr-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    flex-wrap: wrap;
}

.nvm-sr-card-more,
.nvm-sr-card-more:link,
.nvm-sr-card-more:visited {
    color: #e38d29;
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
}

.nvm-sr-card-more:hover {
    color: #c8751b;
    text-decoration: underline;
}

.nvm-sr-card-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: #47184f;
    flex-wrap: wrap;
}

.nvm-sr-card-meta strong {
    color: #47184f;
}

/* ---------- Pagination ---------- */
.nvm-sr-pagination {
    margin-top: 28px;
}

.nvm-sr-pagination .page-numbers {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.nvm-sr-pagination .page-numbers li {
    margin: 0;
}

.nvm-sr-pagination a.page-numbers,
.nvm-sr-pagination span.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(111, 65, 101, 0.25);
    color: #6f4165;
    font-weight: 700;
    text-decoration: none;
    transition: all .2s ease;
}

.nvm-sr-pagination a.page-numbers:hover {
    background: rgba(111, 65, 101, 0.08);
}

.nvm-sr-pagination span.page-numbers.current {
    background: linear-gradient(135deg, #6f4165 0%, #47184f 100%);
    color: #fff;
    border-color: transparent;
}

/* ---------- No results ---------- */
.nvm-sr-noresults {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: #555;
}

.nvm-sr-noresults .fa {
    font-size: 44px;
    color: #cdbcc9;
    margin-bottom: 14px;
}

.nvm-sr-noresults h3 {
    color: #6f4165;
    font-size: 22px;
    margin: 0 0 10px;
}

.nvm-sr-noresults p {
    margin: 0;
    font-size: 15px;
}

/* ---------- Sidebar / Filters ---------- */
.nvm-sr-sidebar {
    position: sticky;
    /* clear the site's fixed 80px header so the top of the filters isn't hidden while scrolling */
    top: 100px;
}

/* Clear-filters button pinned at the top of the filter box (desktop) */
.nvm-sr-reset-top {
    width: 100%;
    margin-bottom: 16px;
    padding: 11px;
    font-size: 14px;
}

/* Filters loading state */
.nvm-sr-filters {
    position: relative;
}

.nvm-sr-filters--loading {
    min-height: 240px;
}

.nvm-sr-filters-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #fff;
    z-index: 5;
    color: #6f4165;
    font-size: 14px;
    font-weight: 600;
}

.nvm-sr-filters-loader.is-hidden {
    display: none;
}

.nvm-sr-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(111, 65, 101, 0.2);
    border-top-color: #6f4165;
    border-radius: 50%;
    animation: nvm-sr-spin 0.8s linear infinite;
}

@keyframes nvm-sr-spin {
    to {
        transform: rotate(360deg);
    }
}

.nvm-sr-filters-panel {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03), 0 12px 30px rgba(0, 0, 0, 0.04);
}

.nvm-sr-panel-header {
    display: none; /* desktop: hidden; shown in mobile drawer */
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.nvm-sr-panel-title {
    font-size: 18px;
    font-weight: 800;
    color: #47184f;
}

.nvm-sr-apply-btn {
    background: linear-gradient(135deg, #e38d29 0%, #c8751b 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 10px 30px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.nvm-sr-drawer-close {
    background: none;
    border: none;
    font-size: 30px;
    line-height: 1;
    color: #6f4165;
    cursor: pointer;
    padding: 0 6px;
}

.nvm-sr-filter-group {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.nvm-sr-filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.nvm-sr-filter-title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 800;
    color: #47184f;
}

/* Checkbox rows built dynamically by filters.js */
.nvm-sr-checkboxes > div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

.nvm-sr-checkboxes input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #6f4165;
    cursor: pointer;
    margin: 0;
}

.nvm-sr-checkboxes label {
    font-size: 14px;
    color: #47184f;
    cursor: pointer;
    line-height: 1.3;
}

.nvm-sr-checkboxes .toggle-more {
    display: inline-block;
    margin-top: 8px;
    color: #6f4165;
    font-weight: 700;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

/* Home service toggle switch */
.nvm-sr-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.nvm-sr-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.nvm-sr-switch-slider {
    position: relative;
    width: 46px;
    height: 26px;
    background: #d6cdd3;
    border-radius: 20px;
    transition: background .2s ease;
    flex-shrink: 0;
}

.nvm-sr-switch-slider::before {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.nvm-sr-switch input:checked + .nvm-sr-switch-slider {
    background: #6f4165;
}

.nvm-sr-switch input:checked + .nvm-sr-switch-slider::before {
    transform: translateX(-20px);
}

.nvm-sr-switch-label {
    font-size: 14px;
    font-weight: 600;
    color: #47184f;
}

.nvm-sr-mobile-sort,
.nvm-sr-reset-inline {
    display: none; /* desktop hides mobile-only controls */
}

.nvm-sr-mobile-filters-toggle {
    display: none; /* desktop hides the mobile toggle */
}

.nvm-sr-drawer-overlay {
    display: none;
}

/* ---------- Responsive / Mobile ---------- */
@media (max-width: 768px) {
    .nvm-sr-layout {
        grid-template-columns: 1fr;
    }

    .nvm-sr-results-col {
        grid-column: auto;
        grid-row: auto;
    }

    /* Mobile filters toggle button */
    .nvm-sr-mobile-filters-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: #fff;
        border: 1px solid rgba(111, 65, 101, 0.3);
        color: #6f4165;
        font-family: inherit;
        font-weight: 800;
        font-size: 15px;
        padding: 10px 20px;
        border-radius: 30px;
        cursor: pointer;
        margin-bottom: 18px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    }

    /* Sidebar becomes an off-canvas drawer */
    .nvm-sr-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 86%;
        max-width: 360px;
        z-index: 10000;
        transform: translateX(100%);
        transition: transform .3s ease;
        overflow-y: auto;
        background: #fff;
    }

    .nvm-sr-sidebar.nvm-sr-drawer-open {
        transform: translateX(0);
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.2);
    }

    .nvm-sr-filters-panel {
        border: none;
        border-radius: 0;
        box-shadow: none;
        min-height: 100%;
    }

    .nvm-sr-panel-header {
        display: flex;
        position: sticky;
        top: 0;
        background: #fff;
        padding-bottom: 14px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        z-index: 1;
    }

    .nvm-sr-mobile-sort {
        display: block;
    }

    .nvm-sr-reset-inline {
        display: block;
        width: 100%;
        margin-top: 16px;
        padding: 12px;
        font-size: 15px;
    }

    /* Desktop toolbar sort is redundant on mobile (moved into drawer) */
    .nvm-sr-toolbar .nvm-sr-sort {
        display: none;
    }

    .nvm-sr-drawer-overlay.nvm-sr-drawer-open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
    }

    /* Card on mobile: lavender header (photo + name + service) with a white body below */
    .nvm-sr-card {
        grid-template-columns: 118px 1fr;
        grid-template-areas:
            "media head"
            "content content";
        column-gap: 14px;
        padding: 16px;
        background: #c2bbc933;
        overflow: hidden;
    }

    .nvm-sr-card-media {
        width: 118px;
        align-self: start;
    }

    /* center the name + service block against the photo so a short service
       doesn't leave a big empty gap in the header */
    .nvm-sr-card-headwrap {
        align-self: center;
    }

    .nvm-sr-card-head {
        align-self: start;
        align-items: center;
        min-height: 0;
        border-bottom: none;
        margin: 0;
        padding: 0;
    }

    .nvm-sr-card-nameline {
        flex-direction: column;
        align-items: center;
        gap: 4px;
        width: 100%;
    }

    .nvm-sr-card-name {
        font-size: 27px;
        text-align: center;
    }

    /* service line lives in the header, under the name (centered) */
    .nvm-sr-card-service {
        border-bottom: none;
        margin: 0;
        padding: 8px 0 4px;
        font-size: 17px;
        line-height: 1.4;
        text-align: center;
    }

    .nvm-sr-card-specialties {
        text-align: center;
    }

    /* Mobile: location + online move to the bottom body row; hide the
       desktop placements (inline-by-name location and top online badge). */
    .nvm-sr-card-locrow {
        display: flex;
    }

    .nvm-sr-location-inline {
        display: none;
    }

    .nvm-sr-online-badge {
        display: none;
    }

    /* white body block covering the lower part of the card */
    .nvm-sr-card-content {
        background: #fff;
        margin: 16px -16px -16px;
        padding: 16px;
        border-radius: 0px 0px 18px 18px;
    }

    .nvm-sr-card-badges {
        top: 0;
        right: 0;
        flex-direction: row;
    }

    .nvm-sr-seal-svg {
        width: 46px;
        height: 46px;
    }

    .nvm-sr-badge-online {
        width: 26px;
        height: 26px;
    }

    .nvm-sr-card-foot {
        gap: 10px;
    }

    .nvm-sr-card-meta {
        gap: 14px;
        font-size: 13px;
    }
}

/* ---------- Q&A guide cross-link (inc/questions-and-answers/) ---------- */
.nvm-sr-qa-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 26px;
    padding: 16px 20px;
    background: #f7f2f6;
    border: 1px solid #e8dde6;
    border-radius: 14px;
    font-family: 'Assistant', sans-serif;
    font-size: 17px;
}

.nvm-sr-qa-link-text {
    font-weight: 600;
    color: #3d3242;
}

.nvm-sr-page .nvm-sr-qa-link a {
    color: #6f4165;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.nvm-sr-page .nvm-sr-qa-link a:hover {
    color: #ce7929;
}
