.button--secondary {
    border-color: var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

/* Final marketplace refinements */
.home-hero {
    border-color: rgb(255 255 255 / 36%);
    background:
        radial-gradient(circle at 78% 14%, rgb(141 129 220 / 22%), transparent 38%),
        linear-gradient(130deg, #303548 0%, #3d4164 52%, #6656b3 100%);
    box-shadow: 0 22px 58px rgb(45 42 75 / 14%);
}

.home-hero--compact {
    min-height: 350px;
    justify-content: center;
}

.home-hero__content {
    width: min(100%, 820px);
    margin-inline: auto;
    text-align: center;
}

.home-hero h1,
.home-hero__title {
    max-width: 18ch;
    margin-inline: auto;
    font-size: clamp(2.6rem, 1.9rem + 2.4vw, 4.15rem);
    font-weight: 620;
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.home-hero__lead,
.home-search {
    margin-inline: auto;
}

.home-search {
    box-shadow: 0 18px 44px rgb(18 22 45 / 20%);
}

.section-heading h2 {
    font-weight: 620;
}

.section-heading > a,
.category-card__name,
.badge,
.listing-card__media-counts span {
    font-weight: 560;
}

.listing-card__title {
    font-weight: 600;
    letter-spacing: -0.018em;
}

.listing-card__services a,
.listing-card__service--current {
    padding: 5px 9px;
    background: #f3f1eb;
    color: #6e6b65;
    font-weight: 480;
}

.listing-card__price {
    font-weight: 650;
}

.listing-card__vip-sticker {
    position: absolute;
    z-index: 4;
    top: 12px;
    left: 12px;
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid rgb(255 255 255 / 78%);
    border-radius: 999px;
    background: linear-gradient(135deg, #e5484d 0%, #c92d38 100%);
    color: #fff;
    box-shadow: 0 5px 16px rgb(154 25 38 / 28%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.08em;
}

.listing-card__badges .badge--promotion {
    display: none;
}

.listing-card__attributes {
    display: flex;
    min-height: 27px;
    flex-wrap: wrap;
    gap: 6px;
    overflow: hidden;
}

.listing-card__attributes > span {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 4px;
    padding: 5px 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #f3f1eb;
    color: #615f5a;
    font-size: 0.72rem;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.listing-card__attributes small {
    color: var(--color-text-muted);
    font: inherit;
}

.listing-featured-panel {
    padding: 22px;
    margin-bottom: 30px;
    border: 1px solid color-mix(in srgb, #c79a42 40%, var(--color-border));
    border-radius: 26px;
    background: linear-gradient(135deg, #fffdf7 0%, #fbf5e9 100%);
    box-shadow: 0 16px 42px rgb(95 70 24 / 7%);
}

.listing-featured-panel__heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.listing-featured-panel__heading h2 {
    margin: 0;
    font-size: clamp(1.2rem, 1rem + 0.6vw, 1.55rem);
    font-weight: 600;
}

.listing-featured-panel__eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #272330;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.09em;
}

.listing-card--vip {
    border-color: color-mix(in srgb, #c79a42 42%, var(--color-border));
    background: #fffdf8;
}

.listing-card--marked {
    background: linear-gradient(155deg, #fffdf8 0%, #faf4e7 100%);
}

@media (max-width: 767px) {
    .home-hero {
        padding: 30px 18px;
    }

    .home-hero--compact {
        min-height: 300px;
    }

    .home-hero h1,
    .home-hero__title {
        max-width: 15ch;
        font-size: clamp(2rem, 9.4vw, 2.55rem);
        font-weight: 600;
        line-height: 1.03;
    }

    .home-hero__add {
        display: none;
    }

    .listing-card__body {
        display: grid !important;
        min-height: 174px;
        visibility: visible;
        opacity: 1;
    }

    .listing-card__services,
    .listing-card__attributes {
        flex-wrap: nowrap;
    }

    .listing-featured-panel {
        padding: 14px;
        margin-inline: -4px;
        border-radius: 22px;
    }

    .listing-featured-panel .listing-grid {
        gap: 14px;
    }
}

.button--secondary:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.home-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(36px, 6vw, 78px);
    border: 1px solid rgb(255 255 255 / 16%);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 82% 10%, rgb(138 117 255 / 36%), transparent 34%),
        linear-gradient(125deg, #171b2c 0%, #24264a 48%, #4d3db6 100%);
    color: #fff;
    box-shadow: 0 28px 80px rgb(30 32 67 / 20%);
}

.home-hero--compact {
    min-height: 390px;
    display: flex;
    align-items: center;
    padding: clamp(42px, 6vw, 80px);
}

.home-hero__glow {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
}

.home-hero__glow--one {
    width: 360px;
    height: 360px;
    top: -190px;
    right: 8%;
    background: radial-gradient(circle, rgb(117 215 255 / 32%), transparent 66%);
}

.home-hero__glow--two {
    width: 420px;
    height: 420px;
    right: -120px;
    bottom: -270px;
    background: radial-gradient(circle, rgb(196 181 253 / 34%), transparent 68%);
}

.home-hero__content {
    position: relative;
    max-width: 940px;
}

.home-hero h1,
.home-hero__title {
    max-width: 16ch;
    margin-bottom: 20px;
    color: #fff;
    font-size: clamp(3rem, 2rem + 3.4vw, 5.4rem);
    font-weight: 820;
    line-height: 0.94;
    letter-spacing: -0.065em;
}

.home-hero__lead {
    max-width: 65ch;
    margin-bottom: 28px;
    color: rgb(255 255 255 / 76%);
    font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
}

.home-search {
    position: relative;
    display: flex;
    max-width: 740px;
    gap: 10px;
    padding: 6px;
    border: 1px solid rgb(255 255 255 / 22%);
    border-radius: 20px;
    background: rgb(255 255 255 / 95%);
    box-shadow: 0 24px 60px rgb(9 23 51 / 28%);
}

.home-search__icon {
    position: absolute;
    top: 21px;
    left: 21px;
    color: #667085;
    pointer-events: none;
}

.home-search input {
    width: 100%;
    min-width: 0;
    height: 54px;
    padding: 10px 16px 10px 46px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #101828;
    outline: 0;
}

.home-search input::placeholder {
    color: #7c8799;
}

.home-search .button {
    min-width: 138px;
    box-shadow: none;
}

.home-hero__actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.button--light {
    border-color: rgb(255 255 255 / 28%);
    background: rgb(255 255 255 / 12%);
    color: #fff;
    backdrop-filter: blur(12px);
}

.button--light:hover {
    border-color: rgb(255 255 255 / 48%);
    background: rgb(255 255 255 / 20%);
    color: #fff;
    transform: translateY(-1px);
}

.home-hero__add {
    display: none;
    margin-top: 12px;
}

.home-section {
    margin-top: 80px;
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.section-heading h2 {
    margin-bottom: 0;
    font-size: clamp(1.7rem, 1.35rem + 1vw, 2.2rem);
}

.section-heading > a {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--color-surface);
    font-size: 0.875rem;
    font-weight: 680;
    text-decoration: none;
    box-shadow: inset 0 0 0 1px var(--color-border);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.category-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 96px;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
    box-shadow: 0 1px 2px rgb(16 24 40 / 3%);
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.category-card:hover {
    border-color: rgb(37 99 235 / 32%);
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: 0 16px 38px rgb(30 32 67 / 10%);
    transform: translateY(-2px);
}

.category-card__image,
.category-card__icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: var(--radius-md);
}

.category-card__image {
    object-fit: cover;
}

.category-card__icon {
    display: grid;
    place-items: center;
    border: 1px solid rgb(37 99 235 / 10%);
    background: var(--color-primary-soft);
    color: var(--color-primary);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 70%);
}

.category-card__content {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.category-card__name {
    overflow: hidden;
    font-size: 0.925rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
}

.category-card__count {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.category-more {
    margin-top: 20px;
}

.category-more > summary {
    width: fit-content;
    list-style: none;
}

.category-more > summary::-webkit-details-marker {
    display: none;
}

.category-grid--more {
    margin-top: 20px;
}

.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 315px));
    justify-content: start;
    gap: 24px 18px;
}

.listing-grid--featured {
    grid-template-columns: repeat(auto-fill, minmax(280px, 315px));
}

.listing-grid .listing-card {
    display: flex;
    flex-direction: column;
}

.listing-grid .listing-card__body {
    flex: 1;
}

.listing-grid .listing-card__price {
    margin-top: auto;
}

.listing-list {
    display: grid;
    gap: 20px;
}

.listing-card--horizontal {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

.listing-card--horizontal .listing-card__media {
    height: 100%;
    min-height: 210px;
    aspect-ratio: auto;
}

.listing-card--horizontal .listing-card__body {
    align-content: start;
    padding: 20px;
}

.listing-card--horizontal .listing-card__title {
    min-height: auto;
    font-size: 1.25rem;
}

.listing-card--horizontal .listing-card__price {
    margin-top: auto;
    font-size: 1.25rem;
}

.results-toolbar {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 14px;
    margin-bottom: 28px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: rgb(255 255 255 / 72%);
}

.results-toolbar__count,
.results-summary {
    color: var(--color-text-muted);
    font-weight: 650;
}

.results-toolbar__controls,
.sort-form,
.view-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-toggle {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background:
        linear-gradient(145deg, rgb(255 255 255 / 82%), rgb(250 246 238 / 92%)),
        var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 10px 26px rgb(15 23 42 / 5%);
    transition:
        border-color 140ms ease,
        color 140ms ease,
        background-color 140ms ease,
        transform 140ms ease;
}

.filter-toggle .icon {
    width: 18px;
    height: 18px;
}

.filter-toggle:hover,
.filter-toggle.is-active {
    border-color: rgb(85 71 232 / 28%);
    background: var(--color-primary-soft);
    color: var(--color-primary);
    transform: translateY(-1px);
}

:root[data-theme="dark"] .filter-toggle {
    border-color: rgb(67 75 91 / 90%);
    background:
        linear-gradient(145deg, rgb(25 31 40 / 92%), rgb(18 23 31 / 94%)),
        var(--color-surface);
    box-shadow: 0 10px 26px rgb(0 0 0 / 18%);
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] .filter-toggle {
        border-color: rgb(67 75 91 / 90%);
        background:
            linear-gradient(145deg, rgb(25 31 40 / 92%), rgb(18 23 31 / 94%)),
            var(--color-surface);
        box-shadow: 0 10px 26px rgb(0 0 0 / 18%);
    }
}

.sort-form label {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
}

.sort-form .select-control {
    width: 220px;
    min-width: 0;
    max-width: 100%;
}

.view-switcher .icon-button.is-active {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 32px;
}

.pagination__direction {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 6px;
    color: var(--color-text);
    font-weight: 650;
    text-decoration: none;
}

.pagination__direction:last-child {
    justify-self: end;
}

.pagination__pages {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.pagination__pages a,
.pagination__pages span {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-weight: 650;
    text-decoration: none;
}

.pagination__pages a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.pagination__pages span {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.pagination__ellipsis {
    display: grid;
    min-width: 22px;
    height: 38px;
    place-items: center;
    color: var(--color-text-muted);
    font-weight: 650;
}

.pagination-summary {
    margin: 12px 0 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-align: center;
}

.listing-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 24px;
    background: var(--color-surface);
    box-shadow: 0 1px 2px rgb(16 24 40 / 3%), 0 10px 30px rgb(16 24 40 / 4%);
    transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.listing-card--vip {
    border-color: transparent;
    background:
        linear-gradient(var(--color-surface), var(--color-surface)) padding-box,
        linear-gradient(135deg, rgb(37 99 235 / 55%), rgb(124 58 237 / 62%), rgb(6 182 212 / 42%)) border-box;
    box-shadow: 0 18px 42px rgb(79 70 229 / 14%);
}

.listing-card--vip::before {
    position: absolute;
    z-index: 3;
    top: 0;
    right: 22%;
    left: 22%;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent), var(--color-cyan));
    content: "";
}

.listing-card:hover {
    border-color: rgb(37 99 235 / 25%);
    box-shadow: 0 24px 55px rgb(16 24 40 / 11%);
    transform: translateY(-3px);
}

.listing-card--marked {
    border-color: rgb(245 158 11 / 38%);
    background: linear-gradient(145deg, #fffdf7, #fff7e7);
    box-shadow: 0 16px 38px rgb(180 83 9 / 12%);
}

:root[data-theme="dark"] .listing-card--marked {
    border-color: #c98a27;
    background: #2b2418;
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] .listing-card--marked {
        border-color: #c98a27;
        background: #2b2418;
    }
}

.listing-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--color-surface-muted);
}

.listing-card__gallery {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-snap-type: inline mandatory;
    -webkit-overflow-scrolling: touch;
}

.listing-card__gallery::-webkit-scrollbar {
    display: none;
}

.listing-card__image-link,
.listing-card__image,
.listing-card__placeholder {
    width: 100%;
    height: 100%;
}

.listing-card__image-link {
    display: block;
    flex: 0 0 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    touch-action: pan-x;
}

.listing-card__image {
    object-fit: cover;
    transition: transform 180ms ease;
}

.listing-card__image-link:hover .listing-card__image {
    transform: scale(1.045);
}

.listing-card__gallery-button {
    position: absolute;
    z-index: 2;
    top: 50%;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 48%);
    border-radius: 999px;
    background: rgb(255 255 255 / 84%);
    color: #101828;
    cursor: pointer;
    opacity: 0;
    box-shadow: 0 8px 20px rgb(16 24 40 / 18%);
    transform: translateY(-50%);
    transition: opacity 160ms ease, transform 160ms ease;
    backdrop-filter: blur(10px);
}

.listing-card:hover .listing-card__gallery-button,
.listing-card__gallery-button:focus-visible {
    opacity: 1;
}

.listing-card__gallery-button--prev {
    left: 10px;
}

.listing-card__gallery-button--next {
    right: 10px;
}

.listing-card__gallery-button .icon {
    width: 17px;
    height: 17px;
}

.listing-card__placeholder {
    display: grid;
    place-content: center;
    gap: 8px;
    color: var(--color-text-muted);
    text-align: center;
}

.listing-card__placeholder-icon {
    width: 36px;
    height: 36px;
    margin-inline: auto;
}

.favorite-button {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 10px;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--color-border);
    border-color: rgb(255 255 255 / 40%);
    border-radius: 999px;
    background: rgb(255 255 255 / 88%);
    color: #101828;
    cursor: pointer;
    box-shadow: 0 10px 24px rgb(16 24 40 / 16%);
    backdrop-filter: blur(12px);
}

.favorite-button:hover,
.favorite-button.is-active {
    color: var(--color-danger);
}

.favorite-button.is-active .icon {
    fill: currentColor;
}

.favorite-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.listing-card__media-counts {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
}

.listing-card__media-counts span {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: rgb(17 19 21 / 82%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 650;
}

.listing-card__media-counts .icon {
    width: 16px;
    height: 16px;
}

.listing-card__body {
    display: grid;
    gap: 12px;
    padding: 18px 18px 20px;
}

.listing-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface-muted);
    color: var(--color-text);
    font-size: 0.75rem;
    font-weight: 700;
}

.badge--promotion {
    border-color: var(--color-warning);
    background: var(--color-warning-soft);
    color: var(--color-warning);
}

.listing-card__title {
    display: -webkit-box;
    min-height: 2.6em;
    overflow: hidden;
    margin: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 1.075rem;
    font-weight: 730;
    line-height: 1.27;
    letter-spacing: -0.025em;
}

.listing-card__title a {
    color: var(--color-text);
    text-decoration: none;
}

.listing-card__title a:hover {
    color: var(--color-primary);
}

.listing-card__shop {
    width: fit-content;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.listing-card__services {
    display: flex;
    min-height: 27px;
    flex-wrap: wrap;
    gap: 6px;
    overflow: hidden;
}

.listing-card__services a,
.listing-card__service--current {
    display: block;
    max-width: 100%;
    padding: 5px 9px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: #f1f2f5;
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.1;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:root[data-theme="dark"] .listing-card__services a,
:root[data-theme="dark"] .listing-card__service--current {
    background: var(--color-surface-muted);
}

.listing-card__services a:hover {
    border-color: rgb(37 99 235 / 28%);
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.listing-card__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

.listing-card__location {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.listing-card__location .icon {
    width: 16px;
    height: 16px;
}

.listing-card__location span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.listing-card__price {
    flex: 0 0 auto;
    margin: 0;
    color: var(--color-text);
    font-size: 1.22rem;
    font-variant-numeric: tabular-nums;
    font-weight: 780;
}

.home-how {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 34px 38px;
    border: 1px solid var(--color-border);
    border-radius: 24px;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.home-how h2 {
    margin-bottom: 6px;
}

.home-how p {
    max-width: 65ch;
    margin-bottom: 0;
    color: var(--color-text-muted);
}

.empty-state {
    display: grid;
    min-height: 220px;
    place-content: center;
    gap: 12px;
    padding: 32px;
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    color: var(--color-text-muted);
    text-align: center;
}

.empty-state__icon {
    width: 36px;
    height: 36px;
    margin-inline: auto;
}

@media (max-width: 1279px) {
    .category-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    .category-grid,
    .listing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .results-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .results-toolbar__controls {
        justify-content: space-between;
    }
}

@media (max-width: 767px) {
    .home-hero {
        padding: 34px 20px;
        border-radius: 26px;
    }

    .home-hero--compact {
        min-height: 360px;
    }

    .home-hero h1,
    .home-hero__title {
        max-width: 12ch;
        font-size: clamp(2.55rem, 11.8vw, 3.35rem);
        line-height: 0.94;
    }

    .home-search {
        gap: 4px;
        padding: 6px;
        background: rgb(255 255 255 / 96%);
    }

    .home-search input {
        height: 50px;
        padding-right: 8px;
        padding-left: 40px;
        font-size: 0.875rem;
    }

    .home-search .button {
        min-width: 82px;
        min-height: 48px;
        padding-inline: 10px;
        font-size: 0.875rem;
    }

    .home-hero__add {
        display: inline-flex;
        width: 100%;
    }

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .listing-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .listing-grid--featured {
        grid-template-columns: 1fr;
    }

    .listing-card {
        display: grid;
        grid-template-rows: auto 1fr;
    }

    .listing-card__media {
        aspect-ratio: 4 / 3;
    }

    .listing-card__body {
        display: grid;
        min-height: 178px;
        padding: 17px 17px 19px;
    }

    .listing-card__gallery-button {
        display: none;
    }

    .listing-card__services {
        flex-wrap: nowrap;
    }

    .listing-card__services a {
        flex: 0 1 auto;
    }

    .listing-card__service--current {
        flex: 0 1 auto;
    }

    .listing-card__footer {
        align-items: center;
    }

    .listing-card--horizontal {
        display: block;
    }

    .listing-card--horizontal .listing-card__media {
        min-height: 0;
        aspect-ratio: 16 / 10;
    }

    .results-toolbar__controls {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: end;
        width: 100%;
        gap: 10px;
    }

    .sort-form {
        display: block;
        min-width: 0;
    }

    .filter-toggle {
        justify-content: center;
        width: auto;
        min-height: 42px;
        padding: 8px 14px;
        justify-self: start;
        box-shadow: 0 8px 20px rgb(15 23 42 / 4%);
    }

    .filter-toggle .icon {
        width: 16px;
        height: 16px;
    }

    .sort-form label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        border: 0;
        margin: -1px;
        clip: rect(0 0 0 0);
        overflow: hidden;
        white-space: nowrap;
    }

    .sort-form .select-control {
        width: 100%;
        min-height: 42px;
    }

    .view-switcher {
        display: none;
    }

    .pagination__pages {
        justify-content: center;
    }

    .home-section {
        margin-top: 58px;
    }

    .results-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 14px;
        border-radius: 20px;
    }

    .home-how {
        align-items: stretch;
        flex-direction: column;
        padding: 24px;
    }

    .home-how .button {
        width: 100%;
    }
}

@media (max-width: 479px) {
    .results-toolbar {
        padding: 12px;
    }

    .results-toolbar__count {
        font-size: 0.875rem;
    }

    .filter-toggle {
        min-height: 40px;
        padding-inline: 13px;
        font-size: 0.9rem;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .section-heading > a {
        max-width: 100%;
    }

    .category-card {
        min-height: 82px;
        align-items: center;
        flex-direction: row;
        gap: 10px;
        padding: 12px;
    }

    .category-card__image,
    .category-card__icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .category-card__name {
        font-size: 0.8125rem;
        line-height: 1.25;
    }

    .category-card__count {
        font-size: 0.72rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .category-card,
    .listing-card,
    .listing-card__image {
        transition: none;
    }
}
