/* Product-oriented additions kept separate from the legacy stylesheet. */

.marketplace-discovery {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.5fr);
    gap: 1.25rem;
    align-items: center;
    padding: 1.15rem 1.25rem;
    border: 1px solid rgba(7, 94, 84, 0.09);
    border-radius: 1.35rem;
    background:
        radial-gradient(circle at 90% 10%, rgba(37, 211, 102, 0.14), transparent 30%),
        rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 36px rgba(7, 94, 84, 0.08);
}

.marketplace-discovery__copy {
    min-width: 0;
}

.marketplace-discovery__eyebrow {
    display: inline-block;
    margin-bottom: 0.35rem;
    color: var(--marketplace-accent, var(--chat-secondary));
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.marketplace-discovery h1,
.marketplace-discovery h2 {
    margin: 0;
    color: var(--chat-primary);
    font-size: clamp(1.2rem, 2vw, 1.65rem);
    font-weight: 800;
}

.marketplace-discovery p {
    margin: 0.42rem 0 0;
    color: var(--chat-muted);
    line-height: 1.5;
}

.marketplace-discovery__benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    margin-top: 0.75rem;
    color: #24554d;
    font-size: 0.82rem;
    font-weight: 650;
}

.marketplace-discovery__benefits span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.marketplace-discovery__benefits i {
    color: #198754;
}

.marketplace-category-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(118px, 1fr);
    gap: 0.65rem;
    overflow-x: auto;
    padding: 0.2rem 0.1rem 0.45rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.marketplace-category-tile {
    display: grid;
    grid-template-rows: 2.5rem auto;
    align-items: center;
    justify-items: center;
    min-height: 88px;
    padding: 0.75rem 0.6rem;
    border: 1px solid rgba(7, 94, 84, 0.1);
    border-radius: 1rem;
    background: #fff;
    color: var(--chat-primary);
    text-align: center;
    text-decoration: none;
    scroll-snap-align: start;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.marketplace-category-tile i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.85rem;
    background: rgba(7, 94, 84, 0.08);
    color: var(--marketplace-accent, var(--chat-secondary));
    font-size: 1.08rem;
}

.marketplace-category-tile__copy {
    display: grid;
    gap: 0.18rem;
    justify-items: center;
    min-width: 0;
    max-width: 100%;
}

.marketplace-category-tile__label {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.15;
    text-overflow: ellipsis;
}

.marketplace-category-tile__count {
    color: #667b76;
    font-size: 0.69rem;
    font-weight: 650;
    line-height: 1.1;
    white-space: nowrap;
}

.marketplace-category-tile:hover,
.marketplace-category-tile:focus-visible {
    border-color: rgba(7, 94, 84, 0.28);
    box-shadow: 0 12px 24px rgba(7, 94, 84, 0.1);
    color: var(--chat-primary);
    transform: translateY(-2px);
}

.marketplace-results-header--compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
}

.marketplace-save-search {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 0.5rem;
    min-height: 40px;
    white-space: nowrap;
}

.marketplace-save-search.is-saved {
    border-color: #198754;
    color: #146c43;
    background: rgba(25, 135, 84, 0.08);
}

.marketplace-empty-state {
    display: grid;
    justify-items: center;
    gap: 0.65rem;
    padding: clamp(1.5rem, 5vw, 3rem) 1rem;
    border: 1px dashed rgba(7, 94, 84, 0.22);
    border-radius: 1.2rem;
    background: rgba(245, 251, 249, 0.86);
    color: var(--chat-primary);
    text-align: center;
}

.marketplace-empty-state > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    background: rgba(7, 94, 84, 0.09);
    color: var(--chat-secondary);
    font-size: 1.25rem;
}

.marketplace-empty-state h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
}

.marketplace-empty-state p {
    max-width: 560px;
    margin: 0;
    color: var(--chat-muted);
}

.marketplace-empty-state__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 0.25rem;
}

.marketplace-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.85rem;
    border: 1px solid rgba(7, 94, 84, 0.1);
    border-radius: 1rem;
    background: #fff;
}

.marketplace-pagination .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.marketplace-pagination__status {
    color: #526762;
    font-size: 0.84rem;
    font-weight: 700;
}

.search-personalization-host--after-results {
    margin-top: 1.25rem;
}

/* Saved searches */
.saved-searches-page {
    max-width: 980px;
}

.saved-searches-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1.35rem;
    border: 1px solid rgba(7, 94, 84, 0.1);
    border-radius: 1.35rem;
    background:
        radial-gradient(circle at top right, rgba(37, 211, 102, 0.15), transparent 35%),
        #fff;
    box-shadow: 0 18px 36px rgba(7, 94, 84, 0.08);
}

.saved-searches-eyebrow {
    color: var(--chat-secondary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.saved-searches-hero h1 {
    margin: 0.25rem 0;
    color: var(--chat-primary);
    font-size: clamp(1.65rem, 4vw, 2.35rem);
    font-weight: 850;
}

.saved-searches-hero p,
.saved-searches-limit {
    margin: 0;
    color: var(--chat-muted);
}

.saved-searches-limit {
    margin-bottom: 0.65rem;
    font-size: 0.88rem;
    text-align: right;
}

.saved-searches-list {
    display: grid;
    gap: 0.8rem;
}

.saved-search-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(7, 94, 84, 0.09);
    border-radius: 1.15rem;
    background: #fff;
    box-shadow: 0 12px 28px rgba(7, 94, 84, 0.06);
}

.saved-search-card__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.9rem;
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.saved-search-card__status.is-active {
    background: rgba(25, 135, 84, 0.11);
    color: #198754;
}

.saved-search-card__content {
    min-width: 0;
}

.saved-search-card__head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
}

.saved-search-card__head h2 {
    margin: 0;
    color: var(--chat-primary);
    font-size: 1.08rem;
    font-weight: 800;
}

.saved-search-card__head span {
    color: #198754;
    font-size: 0.76rem;
    font-weight: 750;
}

.saved-search-card__content p {
    margin: 0.35rem 0 0.15rem;
    color: #3f5551;
}

.saved-search-card__content small {
    color: var(--chat-muted);
}

.saved-search-card__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
}

.saved-search-card__actions form {
    margin: 0;
}

.saved-searches-empty {
    display: grid;
    justify-items: center;
    gap: 0.65rem;
    padding: clamp(2rem, 8vw, 4rem) 1.25rem;
    border: 1px dashed rgba(7, 94, 84, 0.2);
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.88);
    text-align: center;
}

.saved-searches-empty > i {
    color: var(--chat-secondary);
    font-size: 2.2rem;
}

.saved-searches-empty h1,
.saved-searches-empty h2 {
    margin: 0;
    color: var(--chat-primary);
    font-weight: 850;
}

.saved-searches-empty p {
    max-width: 570px;
    margin: 0 0 0.35rem;
    color: var(--chat-muted);
}

.account-benefits {
    display: grid;
    gap: 0.4rem;
    padding: 0.8rem;
    border-radius: 0.9rem;
    background: rgba(25, 135, 84, 0.06);
    color: #355c55;
    font-size: 0.84rem;
    font-weight: 650;
}

/* Compact create flow */
.create-page-header--compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    padding: 0.9rem 1.1rem;
}

.create-page-header--compact .create-page-title {
    margin: 0.18rem 0 0.1rem;
}

.create-page-header--compact .create-page-subtitle {
    margin: 0;
}

.create-compact-steps {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 auto;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.create-compact-steps li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.48rem 0.62rem;
    border: 1px solid rgba(25, 135, 84, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #24554d;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.create-compact-steps strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: #198754;
    color: #fff;
    font-size: 0.72rem;
}

.create-form-section__head {
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(7, 94, 84, 0.08);
}

/* Listing detail trust and mobile conversion */
.details-summary-card--first {
    gap: 0.8rem;
}

.details-summary-kicker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.8rem;
    color: var(--chat-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.details-summary-kicker span + span::before {
    content: "•";
    margin-right: 0.8rem;
    color: rgba(7, 94, 84, 0.35);
}

.details-summary-location {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    color: #526762;
}

.details-summary-location i {
    margin-top: 0.2rem;
    color: var(--chat-secondary);
}

.details-summary-contact {
    justify-self: start;
}

.details-summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.details-summary-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.details-summary-favorite[aria-pressed="true"] {
    background: rgba(220, 53, 69, 0.08);
}

#contactSeller {
    scroll-margin-top: calc(var(--site-navbar-sticky-offset, 5rem) + 1rem);
}

.details-seller-signals {
    display: grid;
    gap: 0.45rem;
    padding: 0.75rem;
    border-radius: 0.9rem;
    background: rgba(7, 94, 84, 0.055);
    color: #355c55;
    font-size: 0.84rem;
    font-weight: 650;
}

.details-seller-signals span,
.details-seller-signals a {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: inherit;
    text-decoration: none;
}

.details-seller-signals i {
    width: 1rem;
    color: #198754;
    text-align: center;
}

.details-safety-card__head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.details-safety-card__head > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 0.8rem;
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.details-safety-card ul {
    display: grid;
    gap: 0.4rem;
    margin: 0;
    padding-left: 1.15rem;
    color: #526762;
    font-size: 0.86rem;
}

.details-report {
    margin-top: 0.65rem;
}

.details-report summary {
    width: max-content;
    max-width: 100%;
    cursor: pointer;
    color: #b02a37;
    font-size: 0.85rem;
    font-weight: 700;
}

.details-report__form {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.8rem;
    background: rgba(220, 53, 69, 0.045);
}

.details-report__form label {
    color: #526762;
    font-size: 0.78rem;
    font-weight: 700;
}

.details-mobile-contact-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1035;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.65rem max(0.7rem, env(safe-area-inset-right))
        calc(0.65rem + env(safe-area-inset-bottom))
        max(0.7rem, env(safe-area-inset-left));
    border-top: 1px solid rgba(7, 94, 84, 0.12);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -12px 30px rgba(7, 94, 84, 0.13);
    backdrop-filter: blur(14px);
}

.details-mobile-contact-bar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 46px;
}

.details-mobile-contact-bar--single {
    grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 991.98px) {
    .details-page-shell {
        padding-bottom: 5.6rem !important;
    }
}

.mobile-marketplace-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1025;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    min-height: 62px;
    padding: 0.38rem max(0.4rem, env(safe-area-inset-right))
        calc(0.35rem + env(safe-area-inset-bottom))
        max(0.4rem, env(safe-area-inset-left));
    border-top: 1px solid rgba(7, 94, 84, 0.11);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -10px 28px rgba(7, 94, 84, 0.12);
    backdrop-filter: blur(16px);
}

.mobile-marketplace-nav__item {
    position: relative;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.2rem;
    min-width: 0;
    min-height: 48px;
    padding: 0.25rem 0.1rem;
    border-radius: 0.8rem;
    color: #63736f;
    font-size: 0.66rem;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
}

.mobile-marketplace-nav__item > i,
.mobile-marketplace-nav__icon > i {
    font-size: 1.15rem;
}

.mobile-marketplace-nav__item.is-active {
    color: var(--chat-primary);
    background: rgba(7, 94, 84, 0.065);
}

.mobile-marketplace-nav__item--create {
    color: var(--chat-primary);
}

.mobile-marketplace-nav__item--create > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.55rem;
    height: 2.55rem;
    margin-top: -1.05rem;
    border: 3px solid #fff;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-accent), var(--chat-secondary));
    color: #fff;
    box-shadow: 0 8px 20px rgba(7, 94, 84, 0.25);
}

.mobile-marketplace-nav__icon {
    position: relative;
    display: inline-flex;
}

.mobile-marketplace-nav__badge {
    position: absolute;
    top: -0.2rem;
    right: -0.35rem;
    width: 0.55rem;
    height: 0.55rem;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #dc3545;
}

@media (max-width: 991.98px) {
    .marketplace-discovery {
        grid-template-columns: 1fr;
    }

    .create-page-header--compact {
        align-items: flex-start;
        flex-direction: column;
    }

    .create-compact-steps {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.15rem;
    }
}

@media (max-width: 767.98px) {
    body.has-mobile-marketplace-nav {
        padding-bottom: calc(4.25rem + env(safe-area-inset-bottom));
    }

    body.has-mobile-marketplace-nav .trust-footer {
        margin-bottom: 0;
    }

    body.has-mobile-marketplace-nav #scrollTopBtn {
        bottom: calc(4.75rem + env(safe-area-inset-bottom));
    }

    .marketplace-discovery {
        gap: 0.8rem;
        padding: 0.9rem;
        border-radius: 1.1rem;
    }

    .marketplace-discovery p {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .marketplace-discovery__benefits {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.15rem;
    }

    .marketplace-discovery__benefits span {
        flex: 0 0 auto;
    }

    .marketplace-category-rail {
        grid-auto-columns: 104px;
    }

    .marketplace-category-tile {
        min-height: 78px;
        padding: 0.55rem;
    }

    .marketplace-results-header--compact {
        align-items: flex-start;
    }

    .marketplace-save-search {
        min-height: 36px;
        padding: 0.48rem 0.65rem;
        font-size: 0.82rem;
    }

    .marketplace-save-search span {
        max-width: 8.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .marketplace-empty-state__actions {
        display: grid;
        width: 100%;
    }

    .saved-searches-hero {
        align-items: stretch;
        flex-direction: column;
        padding: 1rem;
    }

    .saved-search-card {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .saved-search-card__actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-left: 3.8rem;
    }

    .create-page-header--compact {
        margin-bottom: 0.75rem;
        padding: 0.75rem 0.85rem;
    }

    .create-page-header--compact .create-page-title {
        font-size: 1.42rem;
    }

    .create-page-header--compact .create-page-title i {
        width: 2.05rem;
        height: 2.05rem;
    }

    .create-compact-steps li {
        padding: 0.38rem 0.5rem;
    }

    .create-form-section {
        margin-bottom: 0.85rem !important;
    }

    .create-form-section .card-body {
        padding: 0.95rem;
    }

    .create-form-section__head {
        gap: 0.65rem;
        margin-bottom: 0.85rem;
    }

    .create-form-section__head::before {
        width: 2.2rem;
        height: 2.2rem;
    }

    .details-page-shell {
        padding-bottom: 5.6rem !important;
    }

    .details-summary-card--first {
        padding-bottom: 0.85rem;
    }

    .details-summary-card--first .details-title {
        font-size: clamp(1.45rem, 6.5vw, 1.9rem);
    }

    .details-summary-card--first .details-price {
        font-size: 1.45rem;
    }

    .details-summary-card--first .details-tag-cloud {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        scrollbar-width: none;
    }

    .details-summary-card--first .details-tag-chip {
        flex: 0 0 auto;
    }

    .details-gallery-viewport,
    .details-gallery-card .gallery-cover-wrapper {
        aspect-ratio: 4 / 3;
        max-height: 58vh;
    }
}

@media (max-width: 430px) {
    .marketplace-discovery__copy > p {
        font-size: 0.88rem;
    }

    .marketplace-results-header--compact {
        gap: 0.55rem;
    }

    .marketplace-save-search span {
        max-width: 6.8rem;
    }

    .saved-search-card__actions {
        padding-left: 0;
    }

    .details-gallery-viewport,
    .details-gallery-card .gallery-cover-wrapper {
        aspect-ratio: 4 / 3;
    }
}
