
/* MAGIC 1XTRA MARKETPLACE RESPONSIVE DESIGN V1
   Universal category design.
   Visual presentation only.
*/

body[data-mx-market-ui] {
    --mxm-bg:#08111e;
    --mxm-panel:#111e2e;
    --mxm-border:#26374b;
    --mxm-accent:#ff0069;
    --mxm-text:#f5f7fb;
    --mxm-muted:#a9b8cb;
    --mxm-radius:12px;
}

/* GENERAL MARKETPLACE PAGE */

body[data-mx-market-ui] #page {
    box-sizing:border-box!important;
    min-width:0!important;
    padding-bottom:calc(
        var(--mxm-nav-height,76px) + 24px +
        env(safe-area-inset-bottom,0px)
    )!important;
}

body[data-mx-market-ui] #page > section,
body[data-mx-market-ui] #page > .market-v2,
body[data-mx-market-ui] #page > .mx-market,
body[data-mx-market-ui] #page > .mx-wizard {
    box-sizing:border-box;
    width:100%;
    max-width:1180px!important;
    min-width:0;
    margin-inline:auto!important;
}

body[data-mx-market-ui] #page h1 {
    font-size:clamp(21px,2.2vw,30px)!important;
    line-height:1.25!important;
    overflow-wrap:anywhere;
}

body[data-mx-market-ui] #page h2 {
    font-size:clamp(18px,1.8vw,23px)!important;
    line-height:1.35!important;
}

body[data-mx-market-ui] #page h3 {
    font-size:15px;
    line-height:1.4;
    overflow-wrap:anywhere;
}

body[data-mx-market-ui] #page *,
body[data-mx-market-ui] #page *::before,
body[data-mx-market-ui] #page *::after {
    box-sizing:border-box;
}

body[data-mx-market-ui] #page img {
    max-width:100%;
}

body[data-mx-market-ui] #page input,
body[data-mx-market-ui] #page select,
body[data-mx-market-ui] #page textarea {
    max-width:100%;
    min-width:0;
    font-size:14px;
}

/* MARKETPLACE HOMEPAGE */

body[data-mx-market-ui] #page .market-v2 {
    padding:16px!important;
}

body[data-mx-market-ui] .market-v2-top,
body[data-mx-market-ui] .mx-market-head {
    background:linear-gradient(
        120deg,#122138,#0c1525 70%,#351129
    )!important;
    border:1px solid var(--mxm-border);
    border-radius:16px!important;
    padding:18px!important;
}

body[data-mx-market-ui] .market-v2-brand h1 em {
    color:var(--mxm-accent)!important;
}

body[data-mx-market-ui] .market-v2-brand p {
    font-size:13px!important;
}

body[data-mx-market-ui] .market-v2-search {
    min-height:44px;
    border:1px solid var(--mxm-border);
    border-radius:10px!important;
    min-width:0;
}

body[data-mx-market-ui] .market-v2-post {
    background:var(--mxm-accent)!important;
    color:#fff!important;
    border-radius:10px!important;
}

body[data-mx-market-ui] .market-v2-section {
    margin-top:22px!important;
    min-width:0;
}

body[data-mx-market-ui] .market-v2-heading {
    gap:10px;
    margin-bottom:12px!important;
}

body[data-mx-market-ui] .market-v2-heading p {
    font-size:12px!important;
    line-height:1.4;
}

body[data-mx-market-ui] .market-v2-heading a {
    color:#ff438e!important;
    font-size:13px;
}

/* ALL DYNAMIC CATEGORIES AND SERVICES */

body[data-mx-market-ui] .market-v2-category,
body[data-mx-market-ui] .market-v2-service {
    border-radius:10px!important;
    border:1px solid var(--mxm-border);
    background:var(--mxm-panel);
    min-width:0;
}

body[data-mx-market-ui] .market-v2-category b,
body[data-mx-market-ui] .market-v2-service b {
    font-size:12px!important;
    line-height:1.4;
    overflow-wrap:anywhere;
}

body[data-mx-market-ui] .market-v2-category span,
body[data-mx-market-ui] .market-v2-service span {
    font-size:26px!important;
}

body[data-mx-market-ui] .market-v2-promos {
    gap:12px!important;
}

body[data-mx-market-ui] .market-v2-promo {
    border-radius:12px!important;
    min-width:0;
}

/* UNIVERSAL LISTING GRIDS */

body[data-mx-market-ui] #page .market-v2-rail,
body[data-mx-market-ui] #page .market-v2-latest-grid,
body[data-mx-market-ui] #page .mx-grid {
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    grid-auto-flow:row!important;
    grid-auto-columns:auto!important;
    gap:12px!important;
    min-width:0;
    max-width:100%;
    overflow:visible!important;
    scroll-snap-type:none!important;
}

body[data-mx-market-ui] .market-v2-card,
body[data-mx-market-ui] .mx-card {
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    border:1px solid var(--mxm-border);
    border-radius:var(--mxm-radius)!important;
    background:var(--mxm-panel)!important;
    overflow:hidden;
    position:relative;
}

body[data-mx-market-ui] .market-v2-card-link,
body[data-mx-market-ui] .mx-card-link {
    display:block;
    min-width:0;
    width:100%;
    text-decoration:none;
}

body[data-mx-market-ui] .market-v2-image,
body[data-mx-market-ui] .mx-card-img {
    position:relative;
    aspect-ratio:4/3!important;
    height:auto!important;
    min-height:0!important;
    overflow:hidden;
}

body[data-mx-market-ui] .market-v2-image img,
body[data-mx-market-ui] .mx-card-img img {
    width:100%!important;
    height:100%!important;
    object-fit:cover;
}

body[data-mx-market-ui] .market-v2-card-body,
body[data-mx-market-ui] .mx-card-body {
    padding:10px!important;
    min-width:0;
}

body[data-mx-market-ui] .market-v2-card-body h3,
body[data-mx-market-ui] .mx-card-body h3 {
    font-size:13px!important;
    line-height:1.4!important;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden;
    min-height:36px;
}

body[data-mx-market-ui] .market-v2-card-body strong,
body[data-mx-market-ui] .mx-card .price {
    color:#ff438e!important;
    font-size:15px!important;
    overflow-wrap:anywhere;
}

body[data-mx-market-ui] .market-v2-location {
    font-size:11px!important;
    color:var(--mxm-muted);
}

body[data-mx-market-ui] .market-v2-heart {
    width:32px!important;
    height:32px!important;
    border-radius:50%;
    background:#08111ed9;
}

body[data-mx-market-ui] .market-v2-empty,
body[data-mx-market-ui] .mx-grid > .empty {
    grid-column:1/-1;
}

/* CATEGORY AND FILTER LAYOUT */

body[data-mx-market-ui] .mx-layout {
    display:grid;
    grid-template-columns:210px minmax(0,1fr);
    gap:16px;
}

body[data-mx-market-ui] .mx-layout main {
    min-width:0;
}

body[data-mx-market-ui] .mx-layout .mx-grid {
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
}

body[data-mx-market-ui] .mx-filters {
    background:var(--mxm-panel);
    border:1px solid var(--mxm-border);
    border-radius:12px;
    padding:14px!important;
    align-self:start;
}

body[data-mx-market-ui] .mx-filters select,
body[data-mx-market-ui] .mx-filters input {
    width:100%;
}

body[data-mx-market-ui] .mx-searchbar {
    gap:10px;
    min-width:0;
    flex-wrap:wrap;
}

body[data-mx-market-ui] .mx-results-head,
body[data-mx-market-ui] .mx-shortcuts {
    flex-wrap:wrap;
    gap:10px;
}

/* PRODUCT AND SERVICE DETAILS
   Scope identified by the marketplace-only script.
*/

body[data-mx-market-ui="detail"] #page {
    max-width:1080px!important;
    margin-inline:auto!important;
}

body[data-mx-market-ui="detail"] [data-mxm-detail-root] {
    width:100%!important;
    max-width:1000px!important;
    min-width:0;
    margin-inline:auto!important;
}

body[data-mx-market-ui="detail"] [data-mxm-detail-grid] {
    display:grid!important;
    grid-template-columns:minmax(0,0.9fr) minmax(0,1.1fr)!important;
    gap:22px!important;
    align-items:start!important;
}

body[data-mx-market-ui="detail"] [data-mxm-detail-grid] > * {
    min-width:0!important;
    max-width:100%!important;
}

body[data-mx-market-ui="detail"] [data-mxm-gallery] {
    width:100%;
    max-width:100%;
    min-width:0;
}

body[data-mx-market-ui="detail"] [data-mxm-gallery] img {
    max-width:100%!important;
    max-height:360px!important;
    object-fit:contain!important;
}

body[data-mx-market-ui="detail"] [data-mxm-gallery] {
    border-radius:12px!important;
}

body[data-mx-market-ui="detail"] [data-mxm-price] {
    padding:14px!important;
    border-radius:12px!important;
    min-height:0!important;
}

body[data-mx-market-ui="detail"] [data-mxm-price] strong,
body[data-mx-market-ui="detail"] [data-mxm-price] h2 {
    font-size:clamp(22px,2.4vw,30px)!important;
    line-height:1.3!important;
}

body[data-mx-market-ui="detail"] #page p {
    font-size:13px!important;
    line-height:1.65!important;
    overflow-wrap:anywhere;
}

/* CREATE LISTING, CART, CHECKOUT */

body[data-mx-market-ui="form"] #page > section,
body[data-mx-market-ui="form"] #page > .mx-wizard,
body[data-mx-market-ui="checkout"] #page > section,
body[data-mx-market-ui="cart"] #page > section {
    max-width:900px!important;
}

body[data-mx-market-ui] .mx-wizard {
    max-width:820px!important;
    margin-inline:auto;
}

body[data-mx-market-ui] #page form {
    min-width:0;
}

body[data-mx-market-ui] #page form input:not([type=checkbox]):not([type=radio]),
body[data-mx-market-ui] #page form select {
    min-height:42px;
}

body[data-mx-market-ui] #page form textarea {
    min-height:90px;
}

body[data-mx-market-ui] #page .btn {
    min-height:38px;
    border-radius:9px;
    font-size:13px;
    white-space:normal;
}

/* MESSAGES AND ORDER SCREENS */

body[data-mx-market-ui] .mx-chat {
    max-width:820px!important;
    margin-inline:auto;
    min-width:0;
}

body[data-mx-market-ui] .mx-msg {
    max-width:90%;
    padding:10px 12px!important;
    border-radius:12px!important;
    overflow-wrap:anywhere;
}

body[data-mx-market-ui] #mxMessageForm {
    display:flex;
    gap:8px;
}

body[data-mx-market-ui] #mxMessageForm input {
    flex:1;
    min-width:0;
}

body[data-mx-market-ui] .table-list,
body[data-mx-market-ui] .list-row {
    min-width:0;
    overflow-wrap:anywhere;
}

/* EXISTING MARKETPLACE NAVIGATION */

body[data-mx-market-ui] .mx-flutter-workspace-tabs {
    box-sizing:border-box;
    min-height:64px!important;
    padding-bottom:calc(
        8px + env(safe-area-inset-bottom,0px)
    )!important;
}

body[data-mx-market-ui] .mx-flutter-workspace-tab {
    min-width:0;
    font-size:11px!important;
    min-height:42px;
}

/* TABLETS */

@media(max-width:1050px) {
    body[data-mx-market-ui] #page .market-v2-rail,
    body[data-mx-market-ui] #page .market-v2-latest-grid,
    body[data-mx-market-ui] #page .mx-grid {
        grid-template-columns:repeat(4,minmax(0,1fr))!important;
    }

    body[data-mx-market-ui] .mx-layout .mx-grid {
        grid-template-columns:repeat(3,minmax(0,1fr))!important;
    }
}

@media(max-width:850px) {
    body[data-mx-market-ui] #page .market-v2-rail,
    body[data-mx-market-ui] #page .market-v2-latest-grid,
    body[data-mx-market-ui] #page .mx-grid {
        grid-template-columns:repeat(3,minmax(0,1fr))!important;
    }

    body[data-mx-market-ui] .mx-layout {
        grid-template-columns:180px minmax(0,1fr);
        gap:10px;
    }

    body[data-mx-market-ui] .mx-layout .mx-grid {
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
    }
}

/* ANDROID / IPHONE / SMALL SCREENS */

@media(max-width:700px) {
    html body[data-mx-market-ui] #page {
        width:100%!important;
        max-width:100%!important;
        min-width:0!important;
        padding-inline:10px!important;
    }

    html body[data-mx-market-ui] #page .market-v2 {
        padding:0!important;
    }

    body[data-mx-market-ui] .market-v2-top,
    body[data-mx-market-ui] .mx-market-head {
        padding:12px!important;
        border-radius:12px!important;
    }

    body[data-mx-market-ui] .market-v2-brand h1 {
        font-size:24px!important;
    }

    body[data-mx-market-ui] .market-v2-section {
        margin-top:18px!important;
    }

    html body[data-mx-market-ui] #page .market-v2-rail,
    html body[data-mx-market-ui] #page .market-v2-latest-grid,
    html body[data-mx-market-ui] #page .mx-grid,
    html body[data-mx-market-ui] .mx-layout .mx-grid {
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:9px!important;
    }

    body[data-mx-market-ui] .market-v2-card-body,
    body[data-mx-market-ui] .mx-card-body {
        padding:8px!important;
    }

    body[data-mx-market-ui] .market-v2-card-body strong,
    body[data-mx-market-ui] .mx-card .price {
        font-size:13px!important;
    }

    body[data-mx-market-ui] .market-v2-image,
    body[data-mx-market-ui] .mx-card-img {
        aspect-ratio:4/3!important;
    }

    body[data-mx-market-ui] .market-v2-card-body h3,
    body[data-mx-market-ui] .mx-card-body h3 {
        font-size:12px!important;
    }

    body[data-mx-market-ui] .mx-layout {
        grid-template-columns:minmax(0,1fr)!important;
    }

    body[data-mx-market-ui] .mx-filters {
        padding:12px!important;
    }

    body[data-mx-market-ui="detail"] [data-mxm-detail-grid] {
        grid-template-columns:minmax(0,1fr)!important;
        gap:14px!important;
    }

    body[data-mx-market-ui="detail"] [data-mxm-gallery] img {
        max-height:285px!important;
        width:100%;
        object-fit:contain!important;
    }

    body[data-mx-market-ui="detail"] #page h1 {
        font-size:22px!important;
        line-height:1.3!important;
    }

    body[data-mx-market-ui="detail"] [data-mxm-price] {
        padding:12px!important;
    }

    body[data-mx-market-ui="detail"] [data-mxm-price] strong {
        font-size:23px!important;
    }

    body[data-mx-market-ui] #page form input,
    body[data-mx-market-ui] #page form select,
    body[data-mx-market-ui] #page form textarea {
        font-size:16px!important;
    }

    body[data-mx-market-ui] #page .btn {
        min-height:42px;
    }

    body[data-mx-market-ui] .market-v2-category b,
    body[data-mx-market-ui] .market-v2-service b {
        font-size:11px!important;
    }

    body[data-mx-market-ui] .market-v2-category span,
    body[data-mx-market-ui] .market-v2-service span {
        font-size:23px!important;
    }
}

@media(prefers-reduced-motion:reduce) {
    body[data-mx-market-ui] #page * {
        scroll-behavior:auto!important;
    }
}
