/* =====================================================================
   BUAI MARKETPLACE — Buy & Sell + Services (added 2026-10)
   ===================================================================== */

/* ---------- shared section head (Buy&Sell / Services switcher) ---------- */
.mpx-head {
    padding: 110px 24px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.mpx-head-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.mpx-home {
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
}

.mpx-home:hover {
    color: #111;
}

.mpx-switch {
    display: flex;
    background: rgba(255, 255, 255, .55);
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
}

.mpx-switch a {
    padding: 10px 22px;
    border-radius: 999px;
    text-decoration: none;
    color: #111;
    font-size: 14px;
    font-weight: 600;
    transition: background .15s;
}

.mpx-switch a:hover {
    background: rgba(0, 0, 0, .06);
}

.mpx-switch a.active {
    background: #111;
    color: var(--cream);
}

.mpx-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mpx-cta {
    text-decoration: none;
    color: #111;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border: 1px solid #111;
    border-radius: 999px;
    background: transparent;
}

.mpx-cta.solid {
    background: #111;
    color: var(--cream);
}

.mpx-cta:hover {
    opacity: .85;
}

@media (max-width: 720px) {
    .mpx-head {
        padding-top: 90px;
    }

    .mpx-head-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .mpx-switch {
        justify-content: center;
    }

    .mpx-actions {
        margin-left: 0;
        justify-content: center;
    }
}

/* ---------- page shells ---------- */
.bs-page .cream,
.svc-page .cream {
    background: transparent;
}

/* Phase 5: Buy & Sell pages use the light cream canvas so dark #111 text
   (titles, prices, descriptions) stays readable. Scoped to body.bs-page
   only — Services pages keep their own backgrounds. */
body.bs-page {
    background: var(--cream, #d8d8d2);
}

/* Services hub pages (category browse + business detail) share the exact
   background treatment of the marketplace homepage: the same cream variable
   (#d8d8d2) that body.market-page sets — no invented colours. */
body.svc-page {
    background: var(--cream, #d8d8d2);
}

body.svc-page .cream {
    background: transparent;
}

/* the shared section-head sits directly on the page background on
   Buy & Sell / Services pages — restore the cream strip so the switcher,
   "← Marketplace" link and CTA buttons stay readable (Phase 5) */
.svc-page .mpx-head {
    background: var(--cream, #d8d8d2);
    border-bottom: 1px solid #c7c7c1;
}

.bs-browse,
.svc-head,
.svc-categories,
.svc-list,
.bs-detail,
.bs-form-page,
.bs-dashboard,
.bs-boost,
.bs-seller-profile,
.svc-business,
.svc-dash,
.svc-form-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ---------- Buy & Sell browse ---------- */
.bs-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 24px;
}

.bs-search {
    display: flex;
    flex: 1 1 320px;
    gap: 8px;
}

.bs-search input[type=search] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #bbb;
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    background: rgba(255, 255, 255, .7);
}

.bs-search button,
.bs-filters select {
    padding: 12px 18px;
    border: 1px solid #111;
    border-radius: 999px;
    background: #111;
    color: var(--cream);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

.bs-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bs-filters select {
    background: rgba(255, 255, 255, .7);
    color: #111;
}

.bs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

@media (max-width: 980px) {
    .bs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 720px) {
    .bs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 460px) {
    .bs-grid {
        grid-template-columns: 1fr;
    }
}

.bs-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s;
}

.bs-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
}

.bs-card.is-boosted {
    border: 2px solid #e6b93f;
}

.bs-card-photo {
    display: block;
    aspect-ratio: 4 / 3;   /* standardised listing-image ratio (was 1) */
    background: #e5e5df;
    position: relative;
    overflow: hidden;
}

.bs-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.bs-card-noimg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: .2em;
    color: #999;
    font-size: 22px;
}

.bs-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    z-index: 2;
}

.bs-badge.boost {
    background: #e6b93f;
    color: #3a2c00;
}

.bs-badge.status.reserved {
    background: #f0f0e8;
    color: #6b6b60;
}

.bs-badge.status.sold {
    background: #b23;
    color: #fff;
}

.bs-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bs-card-title {
    color: #111;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.bs-card-title:hover {
    text-decoration: underline;
}

.bs-card-price {
    font-size: 17px;
    font-weight: 700;
}

.bs-card-meta {
    color: var(--muted);
    font-size: 12px;
}

.bs-card-seller {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    color: #111;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.bs-card-seller:hover {
    text-decoration: underline;
}

.bs-avatar,
.bs-review img,
.bs-profile-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.bs-empty {
    text-align: center;
    padding: 60px 20px;
}

.bs-empty h2 {
    margin-bottom: 8px;
}

.bs-empty .light-button {
    display: inline-block;
    margin-top: 16px;
}

.bs-pagination {
    margin-top: 28px;
    text-align: center;
}

.bs-pagination .pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
}

.bs-pagination .page-link {
    padding: 8px 14px;
    border: 1px solid #bbb;
    border-radius: 8px;
    color: #111;
    text-decoration: none;
    background: #fff;
    display: inline-block;
}

.bs-pagination .active .page-link {
    background: #111;
    color: var(--cream);
    border-color: #111;
}

.bs-pagination .disabled .page-link {
    opacity: .4;
}

/* ---------- Buy & Sell detail ---------- */
.bs-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 36px;
}

@media (max-width: 860px) {
    .bs-detail-grid {
        grid-template-columns: 1fr;
    }
}

.bs-detail-main {
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
    background: #e5e5df;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bs-detail-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bs-detail-main.noimg {
    font-weight: 800;
    letter-spacing: .2em;
    color: #999;
    font-size: 28px;
}

.bs-detail-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.bs-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    background: none;
}

.bs-thumb.active {
    border-color: #111;
}

.bs-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bs-detail-info h1 {
    font-size: 26px;
    margin-bottom: 8px;
}

.bs-detail-price {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bs-detail-meta {
    list-style: none;
    padding: 0;
    margin: 14px 0;
    color: var(--muted);
    font-size: 14px;
    display: grid;
    gap: 4px;
}

.bs-detail-desc h3,
.bs-review-box h3 {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}

.bs-detail-desc p {
    white-space: pre-line;
}

.bs-detail-seller {
    margin: 18px 0;
}

.bs-seller-card {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #111;
    background: rgba(255, 255, 255, .6);
    border-radius: 12px;
    padding: 12px 14px;
    width: fit-content;
}

.bs-seller-card img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.bs-seller-card small {
    color: var(--muted);
    display: block;
}

.bs-contact-box {
    background: rgba(255, 255, 255, .6);
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 10px;
    font-size: 14px;
}

.bs-owner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.bs-owner-actions form {
    margin: 0;
}

.bs-review-box {
    background: rgba(255, 255, 255, .6);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.bs-review-box label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
}

.bs-review-box textarea,
.bs-review-box select {
    width: 100%;
    padding: 10px;
    border: 1px solid #bbb;
    border-radius: 8px;
    font-family: inherit;
    margin: 4px 0 10px;
}

.bs-detail-more {
    margin-top: 48px;
}

.bs-detail-more h2 {
    margin-bottom: 16px;
}

/* ---------- forms ---------- */
.bs-form {
    display: grid;
    gap: 14px;
    max-width: 640px;
}

.bs-form label {
    display: grid;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
}

.bs-form label small {
    font-weight: 400;
    color: var(--muted);
}

.bs-form input,
.bs-form textarea,
.bs-form select {
    padding: 11px 12px;
    border: 1px solid #bbb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
}

.bs-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 560px) {
    .bs-form-row {
        grid-template-columns: 1fr;
    }
}

.bs-check {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.bs-form-photos {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bs-form-photo {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.bs-form-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bs-form-photo form {
    position: absolute;
    inset: 0;
}

.bs-form-photo button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 0;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    cursor: pointer;
    font-size: 12px;
}

/* ---------- buttons ---------- */
.light-button {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

button.light-button {
    border: 1px solid #111;
    background: transparent;
    border-radius: 999px;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #111;
}

.light-button.danger {
    border-color: #b23;
    color: #b23;
}

.light-button.accent {
    background: #e6b93f;
    border-color: #e6b93f;
    color: #3a2c00;
}

/* ---------- dashboards ---------- */
.bs-dash-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.bs-dash-head h1 {
    font-size: 26px;
}

.bs-dash-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bs-dash-list,
.svc-manage-list {
    display: grid;
    gap: 12px;
}

.bs-dash-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
    flex-wrap: wrap;
}

.bs-dash-row.is-boosted {
    border-left: 4px solid #e6b93f;
}

.bs-dash-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: #e5e5df;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bs-dash-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bs-dash-thumb span {
    font-size: 12px;
    font-weight: 700;
    color: #999;
}

.bs-dash-info {
    flex: 1;
    min-width: 200px;
}

.bs-dash-info a {
    color: #111;
    text-decoration: none;
}

.bs-dash-info small {
    color: var(--muted);
    display: block;
    margin-top: 2px;
}

.bs-boost-note {
    color: #8a6d1a;
}

.bs-dash-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.bs-dash-actions form {
    margin: 0;
}

/* ---------- boost screen ---------- */
.bs-boost-notice {
    background: #fff6dd;
    border: 1px solid #e6b93f;
    border-radius: 12px;
    padding: 14px 18px;
    margin: 18px 0 24px;
    font-size: 14px;
    max-width: 640px;
}

.bs-boost-packages {
    display: grid;
    gap: 12px;
    max-width: 640px;
}

.bs-boost-pkg {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #fff;
    border: 1px solid #bbb;
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
}

.bs-boost-pkg:has(input:checked) {
    border-color: #111;
    box-shadow: 0 0 0 2px #111;
}

.bs-boost-pkg small {
    display: block;
    color: var(--muted);
}

.bs-boost-packages button {
    margin-top: 8px;
    justify-self: start;
}

/* ---------- public seller profile ---------- */
.bs-profile-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, .6);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.bs-profile-avatar {
    width: 72px;
    height: 72px;
}

.bs-profile-info h1 {
    font-size: 24px;
}

.bs-profile-meta {
    color: var(--muted);
    font-size: 14px;
}

.bs-profile-bio {
    max-width: 560px;
}

.bs-seller-profile h2 {
    margin: 28px 0 14px;
}

.bs-reviews {
    display: grid;
    gap: 10px;
    max-width: 640px;
}

.bs-review {
    display: flex;
    gap: 12px;
    background: #fff;
    border-radius: 12px;
    padding: 14px;
}

.bs-review img {
    width: 36px;
    height: 36px;
}

.bs-review small {
    color: var(--muted);
    display: block;
}

.bs-review p {
    margin: 4px 0 0;
}

/* ---------- Services ---------- */
.svc-head h1 {
    font-size: 30px;
    margin-bottom: 6px;
}

.svc-head p {
    color: var(--muted);
}

.svc-categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .svc-categories {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .svc-categories {
        grid-template-columns: 1fr;
    }
}

.svc-cat {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
}

.svc-cat h3 {
    margin-bottom: 10px;
    font-size: 17px;
}

.svc-cat-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.svc-cat-tags span {
    background: var(--cream);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    color: #333;
}

.svc-apply-banner {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
}

.svc-apply-banner.pending {
    border-left: 4px solid #e6b93f;
}

.svc-apply-banner.rejected {
    border-left: 4px solid #b23;
}

.svc-flash {
    max-width: 1200px;
    margin: 12px auto 0;
    background: #e8f5e9;
    color: #1b5e20;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 14px;
}

.svc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 16px;
}

@media (max-width: 900px) {
    .svc-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .svc-grid {
        grid-template-columns: 1fr;
    }
}

.svc-list h2,
.svc-business h2 {
    margin: 20px 0 10px;
}

.svc-biz-hero {
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.svc-biz-hero>img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.svc-biz-id {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
}

.svc-biz-id small {
    color: var(--muted);
}

.svc-biz-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
}

.svc-biz-desc {
    margin: 16px 0;
    max-width: 720px;
}

.svc-biz-contact {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.svc-services {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.svc-service {
    display: flex;
    gap: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
}

@media (max-width: 640px) {
    .svc-service {
        flex-direction: column;
    }
}

.svc-service>img {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.svc-service-body {
    flex: 1;
}

.svc-service-body h3 {
    font-size: 18px;
}

.svc-service-body p {
    color: #333;
    font-size: 14px;
}

.svc-service-price {
    font-size: 16px;
    font-weight: 700;
    margin: 6px 0 10px;
}

.svc-service-price small {
    font-weight: 400;
    color: var(--muted);
}

.svc-enquiry summary {
    list-style: none;
    width: fit-content;
    cursor: pointer;
}

.svc-enquiry summary::-webkit-details-marker {
    display: none;
}

.svc-enquiry form {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    max-width: 480px;
}

.svc-enquiry input,
.svc-enquiry textarea {
    padding: 10px;
    border: 1px solid #bbb;
    border-radius: 8px;
    font-family: inherit;
}

/* services provider dashboard */
.svc-enquiry-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.svc-enquiry-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 14px 18px;
    flex-wrap: wrap;
}

.svc-enquiry-row small {
    color: var(--muted);
}

.svc-enquiry-row select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #bbb;
    font-family: inherit;
}

.svc-edit form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    max-width: 480px;
}

.svc-edit input,
.svc-edit textarea {
    padding: 9px 10px;
    border: 1px solid #bbb;
    border-radius: 8px;
    font-family: inherit;
}

.svc-dash h2 {
    margin: 24px 0 12px;
}.svc-cat.coming-soon { opacity: .55; } .svc-soon { background:#e6b93f; color:#3a2c00; padding:2px 8px; border-radius:999px; font-size:10px; text-transform:uppercase; letter-spacing:.05em; vertical-align:middle; } .svc-cat-note { color: var(--muted); margin-top:8px; display:block; }

/* =====================================================================
   Buy & Sell homepage � flip transition + 3-column grid (added 2026-10)
   ===================================================================== */

/* 3-col grid on desktop, 2 on tablet, 1 on mobile */
.bs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 980px) {
    .bs-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    .bs-grid { grid-template-columns: 1fr; }
}

/* ---------- flip stage ---------- */
.bsx-stage {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    position: relative;
}
.bsx-stage.revealed {
    perspective: none;
}
.bsx-flip {
    position: relative;
    transform-style: preserve-3d;
    transition: transform .9s cubic-bezier(.34, 1.1, .4, 1);
    perspective: 1600px;
}
.bsx-stage.revealed .bsx-flip {
    transform: none;
    transform-style: flat;
    perspective: none;
}
.bsx-flip.flipped {
    transform: rotateY(180deg);
}
.bsx-face {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* both faces must match height so nothing overlaps or shows through */
}
.bsx-back {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
    overflow: hidden;
}
/* after reveal: back face becomes the normal document flow */
.bsx-stage.revealed .bsx-back {
    position: static;
    transform: none;
    overflow: visible;
}
.bsx-stage.revealed .bsx-front {
    display: none;
}

/* ---------- front category cards (Services visual language) ---------- */
.bsx-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
@media (max-width: 720px) {
    .bsx-cat-grid { grid-template-columns: 1fr; }
}
.bsx-cat {
    display: block;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    text-decoration: none;
    color: #111;
    transition: transform .18s, box-shadow .18s;
}
.bsx-cat:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0,0,0,.13);
}
.bsx-cat-photo {
    aspect-ratio: 4 / 3;
    background: #e5e5df;
    position: relative;
    overflow: hidden;
}
.bsx-cat-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.bsx-cat-body {
    padding: 16px 18px 18px;
}
.bsx-cat-body h3 {
    font-size: 20px;
    margin-bottom: 4px;
}
.bsx-cat-body small {
    color: var(--muted);
}
.bsx-flip-hint {
    text-align: center;
    margin-top: 26px;
}

/* ---------- hero (featured) card ---------- */
.bsx-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    text-decoration: none;
    color: #111;
    margin-bottom: 26px;
    transition: box-shadow .18s;
}
.bsx-hero:hover {
    box-shadow: 0 8px 22px rgba(0,0,0,.13);
}
.bsx-hero-photo {
    aspect-ratio: 16 / 9;
    background: #e5e5df;
    position: relative;
    overflow: hidden;
}
.bsx-hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.bsx-hero-body {
    padding: 30px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    border-left: 1px solid rgba(0,0,0,.06);
}
.bsx-hero-kicker {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
}
.bsx-hero-body h2 {
    font-size: 28px;
    line-height: 1.2;
}
.bsx-hero-price {
    font-size: 24px;
    font-weight: 700;
}
.bsx-hero-body > small {
    color: var(--muted);
}
@media (max-width: 760px) {
    .bsx-hero { grid-template-columns: 1fr; }
    .bsx-hero-body { border-left: 0; border-top: 1px solid rgba(0,0,0,.06); padding: 20px; }
    .bsx-hero-body h2 { font-size: 22px; }
}

/* ---------- item detail page ---------- */
.bs-back-link {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
}
.bs-back-link:hover {
    color: #111;
}
.bs-contact-note {
    margin: 6px 0 10px;
}
.bs-contact-box .light-button {
    margin-right: 8px;
    margin-bottom: 8px;
}

/* =====================================================================
   Marketplace hub � flipboxes on the existing large category boxes
   (front: Services markup untouched; back: Buy & Sell equivalents)
   ===================================================================== */

.flipbox {
    perspective: 1400px;
}

.flipbox-inner {
    position: relative;
    transform-style: preserve-3d;
    /* slower, smoother flip (Phase: staggered hero) — per-card rotation
       direction via --flip-dir so the cascade feels playful, not uniform */
    transition: transform .9s cubic-bezier(.34, 1.1, .4, 1);
    transition-delay: var(--flip-delay, 0ms);
    width: 100%;
    height: 100%;
}

.flipbox.flipped .flipbox-inner {
    transform: rotateY(calc(180deg * var(--flip-dir, 1)));
}

.flipbox-face {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* back face: pre-rotated, absolutely positioned over the front so both
   faces share the same box size (no height jumps, no see-through) */
.flipbox-back {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
}

/* ---------- hero photo box ---------- */
.flipbox-hero {
    min-height: 690px; /* matches .market-photo on the front face */
}
.flipbox-hero .flipbox-back .market-photo { height: 690px; }

/* ---------- side / extra boxes: match the original .market-side > div rules ---------- */
.market-side .flipbox-back > div,
.market-extra .flipbox-back > div {
    min-height: 345px;
    padding: 35px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}
.market-side .flipbox-back > div { min-height: 345px; }

/* responsive: match the 768px tweaks already used for the originals */
@media (max-width: 768px) {
    .flipbox-hero { min-height: 580px; }
    .flipbox-hero .flipbox-back .market-photo { height: 580px; }
    .market-side .flipbox-back > div,
    .market-extra .flipbox-back > div { min-height: 260px; }
}

/* ---------- Buy & Sell back-face content styling ---------- */
.bsx-photo {
    background: #111;
}
.bsx-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .85;
}
.bsx-photo > span.bsx-photo-tag {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 2;
    font-size: 11px;
    letter-spacing: 2px;
    color: #ddd;
}
.bsx-photo .bsx-photo-title {
    position: absolute;
    left: 30px;
    right: 30px;
    bottom: 110px;
    z-index: 2;
    font-size: 54px;
    line-height: .9;
    letter-spacing: -3px;
    font-weight: 400;
    color: #fff;
}
.bsx-photo .bsx-photo-price {
    position: absolute;
    left: 30px;
    bottom: 60px;
    z-index: 2;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}
.bsx-photo .market-photo-btn,
.bsx-photo a.market-photo-btn {
    position: absolute;
    left: 30px;
    bottom: 30px;
    z-index: 3;
}
.bsx-hero-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

/* numbered boxes: keep BUAI typography, add a real link */
.bsx-box-link {
    color: #111;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.bsx-box-link:hover {
    opacity: .7;
}

/* ---------- listing grid under the flipped boxes ---------- */
.bsx-hub-grid-wrap {
    background: var(--cream);
    padding: 0 5.5% 100px;
}
.bsx-hub-grid-wrap .bs-toolbar {
    padding-top: 30px;
    max-width: none;
    margin: 0 0 26px;
}
.bsx-hub-grid-wrap .bs-toolbar .bs-search {
    flex: 1 1 320px;
    max-width: 480px;
}
.bsx-hub-grid-wrap .bs-grid {
    max-width: none;
}
.bsx-hub-grid-wrap.revealed {
    animation: bsx-fade-in .5s ease both;
}
@keyframes bsx-fade-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 768px) {
    .bsx-hub-grid-wrap { padding: 0 15px 80px; }
    .bsx-photo .bsx-photo-title { font-size: 40px; }
}

/* =====================================================================
   Post an Item form � redesigned (cards, typography, custom upload)
   ===================================================================== */

.bs-form-page {
    display: grid;
    gap: 26px;
}

/* heading */
.bsf-head h1 {
    font-size: 40px;
    line-height: 1;
    letter-spacing: -2px;
    color: #deba1c;
}
.bsf-head p {
    margin-top: 8px;
    color: #6f6f66;
    font-size: 16px;
}

/* ---------- section cards ---------- */
.bs-form fieldset.bsf-card {
    border: 1px solid #d9d9d2;
    border-radius: 14px;
    background: #fff;
    padding: 26px 28px 28px;
    margin: 0;
    display: grid;
    gap: 18px;
}
.bs-form fieldset.bsf-card legend {
    padding: 0 10px;
    margin-left: -10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #8a8a80;
}

/* ---------- fields ---------- */
.bs-form .bsf-field {
    display: grid;
    gap: 7px;
}
.bs-form .bsf-label {
    font-size: 13px;
    font-weight: 600;
    color: #3c3c36;
    letter-spacing: .01em;
}
.bs-form .bsf-label em {
    color: #c0392b;
    font-style: normal;
    margin-left: 2px;
}
.bs-form .bsf-hint {
    font-size: 12.5px;
    color: #8f8f85;
    font-weight: 400;
}

/* inputs: lighter borders, warm focus ring */
.bs-form input,
.bs-form textarea,
.bs-form select {
    padding: 13px 14px;
    border: 1px solid #cfcfc7;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    color: #1c1c17;
    background: #fbfbf8;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.bs-form input::placeholder,
.bs-form textarea::placeholder {
    color: #a5a59b;
}
.bs-form input:focus,
.bs-form textarea:focus,
.bs-form select:focus {
    outline: none;
    background: #fff;
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(230, 185, 63, .28); /* BUAI gold focus ring */
}
.bs-form textarea {
    resize: vertical;
    line-height: 1.55;
}

/* two-column rows inside cards */
.bs-form .bsf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
@media (max-width: 600px) {
    .bs-form .bsf-row { grid-template-columns: 1fr; }
    .bs-form fieldset.bsf-card { padding: 20px 18px 22px; }
    .bsf-head h1 { font-size: 32px; letter-spacing: -1px; }
}

/* ---------- price prefix ---------- */
.bsf-price-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid #cfcfc7;
    border-radius: 10px;
    background: #fbfbf8;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.bsf-price-wrap:focus-within {
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(230, 185, 63, .28);
    background: #fff;
}
.bsf-price-wrap b {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: #efefe9;
    color: #55554d;
    font-size: 14px;
    border-right: 1px solid #d9d9d2;
}
.bsf-price-wrap input {
    border: 0;
    background: transparent;
    box-shadow: none !important;
    flex: 1;
    min-width: 0;
}

/* ---------- custom photo dropzone ---------- */
.bs-form .bsf-upload {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 34px 20px;
    border: 2px dashed #c8c8c0;
    border-radius: 12px;
    background: #fafaf6;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s;
}
.bs-form .bsf-upload:hover,
.bs-form .bsf-upload.has-files {
    border-color: #111;
    background: #fff;
}
.bs-form .bsf-upload input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.bsf-upload-icon {
    font-size: 26px;
    line-height: 1;
    color: #55554d;
}
.bs-form .bsf-upload strong {
    color: #1c1c17;
    font-size: 15px;
}
.bs-form .bsf-upload small {
    color: #8f8f85;
    font-size: 12.5px;
}
.bsf-upload-count {
    color: #b8860b;
    font-size: 13px;
    font-style: normal;
    font-weight: 600;
}

/* ---------- existing photos ---------- */
/* strip also used OUTSIDE the main form (edit page: nested <form> fix) */
.bsf-existing-photos {
    display: block;
    padding: 20px 18px 22px;
    margin: 18px 0;
}
.bsf-existing-photos .bsf-legend {
    display: block;
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #3c3c36;
    margin: 0 0 6px;
}
.bsf-existing-photos .bsf-hint {
    color: #6a6a64;
    font-size: 12px;
    margin: 0 0 12px;
}
.bs-form .bsf-photos {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.bs-form .bsf-photo {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #d9d9d2;
}
.bs-form .bsf-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bs-form .bsf-photo form {
    position: absolute;
    inset: 0;
}
.bs-form .bsf-photo button {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 0;
    background: rgba(17, 17, 17, .72);
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: background .15s;
}
.bs-form .bsf-photo button:hover {
    background: #c0392b;
}

/* ---------- actions ---------- */
.bsf-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
}
.bsf-cancel {
    color: #6f6f66;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.bsf-cancel:hover {
    color: #111;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.bsf-submit {
    padding: 14px 34px;
    border: 0;
    border-radius: 999px;
    background: #111;
    color: var(--cream);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.bsf-submit:hover {
    background: #2b2b26;
    transform: translateY(-1px);
}

/* keep the shared form grid from stretching the cards' children */
.bs-form {
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
}

/* =====================================================================
   Buy & Sell pages � aligned to the Marketplace homepage theme
   (flat boxes, 1px lines, square corners, big light headings,
    numbered uppercase eyebrows � no rounded shadow cards)
   ===================================================================== */

/* ---------- headings & eyebrows ---------- */
.bs-page h1,
.svc-page h1 {
    font-size: 64px;
    line-height: .9;
    letter-spacing: -3px;
    font-weight: 400;
    color: #111;
}
.bs-page h2,
.svc-page h2 {
    font-size: 40px;
    line-height: .95;
    letter-spacing: -2px;
    font-weight: 400;
    color: #111;
}
.bsf-head h1 {
    font-size: 64px !important;
    letter-spacing: -3px !important;
    font-weight: 400 !important;
}
.bsf-head p {
    color: #70706d;
    letter-spacing: .02em;
}
.bs-detail-info h1 {
    font-size: 44px !important;
    line-height: .95 !important;
    letter-spacing: -2px !important;
    font-weight: 400 !important;
}
.svc-head h1 { font-size: 64px; letter-spacing: -3px; font-weight: 400; }

/* section head switcher � flat, bordered like the hub nav boxes */
.mpx-switch {
    background: transparent;
    border: 1px solid #c7c7c1;
    border-radius: 0;
    padding: 0;
}
.mpx-switch a {
    border-radius: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 12px;
    padding: 12px 26px;
}
.mpx-switch a.active {
    background: #111;
    color: var(--cream);
}
.mpx-cta {
    border-radius: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
}
.mpx-cta.solid {
    background: #111;
    color: var(--cream);
}

/* ---------- listing cards: flat boxes, 1px line, square ---------- */
.bs-grid .bs-card {
    border-radius: 0;
    border: 1px solid #c7c7c1;
    box-shadow: none;
    background: var(--cream, #d8d8d2);
    transition: border-color .15s;
}
.bs-grid .bs-card:hover {
    transform: none;
    box-shadow: none;
    border-color: #111;
}
.bs-grid .bs-card-photo {
    border-bottom: 1px solid #c7c7c1;
}
.bs-grid .bs-card-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.01em;
}
.bs-grid .bs-card-price {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: -.02em;
}
.bs-grid .bs-card-meta {
    letter-spacing: .05em;
    text-transform: uppercase;
    font-size: 10.5px;
    color: #77776f;
}
.bs-grid .bs-card-seller {
    letter-spacing: .03em;
    font-size: 12.5px;
    color: #55554d;
}
.bs-card-noimg {
    color: #b3b3ab;
}

/* badges � square, uppercase, letterspaced */
.bs-badge {
    border-radius: 0;
    letter-spacing: .1em;
}
.bs-badge.boost { background: #e3b72f; }

/* ---------- toolbar: flat search + square selects ---------- */
.bs-toolbar { border-top: 1px solid #c7c7c1; padding-top: 26px; }
.bs-search input[type=search] {
    border-radius: 0;
    border: 1px solid #c7c7c1;
    background: transparent;
    font-size: 14px;
}
.bs-search input[type=search]:focus {
    outline: none;
    border-color: #111;
    background: rgba(255,255,255,.5);
}
.bs-search button,
.bs-filters select,
.bs-filters .light-button {
    border-radius: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 11.5px;
    font-weight: 600;
}

/* ---------- hero/featured card (Buy & Sell view on hub) ---------- */
.bsx-hero {
    border-radius: 0;
    border: 1px solid #c7c7c1;
    box-shadow: none;
    background: transparent;
}
.bsx-hero:hover { box-shadow: none; border-color: #111; }
.bsx-hero-body { border-left: 1px solid #c7c7c1; }
.bsx-hero-body h2 {
    font-weight: 400;
    letter-spacing: -2px;
    font-size: 40px;
}
.bsx-hero-price { font-weight: 400; letter-spacing: -.02em; }
.bsx-hero-kicker {
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #8a8a80;
}

/* front flip category boxes � square, flat like the hub */
.bsx-cat {
    border-radius: 0;
    border: 1px solid #c7c7c1;
    box-shadow: none;
    /* opaque body so the title/subtitle stay readable over the dark
       marketplace page background (Phase 5) */
    background: var(--cream, #d8d8d2);
}
.bsx-cat:hover {
    transform: none;
    box-shadow: none;
    border-color: #111;
}
.bsx-cat-body h3 {
    font-weight: 400;
    letter-spacing: -1.5px;
    font-size: 30px;
}
.bsx-cat-body small {
    letter-spacing: .05em;
    text-transform: uppercase;
    font-size: 11px;
    color: #77776f;
}

/* ---------- item detail page: flat panels ---------- */
.bs-detail-main,
.bs-thumb,
.bs-detail-thumbs .bs-thumb {
    border-radius: 0;
}
.bs-detail-main { border: 1px solid #c7c7c1; }
.bs-seller-card,
.bs-contact-box,
.bs-review-box {
    border-radius: 0;
    background: transparent;
    border: 1px solid #c7c7c1;
}
.bs-review { border-radius: 0; border: 1px solid #c7c7c1; background: transparent; }
.bs-detail-meta {
    border-top: 1px solid #c7c7c1;
    border-bottom: 1px solid #c7c7c1;
    padding: 14px 0;
    color: #55554d;
}
.bs-back-link {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 11.5px;
    font-weight: 600;
}
.bs-detail-price { letter-spacing: -.02em; font-weight: 400; font-size: 28px; }
.bs-detail-desc h3, .bs-review-box h3 {
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: 11px;
}

/* ---------- seller dashboard rows: flat list style like hub numbered rows ---------- */
.bs-dash-row {
    border-radius: 0;
    border: 1px solid #c7c7c1;
    border-left: 4px solid transparent;
    box-shadow: none;
    background: transparent;
}
.bs-dash-row.is-boosted { border-left-color: #e3b72f; }
.bs-dash-head h1 { font-size: 56px; letter-spacing: -3px; font-weight: 400; }

/* ---------- buttons: square, uppercase, hub style ---------- */
.bs-page button.light-button,
.svc-page button.light-button,
.bs-page a.light-button,
.svc-page a.light-button,
.bsf-cancel,
.bsf-submit {
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 13px 26px;
}
.bs-page .light-button.accent,
.bsf-submit {
    background: #111;
    color: var(--cream);
    border-color: #111;
}
.bs-page .light-button.accent:hover { background: #e3b72f; border-color: #e3b72f; color: #111; }
.bsf-submit:hover { background: #e3b72f; color: #111; transform: none; }
button.light-button:hover { background: rgba(17,17,17,.06); }
.bs-page .light-button.danger { color: #b23; border-color: #b23; }

/* ---------- form page (post/edit): flat hub boxes ---------- */
.bs-form fieldset.bsf-card {
    border-radius: 0;
    border: 1px solid #c7c7c1;
    background: transparent;
    box-shadow: none;
}
.bs-form fieldset.bsf-card legend {
    letter-spacing: 3px;
    color: #8a8a80;
}
.bs-form input,
.bs-form textarea,
.bs-form select {
    border-radius: 0;
    background: rgba(255,255,255,.45);
    border-color: #c7c7c1;
    color: #111;
}
.bs-form input:focus,
.bs-form textarea:focus,
.bs-form select:focus {
    background: #fff;
    border-color: #111;
    box-shadow: none;
}
.bsf-price-wrap {
    border-radius: 0;
    background: rgba(255,255,255,.45);
    border-color: #c7c7c1;
}
.bsf-price-wrap b {
    background: rgba(0,0,0,.05);
    color: #70706d;
    border-right-color: #c7c7c1;
}
.bs-form .bsf-upload {
    border-radius: 0;
    background: rgba(255,255,255,.35);
    border-color: #c7c7c1;
}
.bs-form .bsf-upload:hover,
.bs-form .bsf-upload.has-files {
    border-color: #111;
    background: #fff;
}
.bsf-upload-count { color: #a17d10; }
.bs-form .bsf-photo { border-radius: 0; }
.bs-form .bsf-label { color: #3c3c36; letter-spacing: .04em; }
.bsf-cancel { letter-spacing: 2px; text-transform: uppercase; }

/* ---------- pagination & misc: square ---------- */
.bs-pagination .page-link { border-radius: 0; }
.bs-page .bs-empty h2, .svc-page .bs-empty h2 {
    font-size: 44px;
    letter-spacing: -2px;
    font-weight: 400;
}
.bsx-photo .bsx-photo-title { font-weight: 400; }
.bsx-photo .bsx-photo-price { font-weight: 400; }

/* mobile keeps the big-type feel but scales down */
@media (max-width: 768px) {
    .bs-page h1, .svc-page h1, .bsf-head h1 { font-size: 40px; letter-spacing: -1.5px; }
    .bs-page h2, .svc-page h2 { font-size: 30px; letter-spacing: -1px; }
    .bs-detail-info h1 { font-size: 32px !important; }
    .bsx-hero-body h2 { font-size: 26px; }
    .bs-dash-head h1 { font-size: 34px; }
}

/* =====================================================================
   Phase 5 — responsive polish (scoped to marketplace pages)
   ===================================================================== */

/* marketplace navbar: allow wrapping + smaller padding so the account
   burger never pushes past the viewport on phones */
@media (max-width: 900px) {
    .market-page .site-nav {
        flex-wrap: wrap;
        row-gap: 10px;
        padding: 14px 16px;
        height: auto;
        min-height: 78px;
    }
    .market-page .market-links {
        gap: 12px 14px;
        font-size: 13px;
        flex-wrap: wrap;
    }
    .market-page .market-brand {
        padding: 10px 18px;
    }
    .market-page .account-menu {
        margin-left: 0;
    }
    .mpx-head {
        padding: 24px 16px 20px;
    }
}

/* small phones: tighten the switcher + CTA row */
@media (max-width: 560px) {
    .mpx-switch a { padding: 9px 16px; font-size: 12.5px; }
    .mpx-cta { padding: 9px 14px; font-size: 12.5px; }
    .mpx-head-inner { gap: 12px; }
}

/* flip stage: after the flip lands the grid scrolls with the page, so make
   sure the stage has no leftover fixed height and cards fill the width */
@media (max-width: 720px) {
    .bsx-stage { padding: 16px 12px; }
    .bs-toolbar { row-gap: 10px; }
    .bs-search { flex: 1 1 100%; }
    .bs-search input[type="search"] { min-width: 0; width: 100%; }
    .bs-filters { flex: 1 1 100%; }
    .bs-filters select { flex: 1 1 45%; min-width: 0; }
}

/* dashboard / enquiry rows: stack cleanly on narrow screens */
@media (max-width: 640px) {
    .bs-dash-row {
        align-items: flex-start;
        padding: 12px;
    }
    .bs-dash-info {
        flex: 1 1 100%;
        order: 2;
        min-width: 0;
    }
    .bs-dash-thumb {
        order: 1;
    }
    .bs-dash-actions {
        order: 3;
        flex: 1 1 100%;
        padding-top: 4px;
        border-top: 1px dashed #c7c7c1;
        margin-top: 4px;
    }
    /* enquiry inbox: long messages / emails must wrap, not stretch */
    .bs-dash-info p,
    .bs-dash-info strong,
    .bs-dash-info small {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    /* enquiry status form wraps instead of overflowing */
    .bs-dash-info form {
        flex-wrap: wrap;
    }
}

/* listing detail: single-column stacks already handled at 860px; keep the
   contact form inputs from overflowing and the thumbs tappable */
@media (max-width: 640px) {
    .bs-form input,
    .bs-form textarea,
    .bs-form select,
    .bs-review-box textarea,
    .bs-review-box select {
        width: 100%;
        min-width: 0;
    }
    .bs-thumb {
        width: 56px;
        height: 56px;
    }
    .bs-detail-grid { gap: 24px; }
    .bs-detail-more { margin-top: 36px; }
}

/* hub flipboxes + hero photo text keep contrast on phones */
@media (max-width: 768px) {
    .bsx-photo .bsx-photo-title { font-size: 34px; letter-spacing: -1.5px; left: 22px; right: 22px; }
    .bsx-photo .bsx-photo-price { left: 22px; }
    .bsx-photo > span.bsx-photo-tag { left: 22px; }
}

/* reduced motion: skip the 3D animations but keep both sections reachable */
@media (prefers-reduced-motion: reduce) {
    .bsx-flip,
    .flipbox-inner {
        transition: none !important;
    }
    .bsx-hub-grid-wrap.revealed {
        animation: none !important;
    }
}

/* =========================================================
   Phase 8.1 — Services listings grid on the marketplace hub
   (page-scoped: hub wraps only exist on the marketplace page)
   ========================================================= */

.hub-svc-grid-wrap {
    max-width: none;
    margin: 0 auto;
    padding: 48px 5.5% 24px;
    /* sit on the same light cream canvas as the rest of the hub
       (main body is dark #090909, marketplace page uses #d8d8d2) */
    background: var(--cream, #d8d8d2);
}

.hub-svc-grid-wrap .hub-grid-head {
    text-align: center;
    margin-bottom: 24px;
}

.hub-svc-grid-wrap .hub-grid-head h2 {
    font-size: clamp(28px, 3.4vw, 44px);
    margin: 0 0 8px;
}

.hub-svc-grid-wrap .hub-grid-head p {
    color: #6a6a66;
    margin: 0;
}

/* 3-column desktop grid matching the Buy & Sell hub grid */
.hub-svc-grid-wrap .svc-grid-hub {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .hub-svc-grid-wrap .svc-grid-hub {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .hub-svc-grid-wrap {
        padding: 32px 18px 16px;
    }
    .hub-svc-grid-wrap .svc-grid-hub {
        grid-template-columns: 1fr;
    }
}

/* inner elements (heading, toolbar, flash, banner, pagination) stay
   centered on the cream canvas at the old 1200px reading width */
.hub-svc-grid-wrap > .hub-grid-head,
.hub-svc-grid-wrap > .bs-toolbar,
.hub-svc-grid-wrap > .svc-flash,
.hub-svc-grid-wrap > .svc-apply-banner,
.hub-svc-grid-wrap > .bs-empty,
.hub-svc-grid-wrap > .bs-pagination {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* keep the flipboxes and grids from colliding when both wrap sections stack */
.market-page .bsx-hub-grid-wrap {
    padding-top: 24px;
}

/* =========================================================
   Phase 8.1 — internal messaging (inbox + thread)
   ========================================================= */

.msg-page .msg-wrap {
    max-width: 760px;
}

.msg-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 24px 0;
}

.msg-row {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid rgba(17, 17, 17, .12);
    background: rgba(255, 255, 255, .65);
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease;
}

.msg-row:hover {
    border-color: #111;
}

.msg-row-unread {
    border-left: 4px solid #e3b72f;
}

.msg-avatar {
    flex: 0 0 auto;
}

.msg-row-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.msg-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.msg-unread-badge {
    background: #e3b72f;
    color: #111;
    font-size: 12px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
}

.msg-row-subject {
    font-size: 13px;
    color: #6a6a66;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.msg-subj-img {
    width: 34px;
    height: 34px;
    object-fit: cover;
    flex: 0 0 auto;
}

.msg-row-preview {
    font-size: 14px;
    color: #444;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- thread ---- */

.msg-thread-subject {
    display: flex;
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(17, 17, 17, .12);
    background: rgba(255, 255, 255, .65);
    padding: 10px 14px;
    margin: 16px 0;
}

.msg-thread-subject img {
    width: 52px;
    height: 52px;
    object-fit: cover;
}

.msg-thread-subject a {
    font-weight: 700;
    color: inherit;
}

.msg-thread-subject small {
    display: block;
    color: #6a6a66;
}

.msg-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0;
}

.msg-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border: 1px solid rgba(17, 17, 17, .12);
    background: rgba(255, 255, 255, .8);
}

.msg-bubble.msg-mine {
    align-self: flex-end;
    background: #111;
    color: #f5f5f2;
    border-color: #111;
}

.msg-bubble.msg-theirs {
    align-self: flex-start;
}

.msg-meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    font-size: 12px;
    margin-bottom: 4px;
    opacity: .85;
}

.msg-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.msg-empty {
    text-align: center;
    color: #6a6a66;
    padding: 26px 0;
}

.msg-compose {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 22px;
}

.msg-compose textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid rgba(17, 17, 17, .25);
    background: rgba(255, 255, 255, .8);
    font: inherit;
    resize: vertical;
}

.msg-compose textarea:focus {
    outline: none;
    border-color: #111;
}

@media (max-width: 640px) {
    .msg-bubble {
        max-width: 92%;
    }
    .msg-compose {
        flex-direction: column;
        align-items: stretch;
    }
}

/* =========================================================
   Phase 8.2 — Buy & Sell category chips + tightened hub grids
   ========================================================= */

.bsx-cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.bsx-chip {
    padding: 7px 16px;
    border: 1px solid rgba(17, 17, 17, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    transition: border-color .15s ease, background .15s ease;
}

.bsx-chip:hover {
    border-color: #111;
}

.bsx-chip.active {
    background: #111;
    border-color: #111;
    color: #f5f5f2;
    font-weight: 600;
}

@media (max-width: 640px) {
    .bsx-cat-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .bsx-chip {
        flex: 0 0 auto;
    }
}

/* category-select dropdown now redundant with chips but harmless; keep sort
   only — hide the category select inside the items toolbar on the hub */
.bsx-hub-grid-wrap .bs-filters select[name="category"] {
    display: none;
}

/* =========================================================
   Phase 8.2 — floating chat launcher + mini chat panel
   ========================================================= */

.chat-launcher {
    position: fixed;
    right: 22px;
    bottom: 22px;
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #111;
    color: #f5f5f2;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
    z-index: 900;
    transition: transform .15s ease, box-shadow .15s ease;
}

.chat-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .32);
}

.chat-unread {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e3b72f;
    color: #111;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

/* ---- panel ---- */

.chat-panel {
    position: fixed;
    right: 22px;
    bottom: 88px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    width: 340px;
    height: 480px;
    max-height: calc(100vh - 110px - env(safe-area-inset-bottom, 0px));
    background: #faf9f7;
    border: 1px solid rgba(17, 17, 17, .15);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 901;
}

.chat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: #111;
    color: #f5f5f2;
}

.chat-head strong {
    flex: 1;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-back,
.chat-close {
    background: none;
    border: none;
    color: #f5f5f2;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
}

.chat-back:hover,
.chat-close:hover {
    opacity: .75;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.chat-empty,
.chat-loading,
.chat-error,
.chat-msg-empty {
    text-align: center;
    color: #6a6a66;
    padding: 26px 10px;
    font-size: 14px;
}

.chat-error {
    color: #b3261e;
}

.chat-empty-hint {
    font-size: 12px;
    color: #9a9a94;
}

/* list rows */

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(17, 17, 17, .1);
    border-radius: 12px;
    background: rgba(255, 255, 255, .7);
    cursor: pointer;
    text-align: left;
    width: 100%;
    font: inherit;
    color: inherit;
    transition: border-color .15s ease;
}

.chat-row:hover {
    border-color: #111;
}

.chat-row-unread {
    border-left: 4px solid #e3b72f;
}

.chat-row-avatar {
    flex: 0 0 34px;
    height: 34px;
    border-radius: 50%;
    background: #111;
    color: #f5f5f2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.chat-row-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.chat-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.chat-unread-badge {
    background: #e3b72f;
    color: #111;
    font-size: 11px;
    font-weight: 700;
    padding: 0 7px;
    border-radius: 999px;
}

.chat-row-subject {
    font-size: 12px;
    color: #6a6a66;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-row-preview {
    font-size: 13px;
    color: #444;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* thread */

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-bubble {
    max-width: 82%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 14px;
}

.chat-bubble.chat-mine {
    align-self: flex-end;
    background: #111;
    color: #f5f5f2;
}

.chat-bubble.chat-theirs {
    align-self: flex-start;
    background: rgba(255, 255, 255, .85);
    border: 1px solid rgba(17, 17, 17, .1);
}

.chat-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 11px;
    opacity: .8;
    margin-bottom: 3px;
}

.chat-text {
    white-space: pre-wrap;
    word-break: break-word;
}

/* compose */

.chat-compose {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid rgba(17, 17, 17, .1);
    align-items: flex-end;
}

.chat-compose textarea {
    flex: 1;
    border: 1px solid rgba(17, 17, 17, .2);
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
    resize: none;
    max-height: 90px;
    background: #fff;
}

.chat-compose textarea:focus {
    outline: none;
    border-color: #111;
}

.chat-compose button {
    border: none;
    background: #111;
    color: #f5f5f2;
    border-radius: 10px;
    width: 38px;
    height: 34px;
    cursor: pointer;
}

.chat-compose button:disabled {
    opacity: .5;
    cursor: default;
}

.chat-full-link {
    display: block;
    text-align: center;
    padding: 9px;
    font-size: 13px;
    color: #111;
    text-decoration: none;
    border-top: 1px solid rgba(17, 17, 17, .08);
}

.chat-full-link:hover {
    background: rgba(17, 17, 17, .04);
}

/* mobile: near-fullscreen panel, launcher clear of edges */
@media (max-width: 640px) {
    .chat-launcher {
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        width: 50px;
        height: 50px;
    }

    .chat-panel {
        right: 8px;
        left: 8px;
        width: auto;
        bottom: calc(74px + env(safe-area-inset-bottom, 0px));
        height: calc(100vh - 190px);
        max-height: none;
        border-radius: 14px;
    }
}

/* respect reduced-motion users */
@media (prefers-reduced-motion: reduce) {
    .chat-launcher,
    .chat-launcher:hover {
        transition: none;
        transform: none;
    }
}

/* =========================================================
   Phase 8.2 fix — `hidden` must always win over the chat
   components' display rules. Without this, .chat-panel's
   display:flex overrides the UA's [hidden]{display:none},
   so the close button appeared to do nothing.
   ========================================================= */

.chat-panel[hidden],
.chat-launcher[hidden],
.chat-unread[hidden],
.chat-back[hidden],
.chat-empty[hidden],
.chat-loading[hidden],
.chat-error[hidden],
.chat-thread[hidden],
.chat-compose[hidden],
.chat-full-link[hidden] {
    display: none !important;
}

/* =========================================================
   Phase 8.3 — flip interaction repairs + category imagery
   ========================================================= */

/* the hidden face must never catch clicks or keyboard focus
   (root cause of "frozen"/erratic boxes after flipping) */
.flipbox .flipbox-face { pointer-events: none; }
.flipbox .flipbox-front { pointer-events: auto; }
.flipbox .flipbox-back { pointer-events: auto; }
.flipbox.flipped .flipbox-front { pointer-events: none; }
.flipbox:not(.flipped) .flipbox-back { pointer-events: none; }

.flipbox:focus-visible {
    outline: 3px solid #111;
    outline-offset: 2px;
}

/* padding used to sit on the wrapper (legacy .market-side > div rule);
   move it to the face body so category images can bleed to the edges */
.market-side > .flipbox { padding: 0; }

/* category faces (side boxes + flip row) */
.flip-cat-face { overflow: hidden; }

/* keep the established face positioning: front in flow, back overlaying */
.flipbox-face.flipbox-front.flip-cat-face { position: relative; }
.flipbox-face.flipbox-back.flip-cat-face { position: absolute; }

.flip-face-media {
    position: absolute;
    inset: 0;
    pointer-events: none; /* decorative — must never intercept clicks */
}

/* =========================================================
   Whole-card clickable heroes — the card face itself is the
   <a> (no separate button). Zoom + overlay hover transitions.
   ========================================================= */
.flip-cat-face-link,
a.market-photo {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

/* subtle image zoom on hover, clipped by the card's overflow:hidden */
.flip-cat-face-link .flip-face-media img,
a.market-photo > img {
    transition: transform .45s ease;
    will-change: transform;
}

@media (hover: hover) {
    .flip-cat-face-link:hover .flip-face-media img,
    a.market-photo:hover > img {
        transform: scale(1.04);
    }

    /* slight overlay deepening for text contrast on hover */
    .flip-cat-face-link:hover .flip-face-shade,
    a.market-photo:hover::after {
        opacity: .92;
    }
}

.flip-face-shade,
a.market-photo::after {
    transition: opacity .3s ease;
}

/* keep keyboard a11y on the card link itself */
.flip-cat-face-link:focus-visible,
a.market-photo:focus-visible {
    outline: 3px solid #111;
    outline-offset: -3px;
}

/* remove the separate yellow hero buttons (replaced by whole-card links) */
.market-photo-btn { display: none !important; }

/* hub Buy & Sell back-face hero link — same whole-card hover treatment */
.bsx-hero-link { cursor: pointer; }
.bsx-hero-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}
@media (hover: hover) {
    .bsx-hero-link:hover img { transform: scale(1.04); }
}
.bsx-hero-link:focus-visible {
    outline: 3px solid #111;
    outline-offset: -3px;
}

.flip-face-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.flip-face-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(243, 243, 239, .58) 0%,
        rgba(243, 243, 239, .38) 55%,
        rgba(243, 243, 239, .72) 100%);
}

.flip-face-shade-dark {
    background: linear-gradient(180deg,
        rgba(17, 17, 17, .35) 0%,
        rgba(17, 17, 17, .80) 100%);
}

.flip-face-body {
    position: relative;
    z-index: 1;
    min-height: 345px;
    padding: 35px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    box-sizing: border-box;
}

/* dark back faces when a category image is present */
.flip-face-body.has-media { color: #fff; }
.flip-face-body.has-media small { color: #b8b8b2; }
.flip-face-body.has-media label { color: #d5d5cf; }
.flip-face-body.has-media h2 { color: #fff; }
.flip-face-body.has-media p { color: #e5e5df; }

.flip-cat-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.flip-cat-link:hover { opacity: .7; }

/* second flip row (remaining service categories) — part of the hero
   switching area, sits directly under the hero grid */
.market-side.market-side-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    border-left: none;
    border-right: none;
    border-top: 1px solid #c7c7c1;
    padding: 0 5.5%;
}

.market-side.market-side-row > .flipbox {
    border-right: 1px solid #c7c7c1;
    border-bottom: 1px solid #c7c7c1;
}

.market-side.market-side-row > .flipbox:last-child { border-right: none; }

@media (max-width: 900px) {
    .market-side.market-side-row {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }
    .market-side.market-side-row > .flipbox {
        border-left: 1px solid #c7c7c1;
        border-right: 1px solid #c7c7c1;
    }
    .flip-face-body {
        min-height: 260px;
        padding: 25px;
    }
}

/* =========================================================
   Listing-image standardisation (all card types, 4:3)
   One set of rules so every grid renders identical image
   boxes regardless of source-file dimensions.
   ========================================================= */

/* shared placeholder tint for photo containers (visible while
   an image loads or when a listing has no image) */
.bs-card-photo,
.svc-card-photo,
.barber-card-photo,
.bs-dash-thumb {
    background: #e5e5df;
}

/* Buy & Sell item cards + hub service cards share .bs-card-photo
   (4:3 applied at the base rule above); the flat-services grid on
   the marketplace hub reuses .bs-card sizing via `bs-card svc-card`. */

/* category-page business cards previously had NO image styling —
   natural-size images broke grid alignment. Same 4:3 box now. */
.svc-card {
    background: #fff;
    border: 1px solid var(--line, #c9c9c4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.svc-card-photo {
    display: block;
    aspect-ratio: 4 / 3;
    position: relative;
    overflow: hidden;
}

.svc-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.svc-card .bs-card-body {
    padding: 14px 16px 16px;
}

.svc-card .bs-card-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: #111;
}

.svc-card .bs-card-meta {
    font-size: 12px;
    letter-spacing: .03em;
    color: #77776f;
}

/* barber list cards (main.css sets layout only — no fixed box) */
.barber-card-photo {
    min-height: 165px; /* matches the 220px column at ~4:3 */
}

.barber-card-photo img {
    width: 100%;
    height: 100%;
    min-height: 165px;
    object-fit: cover;
    object-position: center;
    display: block;
}

@media (max-width: 760px) {
    .barber-card { grid-template-columns: 1fr; }
    .barber-card-photo { min-height: 0; aspect-ratio: 4 / 3; }
    .barber-card-photo img { min-height: 0; height: 100%; }
}

/* dashboard rows: compact 4:3 thumbnails — consistent across dashboards */
.bs-dash-thumb {
    width: 72px;
    height: 54px; /* 72 × 4:3 */
    border-radius: 8px;
    object-fit: cover;
    object-position: center;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #777;
    flex-shrink: 0;
}

/* ===== Service image standardisation (Business Dashboard) =====
   MOVED to dash.css — the dashboard layout loads main.css + dash.css only,
   so dashboard-scoped classes must live there to be applied. */

/* fallback for missing images: keep the container size so the
   card never collapses or misaligns */
.bs-card-photo .bs-card-noimg,
.svc-card-photo .bs-card-noimg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: .2em;
    font-size: 22px;
    color: #999;
}

/* =========================================================
   Image previews (Task 4) — every upload form shows an
   immediate preview. Containers use object-fit so images are
   never stretched; cards already standardised to 4:3.
   ========================================================= */
.img-preview-field { display: flex; flex-direction: column; gap: 8px; }

.img-preview {
    position: relative;
    border: 1px solid #d9d9d2;
    background: #ecece6;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.img-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;   /* avatars/logos crop to fill — never stretched */
    object-position: center;
    display: block;
}
/* square-ish avatar/logo box */
.img-preview-logo { width: 160px; height: 160px; }
/* wide cover box — full image visible with sensible focal crop */
.img-preview-cover { width: 100%; max-width: 480px; height: 150px; }
/* contain variant for product previews where the whole image must show */
.img-preview-contain img { object-fit: contain; }

.img-preview-empty {
    color: #8a8a83;
    font-size: 12px;
    letter-spacing: .04em;
}
.img-preview-new {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* picked-file thumbnails (multi-photo inputs) */
.img-preview-tray {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.img-preview-thumb {
    width: 84px;
    text-align: center;
}
.img-preview-thumb img {
    width: 84px;
    height: 84px;
    object-fit: cover;
    object-position: center;
    display: block;
    border: 1px solid #d9d9d2;
}
.img-preview-thumb small {
    display: block;
    color: #6a6a64;
    font-size: 10px;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .img-preview-cover { height: 110px; }
    .img-preview-logo { width: 120px; height: 120px; }
}

/* =========================================================
   Business profile page redesign (public, svc-page scope)
   ========================================================= */
.biz-profile { padding: 0 0 48px; }

/* header */
.biz-hero { border-bottom: 1px solid #c7c7c1; }
.biz-hero-cover {
    height: 220px;
    overflow: hidden;
    background: #e5e5df;
    display: flex;
    align-items: center;
    justify-content: center;
}
.biz-hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;      /* cover = intentional crop for headers */
    object-position: center;
    display: block;
}
.biz-hero-cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d8d8d2, #e8e8e2);
    color: #b8b8b0;
    font-weight: 800;
    letter-spacing: .4em;
    font-size: 28px;
}

.biz-hero-id {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: flex-end;
    gap: 18px;
}
.biz-logo {
    width: 96px;
    height: 96px;
    margin-top: -48px;      /* overlaps the cover edge */
    border-radius: 16px;
    border: 3px solid #f3f3ef;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 24px;
    color: #999;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(9, 9, 9, .12);
}
.biz-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;    /* whole logo visible */
    object-position: center;
    padding: 6px;
    background: #fff;
}
.biz-heading { padding: 12px 0 18px; }
.biz-heading h1 {
    margin: 0 0 8px;
    font-size: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.biz-verified { font-size: 11px; }
.biz-meta {
    margin: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.biz-chip {
    background: #fff;
    border: 1px solid #c9c9c4;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    color: #3c3c36;
}

/* two-column layout */
.biz-grid {
    max-width: 1000px;
    margin: 24px auto 0;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 20px;
    align-items: start;
}
.biz-card {
    background: #fff;
    border: 1px solid #c9c9c4;
    border-radius: 14px;
    padding: 22px 24px;
    margin-bottom: 20px;
}
.biz-card h2 {
    margin: 0 0 12px;
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #70706d;
}
.biz-desc { margin: 0; line-height: 1.7; color: #33332f; white-space: pre-line; }

/* links */
.biz-links { display: flex; flex-direction: column; gap: 8px; }
.biz-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background: #f3f3ef;
    border: 1px solid #d9d9d2;
    border-radius: 10px;
    color: #111;
    text-decoration: none;
    font-size: 14px;
    transition: background .15s ease, border-color .15s ease;
    width: fit-content;
    min-width: 150px;
}
.biz-link:hover { background: #eaeae4; border-color: #b8b8b0; }
.biz-link-ico {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111;
    color: #f6c941;
    border-radius: 6px;
    font-weight: 800;
    font-size: 12px;
}

/* contact */
.biz-contact-line { margin: 0 0 6px; color: #33332f; }

/* services column */
.biz-card-services .svc-services { display: flex; flex-direction: column; gap: 14px; }
.biz-svc-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: #e5e5df;
    margin-bottom: 10px;
}
.biz-svc-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;    /* whole service image visible */
    object-position: center;
    display: block;
}
.biz-empty-note { color: #777771; margin: 0 0 4px; }

/* responsive */
@media (max-width: 860px) {
    .biz-grid { grid-template-columns: 1fr; }
    .biz-hero-cover { height: 160px; }
    .biz-logo { width: 80px; height: 80px; margin-top: -40px; }
    .biz-heading h1 { font-size: 24px; }
}
