.marketplace-page,
.marketplace-discovery {
    background: #f8f9fb;
}

.marketplace-shell {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

.marketplace-section,
.marketplace-categories,
.marketplace-banners {
    margin-bottom: 2.25rem;
}

.marketplace-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.marketplace-section-heading h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #222;
}

.marketplace-section-heading p {
    margin: .35rem 0 0;
    color: #747b86;
    font-size: .86rem;
}

.marketplace-category-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(118px, 138px);
    gap: .8rem;
    overflow-x: auto;
    padding: .2rem .1rem .8rem;
    scrollbar-width: thin;
}

.marketplace-category-card {
    display: flex;
    min-height: 132px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .8rem;
    border: 1px solid #eceef2;
    border-radius: 18px;
    background: #fff;
    color: #272b30;
    text-align: center;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.marketplace-category-card:hover,
.marketplace-category-card.is-active {
    color: #d9283e;
    border-color: rgba(217, 40, 62, .35);
    box-shadow: 0 10px 28px rgba(26, 29, 33, .08);
    transform: translateY(-2px);
}

.marketplace-category-media {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    overflow: hidden;
    border-radius: 16px;
    background: #fff3f4;
    font-size: 1.35rem;
}

.marketplace-category-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.marketplace-category-name {
    font-weight: 700;
    line-height: 1.25;
}

.marketplace-category-card small {
    color: #8b9199;
    font-size: .72rem;
}

.marketplace-banner-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 46%);
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: .5rem;
}

.marketplace-banner-card {
    display: block;
    overflow: hidden;
    min-height: 130px;
    border-radius: 20px;
    background: #eceef2;
}

.marketplace-banner-card img {
    width: 100%;
    height: 100%;
    min-height: 130px;
    object-fit: cover;
}

.marketplace-restaurant-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.marketplace-restaurant-card {
    overflow: hidden;
    border: 1px solid #eceef2;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(26, 29, 33, .045);
    transition: transform .18s ease, box-shadow .18s ease;
}

.marketplace-restaurant-card:hover {
    box-shadow: 0 14px 34px rgba(26, 29, 33, .09);
    transform: translateY(-2px);
}

.marketplace-restaurant-cover {
    position: relative;
    display: block;
    height: 155px;
    overflow: hidden;
    background: #f0f1f3;
}

.marketplace-restaurant-cover > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.marketplace-badge {
    position: absolute;
    top: .75rem;
    inset-inline-start: .75rem;
    padding: .32rem .65rem;
    border-radius: 999px;
    background: #fff;
    color: #d9283e;
    font-size: .74rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.marketplace-restaurant-body {
    padding: .9rem 1rem 1rem;
}

.marketplace-restaurant-head {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: .7rem;
}

.marketplace-restaurant-logo {
    width: 48px;
    height: 48px;
    overflow: hidden;
    border: 1px solid #eceef2;
    border-radius: 14px;
    background: #fff;
}

.marketplace-restaurant-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.marketplace-restaurant-title h3 {
    margin: 0 0 .3rem;
    font-size: 1rem;
    font-weight: 800;
}

.marketplace-restaurant-title h3 a {
    color: #24282d;
}

.marketplace-restaurant-title p {
    margin: 0;
    color: #878d96;
    font-size: .76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.marketplace-rating {
    display: flex;
    align-items: center;
    gap: .22rem;
    color: #535961;
    font-size: .78rem;
}

.marketplace-rating i {
    color: #f5aa22;
}

.marketplace-rating small {
    color: #969ca4;
}

.marketplace-restaurant-meta {
    display: grid;
    gap: .5rem;
    margin-top: .9rem;
    padding-top: .8rem;
    border-top: 1px solid #f0f1f3;
}

.marketplace-restaurant-meta span {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: #707780;
    font-size: .78rem;
}

.marketplace-restaurant-meta i {
    width: 16px;
    color: #8f959e;
    text-align: center;
}

.marketplace-restaurant-meta strong {
    color: #34393f;
    font-weight: 700;
}

.marketplace-empty-state {
    grid-column: 1 / -1;
    padding: 3rem 1rem;
    border: 1px dashed #d9dde3;
    border-radius: 20px;
    background: #fff;
    text-align: center;
    color: #777e87;
}

.marketplace-empty-state i {
    margin-bottom: .8rem;
    color: #c3c7cd;
    font-size: 2rem;
}

.marketplace-empty-state h3 {
    margin-bottom: .4rem;
    color: #3a3f45;
}

@media (max-width: 991.98px) {
    .marketplace-restaurant-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .marketplace-banner-list {
        grid-auto-columns: minmax(260px, 75%);
    }
}

@media (max-width: 575.98px) {
    .marketplace-shell {
        padding-top: 1rem;
    }

    .marketplace-restaurant-grid {
        grid-template-columns: 1fr;
    }

    .marketplace-category-list {
        grid-auto-columns: 108px;
    }

    .marketplace-category-card {
        min-height: 116px;
        border-radius: 16px;
    }

    .marketplace-banner-list {
        grid-auto-columns: 88%;
    }

    .marketplace-restaurant-cover {
        height: 170px;
    }
}

.neshan-location-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline: 0;
    z-index: 10050;
    display: none;
    overflow-y: auto;
    max-height: 280px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(22, 25, 29, .14);
    direction: rtl;
    text-align: right;
}

.neshan-location-suggestion {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: .18rem;
    padding: .7rem .85rem;
    border: 0;
    border-bottom: 1px solid #f0f1f3;
    background: #fff;
    color: #31363c;
    text-align: right;
    cursor: pointer;
}

.neshan-location-suggestion:last-child {
    border-bottom: 0;
}

.neshan-location-suggestion:hover {
    background: #fafafb;
}

.neshan-location-suggestion strong {
    font-size: .82rem;
}

.neshan-location-suggestion small {
    color: #7f8790;
    font-size: .72rem;
}

.neshan-map-config-warning {
    display: grid;
    height: 100%;
    min-height: 220px;
    place-items: center;
    padding: 1rem;
    border: 1px dashed #d9dde3;
    border-radius: 12px;
    background: #fafbfc;
    color: #7c838c;
    text-align: center;
    font-size: .8rem;
}

.marketplace-search-label {
    display: block;
    margin-bottom: .45rem;
    color: #545b64;
    font-size: .8rem;
    font-weight: 700;
}

.marketplace-location-map {
    height: 260px;
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid #e6e8ec;
    border-radius: 16px;
    background: #f1f2f4;
    z-index: 1;
}

.marketplace-service-actions {
    display: grid;
    gap: .65rem;
}

.marketplace-service-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
}

.marketplace-filter-bar {
    padding-top: 7rem;
    padding-bottom: 1.25rem;
    background: #f8f9fb;
}

.marketplace-filter-search {
    position: relative;
}

.marketplace-filter-search .search-icon {
    position: absolute;
    top: 50%;
    inset-inline-start: .9rem;
    z-index: 2;
    color: #9298a1;
    transform: translateY(-50%);
}

.marketplace-filter-search .form-control {
    padding-inline-start: 2.6rem;
}

.marketplace-current-location {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-height: 44px;
    color: #656c75;
    font-size: .78rem;
}

.marketplace-current-location span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.marketplace-filter-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}

.marketplace-service-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: #565d65;
    font-size: .78rem;
    cursor: pointer;
}

.marketplace-active-filter {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .28rem .6rem;
    border-radius: 999px;
    background: #fff0f2;
    color: #d9283e;
    font-size: .75rem;
    font-weight: 700;
}

/* Phase 4: marketplace search and filters */
.marketplace-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .42rem .8rem;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #525962;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
}

.marketplace-filter-toggle:hover,
.marketplace-filter-toggle.is-active {
    border-color: rgba(217, 40, 62, .32);
    background: #fff4f5;
    color: #c62337;
}

.marketplace-advanced-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eff1f4;
}

.marketplace-filter-field {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.marketplace-filter-field > label,
.marketplace-filter-field > legend {
    display: block;
    width: auto;
    margin: 0 0 .45rem;
    color: #555c65;
    font-size: .78rem;
    font-weight: 800;
}

.marketplace-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.marketplace-filter-chip,
.marketplace-filter-check {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.marketplace-filter-chip input,
.marketplace-filter-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.marketplace-filter-chip span,
.marketplace-filter-check span {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: .42rem .72rem;
    border: 1px solid #e4e7eb;
    border-radius: 999px;
    background: #fff;
    color: #656c75;
    font-size: .76rem;
    font-weight: 700;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.marketplace-filter-chip input:checked + span,
.marketplace-filter-check input:checked + span {
    border-color: rgba(217, 40, 62, .35);
    background: #fff0f2;
    color: #c82338;
}

.marketplace-boolean-filters {
    display: flex;
    align-items: end;
    gap: .5rem;
    padding-top: 1.5rem;
}

.marketplace-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .6rem;
}

.marketplace-open-badge {
    position: absolute;
    top: .75rem;
    inset-inline-end: .75rem;
    padding: .3rem .62rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    font-size: .72rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}

.marketplace-open-badge.is-open {
    color: #198754;
}

.marketplace-open-badge.is-closed {
    color: #8b9199;
}

.marketplace-matched-items {
    display: grid;
    gap: .38rem;
    margin-top: .85rem;
    padding: .7rem;
    border-radius: 14px;
    background: #fafbfc;
}

.marketplace-matched-title {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: #848a93;
    font-size: .72rem;
    font-weight: 800;
}

.marketplace-matched-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    color: #343a40;
    font-size: .76rem;
}

.marketplace-matched-item:hover {
    color: #c82338;
}

.marketplace-matched-item-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.marketplace-matched-item-price {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

.marketplace-matched-item-price del {
    color: #a0a6ae;
    font-size: .68rem;
}

.marketplace-matched-item-price strong {
    color: #24292f;
    font-size: .74rem;
}

.marketplace-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-top: .5rem;
    padding: 1rem 0;
    color: #6d747d;
    font-size: .82rem;
    text-align: center;
}

.marketplace-pagination > :last-child {
    justify-self: end;
}

@media (max-width: 991.98px) {
    .marketplace-advanced-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .marketplace-advanced-filters {
        grid-template-columns: 1fr;
    }

    .marketplace-boolean-filters {
        align-items: start;
        padding-top: 0;
    }

    .marketplace-filter-actions {
        justify-content: stretch;
    }

    .marketplace-filter-actions .btn {
        flex: 1;
    }

    .marketplace-pagination {
        grid-template-columns: 1fr 1fr;
    }

    .marketplace-pagination > span {
        grid-column: 1 / -1;
        grid-row: 1;
    }
}

.marketplace-suggest-host {
    position: relative;
}

.marketplace-suggestions {
    position: absolute;
    z-index: 1100;
    top: calc(100% + .4rem);
    inset-inline: 0;
    overflow: hidden;
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid #e7e9ed;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(25, 28, 33, .13);
}

.marketplace-suggestion {
    display: grid;
    width: 100%;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: .65rem;
    padding: .7rem .8rem;
    border: 0;
    border-bottom: 1px solid #f0f1f3;
    background: #fff;
    color: #30353b;
    text-align: start;
    cursor: pointer;
}

.marketplace-suggestion:last-child {
    border-bottom: 0;
}

.marketplace-suggestion:hover,
.marketplace-suggestion:focus {
    outline: none;
    background: #fff5f6;
}

.marketplace-suggestion-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 10px;
    background: #f4f5f7;
    color: #d0293e;
}

.marketplace-suggestion-text {
    display: grid;
    min-width: 0;
    gap: .15rem;
}

.marketplace-suggestion-text strong,
.marketplace-suggestion-text small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.marketplace-suggestion-text strong {
    font-size: .82rem;
}

.marketplace-suggestion-text small {
    color: #8a9098;
    font-size: .7rem;
}
