/* Photo-first marketplace browsing. Real-estate has its own map layout. */
body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) {
    background: #fff;
    --marketplace-accent: #00aeef;
}
body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) :is(.category-page-shell, .container:has(> .browse-layout)) { max-width: 1344px; }
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card {
    display: flex !important;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e0e0e3;
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 2px 6px #111d210a;
}
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card:hover { border-color: #c9c5d0; box-shadow: 0 5px 15px #111d2110; }
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .img-wrap {
    width: 100%; height: auto; aspect-ratio: 5 / 3; margin: 0;
    border-radius: 18px 18px 0 0; background: #f4f4f5;
}
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; transform: none; }
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .fav-btn {
    inset: 9px auto auto 9px; width: 33px; height: 33px;
    border: 1px solid #e3e1e5; border-radius: 50%; background: #fff; color: #333;
    box-shadow: 0 1px 4px #0000000d; font-size: 15px;
}
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .fav-btn.active { color: #00aeef; }
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .badge-sponsored { inset: 10px 10px auto auto; }
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .body {
    display: flex; flex-direction: column; flex: 1; gap: 0;
    padding: 13px 16px 15px; min-width: 0; text-align: right;
}
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .title {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1;
    overflow: hidden; min-height: 23px; margin: 0 0 8px;
    font-size: 15px; font-weight: 600; line-height: 1.55; color: #202027;
}
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .price {
    padding: 0; margin: 0 0 12px; border: 0; background: none;
    min-height: 24px; color: #17171e; text-align: right;
    font-size: 17px; font-weight: 750; line-height: 1.4;
}
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .meta.specs {
    display: flex; flex-wrap: wrap; gap: 4px 7px; margin: auto 0 0;
    min-height: 21px; color: #696873; font-size: 13px; line-height: 1.6;
}
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .meta.specs span { white-space: nowrap; }
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .meta.specs span::after { content: none; }
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .meta.specs span + span::before { content: '·'; margin-inline-end: 7px; color: #77727f; }
body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .browse-card-category { margin-bottom: 5px; color: #85818b; font-size: 11px; }
.marketplace-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 43px; padding: 10px 16px; border-top: 1px solid #f0eff2; color: #77717d; font-size: 12px; }
.marketplace-card-footer i { margin-inline-end: 5px; font-size: 12px; }

/* Filters live above the results, with the full form in an accessible drawer. */
body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) #filterSidebar { display: none; }
body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) :is(.category-results-area, .browse-results) { width: 100%; flex: 0 0 100%; }
body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) :is(#toggleFilters, .veh-qf-more, .filter-sheet-close) { display: inline-flex !important; align-items: center; justify-content: center; }
body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate).filter-sheet-lock { overflow: hidden; }
body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) #filterSidebar.is-open {
    display: flex; position: fixed; inset: 0; z-index: 2000;
    width: 100%; height: 100dvh; margin: 0; padding: 0;
    align-items: stretch; justify-content: flex-start; background: #131f2366;
}
body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) #filterSidebar.is-open .filter-sidebar {
    position: relative; inset: auto; width: 400px; max-width: 100%; height: 100%; max-height: 100%;
    padding: 22px; margin: 0; overflow-y: auto; border: 0; border-radius: 0; background: #fff;
}
body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) #filterSidebar.is-open .filter-sheet-head { position: sticky; top: -22px; z-index: 5; padding: 16px 0; background: #fff; }
body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) :is(.browse-filter-actions, .category-filter-actions) { position: sticky; bottom: -22px; z-index: 4; padding: 14px 0; border-top: 1px solid #e9e6ec; background: #fff; }
body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) .filter-sidebar .btn-primary { background: #00aeef !important; border-color: #00aeef !important; }
body.wc-theme.page-category:not(.page-category-realestate) .category-hero { padding: 0 0 18px; }
body.wc-theme.page-category:not(.page-category-realestate) :is(.category-hero-icon, .category-hero-kicker, .category-hero-copy > p) { display: none; }
body.wc-theme.page-category:not(.page-category-realestate) .category-hero h1 { margin: 0; font-size: 25px; }
body.wc-theme.page-category:not(.page-category-realestate) .category-rich-navigation { padding: 0 0 17px; border: 0; border-bottom: 1px solid #eaeff1; border-radius: 0; }
body.wc-theme.page-category:not(.page-category-realestate) .veh-tabs { gap: 18px; padding: 0 0 14px; margin-bottom: 16px; background: none; border-bottom: 1px solid #edf1f3; }
body.wc-theme.page-category:not(.page-category-realestate) .veh-tab { padding: 7px 2px; border: 0; border-radius: 0; background: none; color: #736d7b; box-shadow: none; font-size: 13px; }
body.wc-theme.page-category:not(.page-category-realestate) .veh-tab.is-active { border-bottom: 2px solid #00aeef; color: #00aeef; }
body.wc-theme.page-category:not(.page-category-realestate) .veh-qf { gap: 12px; overflow: visible; }
body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-btn { min-width: 138px; min-height: 41px; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid #ccc8d0; border-radius: 8px; background: #fff; color: #332d3c; font-size: 13px; font-weight: 500; box-shadow: none; }
body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-btn.is-active { color: #00aeef; border-color: #00aeef; background: #f7fdff; }
body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-more { background: #f9fafb; }
body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-btn:is(:hover, :focus-visible, .is-active),
body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-item[open] > .veh-qf-btn {
    color: #007fad;
    border-color: var(--marketplace-accent);
    background: #edfaff;
    box-shadow: none;
}
body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-btn .fa-chevron-down { color: var(--marketplace-accent); }
body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-badge { background: var(--marketplace-accent); color: #fff; }
body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-pop .btn-primary {
    background: var(--marketplace-accent) !important;
    border-color: var(--marketplace-accent) !important;
    color: #fff;
    box-shadow: none;
}
body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-pop .btn-primary:is(:hover, :focus-visible, :active) {
    background: #0096ce !important;
    border-color: #0096ce !important;
}
body.wc-theme.page-category:not(.page-category-realestate) .wc-chip:hover span,
body.wc-theme.page-category:not(.page-category-realestate) .wc-chip input:checked + span {
    border-color: var(--marketplace-accent);
    background: #edfaff;
    color: #007fad;
}
body.wc-theme.page-category:not(.page-category-realestate) .wc-chip input:checked + span { box-shadow: inset 0 0 0 1px var(--marketplace-accent); }
body.wc-theme.page-category:not(.page-category-realestate) .wc-chip input:focus-visible + span { outline-color: var(--marketplace-accent); }
body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-pop { z-index: 1060; }
body.wc-theme.page-category:not(.page-category-realestate) .veh-type-menu { display: grid; gap: 4px; }
body.wc-theme.page-category:not(.page-category-realestate) .veh-type-menu a { padding: 10px 12px; border-radius: 5px; color: #51495c; text-decoration: none; font-size: 13px; }
body.wc-theme.page-category:not(.page-category-realestate) .veh-type-menu a:hover,
body.wc-theme.page-category:not(.page-category-realestate) .veh-type-menu a[aria-current] { background: #eefaff; color: #00aeef; }
body.wc-theme.page-category.page-category-vehicle:not(.page-category-realestate) #toggleFilters { display: none !important; }
body.wc-theme.page-category:not(.page-category-realestate) .category-results-toolbar { margin-bottom: 20px; padding: 0; min-height: 40px; border: 0; }
body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) .view-toggle a.active { background: #edfaff; color: #00aeef; }
body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) :is(.browse-listings, .category-listings-grid) { --bs-gutter-x: 18px; --bs-gutter-y: 18px; }
body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) :is(.browse-listings, .category-listings-grid) > .listing-col-5 { width: 25%; flex: 0 0 25%; max-width: 25%; }
@media (max-width: 1100px) {
    body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) :is(.browse-listings, .category-listings-grid) > .listing-col-5 { width: 33.333333%; flex-basis: 33.333333%; max-width: 33.333333%; }
}
@media (max-width: 767.98px) {
    body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) :is(.browse-listings, .category-listings-grid) > .listing-col-5 { width: 50%; flex-basis: 50%; max-width: 50%; }
    body.wc-theme.page-category:not(.page-category-realestate) .veh-qf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-btn { width: 100%; min-width: 0; }
    /* Leave room for the fixed navigation and its raised publish button. */
    body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-pop {
        --qf-bottom-space: calc(var(--wc-mobile-nav-h, 68px) + env(safe-area-inset-bottom, 0px) + 22px);
        position: fixed;
        inset: auto 12px var(--qf-bottom-space);
        width: auto;
        max-width: none;
        max-height: calc(100vh - var(--qf-bottom-space) - 80px);
        max-height: calc(100dvh - var(--qf-bottom-space) - 80px);
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 16px;
    }
    body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-pop .wc-chips {
        max-height: min(230px, calc(100dvh - var(--qf-bottom-space) - 170px));
        overscroll-behavior: contain;
    }
    body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-pop :is(.form-control, .form-select) {
        font-size: 16px;
    }
    body.wc-theme.page-category:not(.page-category-realestate) .veh-qf-pop .btn {
        min-height: 44px;
    }
    body.wc-theme.page-category:not(.page-category-realestate) .veh-tabs { flex-wrap: nowrap; overflow-x: auto; }
    body.wc-theme.page-category:not(.page-category-realestate) .veh-tab { flex: 0 0 auto; }
    body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) #filterSidebar.is-open { align-items: flex-end; }
    body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) #filterSidebar.is-open .filter-sidebar { width: 100%; height: auto; max-height: 92dvh; border-radius: 18px 18px 0 0; }
}
@media (max-width: 575.98px) {
    body.wc-theme.page-category:not(.page-category-realestate) .category-results-layout { margin-inline: 0; }
    body.wc-theme.page-category:not(.page-category-realestate) .category-results-area { padding-inline: 0; }
    body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) :is(.browse-listings, .category-listings-grid) { --bs-gutter-x: 10px; --bs-gutter-y: 12px; }
    body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) :is(.browse-listings, .category-listings-grid) > .listing-col-5 { width: 50%; flex-basis: 50%; max-width: 50%; }
    body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card { border-radius: 12px; }
    body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .img-wrap { aspect-ratio: 16 / 10; }
    body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .img-wrap { border-radius: 11px 11px 0 0; }
    body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .body { padding: 10px; }
    body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .title { font-size: 13px; -webkit-line-clamp: 2; min-height: 40px; margin-bottom: 5px; }
    body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .price { font-size: 16px; margin-bottom: 6px; }
    body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .meta.specs { font-size: 11px; gap: 3px 5px; }
    body.wc-theme:is(.page-search, .page-category) .listing-card.marketplace-card .marketplace-card-footer { min-height: 34px; padding: 8px 10px; font-size: 11px; }
}

/* Slightly denser grid cards on wide screens; preserve readable text sizes. */
@media (min-width: 768px) {
    body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) .listing-card.marketplace-card:not(.is-list) .img-wrap { aspect-ratio: 1.85; }
    body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) .listing-card.marketplace-card:not(.is-list) .body { padding: 10px 14px; }
    body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) .listing-card.marketplace-card:not(.is-list) .title { margin-bottom: 6px; }
    body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) .listing-card.marketplace-card:not(.is-list) .price { margin-bottom: 8px; }
    body.wc-theme:is(.page-search, .page-category):not(.page-category-realestate) .listing-card.marketplace-card:not(.is-list) .marketplace-card-footer { min-height: 34px; padding: 7px 14px; }
}