/* Premium marketplace storefront — home, listing, product cards.
   New `.mpx-*` namespace so it never collides with the generic
   `.product-card`/`.product-grid` classes shared by task/community/person
   cards elsewhere in the app (see 20-feed.css, imported via app.css). */

.mpx-shell { display: flex; flex-direction: column; gap: 14px; }

/* Header / search */
.mpx-header {
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
}
.mpx-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}
.mpx-header-top h1 { margin: 0; font-size: 17px; line-height: 1.25; }
.mpx-header-top p { margin: 2px 0 0; color: #667085; font-size: 12px; display: none; }
.mpx-header-actions { display: flex; gap: 6px; flex-shrink: 0; }
.mpx-icon-link {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 999px;
    background: #f4f7fb;
    text-decoration: none;
    font-size: 15px;
    color: #0f3556;
}
.mpx-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f4f7fb;
    border: 1px solid #e7edf5;
    border-radius: 10px;
    padding: 2px 4px 2px 12px;
}
.mpx-search-icon { font-size: 13px; opacity: .6; }
.mpx-search-bar input[type="search"] {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 7px 4px;
    font-size: 13px;
    outline: none;
    min-width: 0;
}
.mpx-search-btn {
    border: 0;
    background: #0b65d8;
    color: #fff;
    font-weight: 800;
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
}
.mpx-search-clear {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    color: #667085;
    text-decoration: none;
}
@media (min-width: 640px) {
    .mpx-header { padding: 16px 18px; border-radius: 16px; }
    .mpx-header-top { margin-bottom: 12px; }
    .mpx-header-top h1 { font-size: 22px; }
    .mpx-header-top p { display: block; font-size: 13px; }
    .mpx-icon-link { width: 40px; height: 40px; font-size: 18px; }
    .mpx-search-bar { padding: 4px 6px 4px 14px; border-radius: 12px; }
    .mpx-search-bar input[type="search"] { padding: 10px 4px; font-size: 14px; }
    .mpx-search-btn { padding: 10px 18px; font-size: 14px; border-radius: 9px; }
}

/* Category rail */
.mpx-category-rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 1px 1px 4px;
    scrollbar-width: thin;
}
.mpx-cat-chip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e7edf5;
    color: #344054;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}
.mpx-cat-chip.is-active { background: #0b65d8; border-color: #0b65d8; color: #fff; }
.mpx-cat-icon { font-size: 12px; }

/* Hero / promo carousel */
.mpx-hero-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
    scrollbar-width: thin;
}
.mpx-hero-slide {
    flex: 0 0 82%;
    max-width: 420px;
    scroll-snap-align: start;
    border-radius: 18px;
    padding: 22px 24px;
    color: #fff;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 120px;
    justify-content: center;
}
.mpx-hero-deals { background: linear-gradient(135deg, #ef4444, #f59e0b); }
.mpx-hero-wishlist { background: linear-gradient(135deg, #db2777, #7c3aed); }
.mpx-hero-vendor { background: linear-gradient(135deg, #0f766e, #0b65d8); }
.mpx-hero-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .85; font-weight: 800; }
.mpx-hero-slide strong { font-size: 21px; line-height: 1.25; }
.mpx-hero-cta { font-size: 13px; font-weight: 700; opacity: .95; }

/* Section shell + horizontal carousel */
.mpx-section { display: flex; flex-direction: column; gap: 10px; }
.mpx-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}
.mpx-section-head h2 { margin: 0; font-size: 17px; }
.mpx-section-head a { font-size: 13px; font-weight: 700; color: #0b65d8; text-decoration: none; white-space: nowrap; }

.mpx-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 6px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.mpx-track-item { flex: 0 0 168px; scroll-snap-align: start; }
.mpx-track-item .mpx-card { height: 100%; }

/* Sponsored card (in-carousel) */
.mpx-sponsored-card {
    flex: 0 0 168px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid #e7edf5;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    color: inherit;
    padding-bottom: 8px;
}
.mpx-sponsored-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.mpx-sponsored-card strong { padding: 0 8px; font-size: 13px; line-height: 1.3; }

/* Badges (shared) */
.mpx-badge-row { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.mpx-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.mpx-badge-sponsored { background: #111827; color: #fff; }
.mpx-badge-deal { background: #16a34a; color: #fff; }

/* Product card — compact so 4-6 fit on one mobile screen (2 cols x 2-3
   rows) without hurting the "premium" feel: shorter (not square) image,
   tighter type scale/padding, a subtle hover lift for a more designed feel. */
.mpx-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
    transition: box-shadow .15s ease, transform .15s ease;
}
.mpx-card:hover { box-shadow: 0 10px 24px rgba(15, 23, 42, .1); transform: translateY(-1px); }
.mpx-card-media {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 100%;
    background: #f4f7fb;
}
.mpx-card-media img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.mpx-card-img-placeholder {
    display: grid; place-items: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    font-size: 26px; font-weight: 800; color: #98a2b3;
}
.mpx-wishlist-form { position: absolute; top: 6px; right: 6px; z-index: 2; }
.mpx-wishlist-btn {
    width: 26px; height: 26px;
    border-radius: 999px;
    border: 0;
    background: rgba(255,255,255,.92);
    box-shadow: 0 2px 6px rgba(15,23,42,.15);
    font-size: 13px;
    cursor: pointer;
    color: #ef4444;
    line-height: 1;
}
.mpx-wishlist-btn.is-active { background: #fff; }
.mpx-card-body { padding: 7px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.mpx-card-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #101828;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
    min-height: 2.3em;
}
.mpx-card-vendor { margin: 0; font-size: 9.5px; color: #98a2b3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpx-price-row { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.mpx-price-now { font-size: 13.5px; font-weight: 800; color: #101828; }
.mpx-price-mrp { font-size: 10.5px; color: #98a2b3; }
.mpx-price-points { font-size: 12.5px; font-weight: 800; color: #0f766e; }
.mpx-card-stock { margin: 0; font-size: 9.5px; color: #16a34a; }
.mpx-card-stock.is-out { color: #ef4444; }
.mpx-add-form { margin-top: auto; padding-top: 4px; }
.mpx-add-btn {
    width: 100%;
    border: 1px solid #0b65d8;
    background: #eaf2fe;
    color: #0b65d8;
    font-weight: 800;
    font-size: 10.5px;
    padding: 5px;
    border-radius: 7px;
    cursor: pointer;
}
.mpx-add-btn:disabled { opacity: .5; cursor: not-allowed; border-color: #d0d5dd; background: #f2f4f7; color: #98a2b3; }

/* Vendor store card */
.mpx-vendor-card {
    flex: 0 0 180px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e7edf5;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    padding-bottom: 12px;
}
.mpx-vendor-cover { display: block; width: 100%; height: 56px; background: linear-gradient(135deg, #0f766e, #0b65d8) center/cover; }
.mpx-vendor-logo {
    width: 56px; height: 56px;
    border-radius: 999px;
    background: #eaf2fe center/cover;
    border: 3px solid #fff;
    margin-top: -32px;
    display: grid; place-items: center;
    font-weight: 800; color: #0b65d8; font-size: 20px;
}
.mpx-vendor-card strong { font-size: 13px; padding: 0 8px; }
.mpx-vendor-card small { color: #98a2b3; font-size: 11px; }

/* Listing grid */
.mpx-listing-head { align-items: center; }
.mpx-sort-form { display: flex; align-items: center; gap: 6px; }
.mpx-sort-form label { font-size: 12px; color: #667085; font-weight: 700; }
.mpx-sort-form select {
    border: 1px solid #e7edf5;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 12px;
    background: #fff;
}
.mpx-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.mpx-empty { grid-column: 1 / -1; text-align: center; padding: 40px 16px; color: #667085; }

/* Room for the fixed mobile bottom nav (Home/Categories/Wishlist/Offers,
   ~68px) so the last row of cards / pagination never sits underneath it. */
@media (max-width: 760px) {
    .mpx-shell { padding-bottom: 84px; }
}

/* Laravel's default pagination view ships a mobile-only Prev/Next block
   and a desktop-only "Showing X of Y" + numbered-pages block, toggled by
   Tailwind's `sm:hidden` / `hidden sm:flex` utility classes — which this
   app doesn't load, so both rendered at once (visible duplicate
   pagination). Keep only the numbered/pilled block, on every width. */
.mpx-shell nav[role="navigation"] .sm\:hidden { display: none !important; }
.mpx-shell nav[role="navigation"] .hidden.sm\:flex-1 {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* Laravel's default pagination view renders raw <svg> prev/next icons —
   the app only constrains their size inside `.fb-feed` (see app.css), so
   on marketplace pages (`.mpx-shell`) they rendered at native/huge size
   whenever there was enough data to actually paginate. */
.mpx-shell nav[role="navigation"] {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}
.mpx-shell nav[role="navigation"] svg { width: 18px; height: 18px; }
.mpx-shell nav[role="navigation"] span,
.mpx-shell nav[role="navigation"] a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 8px;
    text-decoration: none;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}
.mpx-shell nav[role="navigation"] a:hover { background: #f4f7fb; }
.mpx-shell nav[role="navigation"] span[aria-current="page"] span { background: #0b65d8; color: #fff; border-radius: 8px; padding: 0 4px; }

@media (min-width: 640px) {
    .mpx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mpx-track-item, .mpx-sponsored-card { flex-basis: 190px; }
}
@media (min-width: 900px) {
    .mpx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
    .mpx-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .mpx-hero-slide { flex-basis: 48%; }
}

/* Vendor dashboard tiles */
.mpx-vendor-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 20px;
}
.mpx-vendor-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 10px;
    border: 1px solid #e7edf5;
    border-radius: 12px;
    background: #f9fbfd;
    text-decoration: none;
    color: #101828;
    font-weight: 700;
    font-size: 12px;
    text-align: center;
    font-size: 22px;
}
.mpx-vendor-tile span { font-size: 12px; }
@media (min-width: 640px) {
    .mpx-vendor-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Product detail page */
.mpx-breadcrumb { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: #98a2b3; margin-bottom: 6px; }
.mpx-breadcrumb a { color: #667085; text-decoration: none; }
.mpx-breadcrumb .is-current { color: #344054; font-weight: 700; }
.mpx-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 16px;
    padding: 16px;
}
.mpx-detail-main-img {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f4f7fb;
    border-radius: 14px;
    overflow: hidden;
}
.mpx-detail-main-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mpx-detail-main-img .mpx-badge { position: absolute; top: 10px; left: 10px; }
.mpx-detail-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.mpx-thumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 1px solid #e7edf5; padding: 0; cursor: pointer; background: #fff; }
.mpx-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mpx-detail-info h1 { margin: 0 0 4px; font-size: 21px; }
.mpx-detail-vendor { margin: 0 0 12px; font-size: 13px; color: #667085; }
.mpx-detail-vendor a { color: #0b65d8; text-decoration: none; font-weight: 700; }
.mpx-variant-group { margin-bottom: 12px; }
.mpx-variant-group strong { display: block; font-size: 12px; color: #667085; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.mpx-variant-options { display: flex; flex-wrap: wrap; gap: 8px; }
.mpx-variant-option {
    padding: 8px 16px;
    border: 1px solid #e7edf5;
    border-radius: 9px;
    background: #fff;
    color: #344054;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}
.mpx-variant-option.is-active { border-color: #0b65d8; background: #eaf2fe; color: #0b65d8; }
.mpx-detail-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.mpx-detail-price .mpx-price-now { font-size: 26px; }
.mpx-detail-price .mpx-price-mrp { font-size: 15px; }
.mpx-detail-gst { margin: 0 0 8px; font-size: 12px; color: #667085; }
.mpx-detail-stock { font-size: 13px; font-weight: 700; color: #16a34a; margin: 0 0 16px; }
.mpx-detail-stock.is-out { color: #ef4444; }
.mpx-detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.mpx-detail-add-form { display: flex; gap: 8px; align-items: center; }
.mpx-qty-field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #667085; font-weight: 700; }
.mpx-qty-field input { width: 56px; padding: 10px 8px; border: 1px solid #e7edf5; border-radius: 9px; }
.mpx-detail-add-btn {
    border: 0; background: #0b65d8; color: #fff; font-weight: 800;
    padding: 11px 22px; border-radius: 10px; cursor: pointer; font-size: 14px;
}
.mpx-detail-add-btn:disabled { background: #d0d5dd; cursor: not-allowed; }
.mpx-detail-wishlist-btn {
    border: 1px solid #e7edf5; background: #fff; color: #344054;
    padding: 11px 18px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 14px;
}
.mpx-detail-wishlist-btn.is-active { border-color: #ef4444; color: #ef4444; }
.mpx-detail-description h2 { font-size: 15px; margin: 0 0 6px; }
.mpx-detail-description p { margin: 0; color: #475467; line-height: 1.6; font-size: 14px; }

@media (min-width: 760px) {
    .mpx-detail { grid-template-columns: minmax(0, 380px) 1fr; }
}

.mpx-checkout-steps {
    display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 16px; padding: 0;
}
.mpx-checkout-steps li {
    display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
    border: 1px solid #e7edf5; background: #fff; color: #667085; font-size: 13px; font-weight: 700;
}
.mpx-checkout-steps li span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%; background: #e7edf5; color: #344054; font-size: 11px;
}
.mpx-checkout-steps li.is-active { border-color: #0b65d8; color: #0b65d8; }
.mpx-checkout-steps li.is-active span { background: #0b65d8; color: #fff; }
.mpx-checkout-steps li.is-done { color: #12b76a; }
.mpx-checkout-steps li.is-done span { background: #12b76a; color: #fff; }

@media (prefers-color-scheme: dark) {
    .mpx-header, .mpx-card, .mpx-sponsored-card, .mpx-vendor-card, .mpx-cat-chip, .mpx-detail, .mpx-thumb { background: #18181b; border-color: #27272a; }
    .mpx-search-bar { background: #0f0f11; border-color: #27272a; }
    .mpx-card-title, .mpx-detail-info h1 { color: #f4f4f5; }
    .mpx-icon-link { background: #27272a; color: #e4e4e7; }
    .mpx-detail-wishlist-btn { background: #18181b; border-color: #27272a; color: #e4e4e7; }
    .mpx-checkout-steps li { background: #18181b; border-color: #27272a; color: #a1a1aa; }
    .mpx-category-tile, .mpx-subcat-rail { background: #18181b; border-color: #27272a; }
    .mpx-subcat-link { color: #a1a1aa; }
    .mpx-price-field { background: #0f0f11; border-color: #27272a; }
}

/* Compact header — scoped strictly behind body.marketplace-body so it
   never leaks onto Feed/Reels/Chat/Wallet/Meet. Must out-specificity the
   existing !important mobile override in app.css. */
@media (max-width: 760px) {
    body.marketplace-body nav.topbar.auth-topbar {
        padding: 6px 12px !important;
    }
    body.marketplace-body nav.topbar.auth-topbar .round-action {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
    }
}

/* Browse Categories — image-tile grid, the primary visual category-discovery
   surface (replaces "no visual category browsing" complaint). */
.mpx-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.mpx-category-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 14px;
    padding: 10px 6px 8px;
    text-align: center;
}
.mpx-category-tile-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    background: linear-gradient(135deg, #334155, #94a3b8) center/cover;
}
.mpx-category-tile-label { font-size: 11.5px; font-weight: 700; color: #101828; line-height: 1.25; }
@media (min-width: 640px) {
    .mpx-category-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
    .mpx-category-tile-label { font-size: 13px; }
}

/* Subcategory rail + listing split */
.mpx-listing-body { display: flex; gap: 16px; align-items: flex-start; }
.mpx-listing-content { flex: 1; min-width: 0; }
.mpx-subcat-rail {
    display: flex;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    flex: 0 0 auto;
}
.mpx-subcat-link {
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e7edf5;
    color: #344054;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}
.mpx-subcat-link.is-active { background: #0b65d8; border-color: #0b65d8; color: #fff; }

/* Price filter bar */
.mpx-filter-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mpx-price-field {
    display: flex;
    align-items: center;
    gap: 3px;
    background: #f4f7fb;
    border: 1px solid #e7edf5;
    border-radius: 8px;
    padding: 4px 6px;
    font-size: 11px;
    color: #667085;
}
.mpx-price-field input {
    width: 52px;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 12px;
    color: #101828;
}
.mpx-filter-apply {
    border: 1px solid #0b65d8;
    background: #eaf2fe;
    color: #0b65d8;
    font-weight: 700;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
}

/* Vendor store stats row */
.mpx-store-stats { display: flex; gap: 14px; flex-wrap: wrap; padding: 2px 2px 0; }
.mpx-store-stat { font-size: 12px; color: #667085; }
.mpx-store-stat strong { color: #101828; }

/* Desktop layout — wider header row, more columns, sidebar+content split */
@media (min-width: 1024px) {
    .mpx-header-top { flex-direction: row; align-items: center; }
    .mpx-category-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 14px; }
    .mpx-listing-body { gap: 24px; }
    .mpx-subcat-rail {
        flex-direction: column;
        position: sticky;
        top: 12px;
        width: 200px;
        flex: 0 0 200px;
        align-items: stretch;
    }
    .mpx-subcat-link { text-align: left; }
}
