
/* =====================================================
   MAGIC 1XTRA PROFESSIONAL LISTING LAYOUT V3
   Universal listing details.
   Corrects verified legacy layout conflicts.
   ===================================================== */

html body #page main.mxp-detail {
    --mx-detail-panel:#0c1928;
    --mx-detail-border:#26374b;
    --mx-detail-muted:#aebed0;
    --mx-detail-pink:#ff0069;

    display:block!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:1100px!important;
    min-width:0!important;
    margin:0 auto!important;
    padding:16px 20px 30px!important;
}

html body #page main.mxp-detail *,
html body #page main.mxp-detail *::before,
html body #page main.mxp-detail *::after {
    box-sizing:border-box;
}

/* BREADCRUMB */

html body #page .mxp-detail .mxp-breadcrumb {
    display:flex!important;
    flex-wrap:wrap;
    align-items:center;
    gap:8px!important;
    margin:0 0 16px!important;
    font-size:12px!important;
}

/* MAIN LISTING */

html body #page .mxp-detail > .mxp-product {
    display:grid!important;
    grid-template-columns:
        minmax(0,1fr) minmax(0,1fr)!important;
    gap:24px!important;
    align-items:start!important;
    width:100%!important;
    max-width:100%!important;
    margin:0 0 20px!important;
}

html body #page .mxp-detail .mxp-media,
html body #page .mxp-detail .mxp-summary {
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    position:relative!important;
    top:auto!important;
    float:none!important;
    transform:none!important;
}

/* ORIGINAL IMAGE GALLERY */

html body #page .mxp-detail .mxp-gallery {
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:auto!important;
}

html body #page .mxp-detail #mxMarketMainImage {
    display:block!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:360px!important;
    aspect-ratio:4/3!important;
    padding:0!important;
    margin:0!important;
    background-size:contain!important;
    background-position:center!important;
    background-repeat:no-repeat!important;
    background-color:#080f19!important;
    border-radius:12px!important;
    overflow:hidden!important;
}

html body #page .mxp-detail .mxp-media img {
    display:block;
    max-width:100%!important;
    height:auto;
    object-fit:contain!important;
}

html body #page .mxp-detail [data-market-image] {
    max-width:76px!important;
    min-width:0!important;
    min-height:0!important;
    height:64px!important;
    aspect-ratio:1;
    background-size:cover!important;
    border-radius:8px!important;
}

/* TITLE AND LISTING INFORMATION */

html body #page .mxp-detail .mxp-summary h1 {
    width:100%!important;
    max-width:100%!important;
    font-size:28px!important;
    font-weight:800!important;
    line-height:1.3!important;
    letter-spacing:-.5px!important;
    margin:8px 0 12px!important;
    overflow-wrap:anywhere!important;
}

html body #page .mxp-detail .mxp-eyebrow {
    font-size:11px!important;
    letter-spacing:.8px!important;
}

html body #page .mxp-detail .mxp-meta {
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    gap:8px!important;
    margin:12px 0!important;
}

html body #page .mxp-detail .mxp-hero-vendor {
    display:flex!important;
    align-items:center!important;
    gap:10px!important;
    width:100%!important;
    min-width:0!important;
    padding:10px!important;
    margin:10px 0!important;
}

html body #page .mxp-detail .mxp-hero-vendor-copy {
    flex:1 1 0!important;
    min-width:0!important;
}

html body #page .mxp-detail .mxp-price {
    display:flex!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    height:auto!important;
    margin:12px 0!important;
    padding:14px 16px!important;
    border-radius:10px!important;
    gap:5px!important;
}

html body #page .mxp-detail .mxp-price > strong {
    font-size:30px!important;
    line-height:1.25!important;
    letter-spacing:-.4px!important;
    color:#ff438b!important;
    overflow-wrap:anywhere!important;
}

/* GENERAL CONTENT PANELS */

html body #page .mxp-detail .mxp-section {
    box-sizing:border-box!important;
    min-width:0!important;
    max-width:100%!important;
    padding:18px!important;
    border:1px solid var(--mx-detail-border)!important;
    background:var(--mx-detail-panel)!important;
    border-radius:12px!important;
    box-shadow:none!important;
}

html body #page .mxp-detail .mxp-section-head {
    width:100%!important;
    min-width:0!important;
    margin:0 0 12px!important;
}

html body #page .mxp-detail .mxp-section-head h2 {
    font-size:19px!important;
    line-height:1.35!important;
    letter-spacing:-.2px!important;
    margin:4px 0 0!important;
}

html body #page .mxp-detail .mxp-section-head span {
    font-size:10px!important;
    letter-spacing:.8px!important;
}

/* CORRECT THE VERIFIED LEGACY PERCENTAGE-WIDTH BUG */

html body #page .mxp-detail > .mxp-lower-grid {
    display:grid!important;
    grid-template-columns:
        minmax(0,1.65fr) minmax(280px,1fr)!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    align-items:start!important;
    justify-items:stretch!important;
    justify-content:stretch!important;
    gap:18px!important;
    margin:18px 0!important;
    padding:0!important;
}

html body #page .mxp-detail > .mxp-lower-grid
    > .mxp-section,

html body #page .mxp-detail > .mxp-lower-grid
    > .mxp-section:has(.mxp-description),

html body #page .mxp-detail > .mxp-lower-grid
    > .mxp-section:has(.mxp-description) + .mxp-vendor {

    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    padding:18px!important;
    float:none!important;
    position:relative!important;
    left:auto!important;
    right:auto!important;
    top:auto!important;
    transform:none!important;
    align-self:start!important;
    justify-self:stretch!important;
}

/* Fill the available area when no description exists. */

html body #page .mxp-detail > .mxp-lower-grid
    > .mxp-section:only-child {
    grid-column:1/-1!important;
}

/* DESCRIPTION */

html body #page .mxp-detail .mxp-description {
    display:block!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
    padding:0!important;
    margin:0!important;
    text-indent:0!important;
    text-align:left!important;
    white-space:pre-line!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
    font-size:14px!important;
    line-height:1.75!important;
    color:var(--mx-detail-muted)!important;
}

/* SELLER CARD */

html body #page .mxp-detail .mxp-vendor-card {
    display:grid!important;
    grid-template-columns:48px minmax(0,1fr)!important;
    align-items:start!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    min-height:0!important;
    height:auto!important;
    gap:12px!important;
    padding:0!important;
    margin:0!important;
    background:transparent!important;
    border:0!important;
}

html body #page .mxp-detail .mxp-vendor-avatar {
    width:48px!important;
    height:48px!important;
    min-width:48px!important;
    max-width:48px!important;
    border-radius:50%!important;
    background-size:cover!important;
    background-position:center!important;
    font-size:20px!important;
}

html body #page .mxp-detail .mxp-vendor-info {
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    overflow-wrap:anywhere!important;
}

html body #page .mxp-detail .mxp-vendor-name {
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    gap:5px!important;
    min-width:0!important;
}

html body #page .mxp-detail .mxp-vendor-name h3 {
    font-size:16px!important;
    line-height:1.35!important;
    margin:0!important;
}

html body #page .mxp-detail .mxp-vendor-info p {
    width:100%!important;
    max-width:100%!important;
    font-size:13px!important;
    line-height:1.6!important;
    margin:5px 0!important;
    overflow-wrap:anywhere!important;
}

html body #page .mxp-detail .mxp-vendor-stats {
    display:flex!important;
    flex-wrap:wrap!important;
    gap:8px!important;
}

html body #page .mxp-detail .mxp-vendor-buttons,
html body #page .mxp-detail .mxp-vendor-actions {
    display:grid!important;
    grid-column:1/-1!important;
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:4px 0 0!important;
    gap:8px!important;
}

/* CONTAIN SPONSORED CONTENT WITHIN THE SELLER PANEL */

html body #page .mxp-detail .mxp-vendor
    > :not(.mxp-section-head),

html body #page .mxp-detail .mxp-vendor
    .mxp-vendor-card > * {
    min-width:0!important;
    max-width:100%!important;
}

html body #page .mxp-detail .mxp-vendor img {
    max-width:100%!important;
    object-fit:contain;
}

html body #page .mxp-detail .mxp-vendor a {
    max-width:100%!important;
    min-width:0!important;
    overflow-wrap:anywhere;
}

html body #page .mxp-detail .mxp-vendor iframe {
    width:100%!important;
    max-width:100%!important;
}

/* Keep nested advertiser content within its grid cell. */

html body #page .mxp-detail .mxp-vendor
    :is(div,article,aside,section,a) {
    min-width:0!important;
    max-width:100%!important;
}

html body #page .mxp-detail .mxp-vendor {
    overflow:hidden!important;
}

/* CUSTOMER ACTIONS
   Restore actual actions hidden by old mockup CSS.
*/

html body #page .mxp-detail
    .mxp-summary > .mxp-actions {
    display:flex!important;
    flex-wrap:wrap!important;
    gap:8px!important;
    width:100%!important;
}

html body #page .mxp-detail .mxp-btn {
    box-sizing:border-box!important;
    max-width:100%!important;
    min-width:0!important;
    min-height:42px!important;
    height:auto!important;
    padding:10px 14px!important;
    font-size:13px!important;
    line-height:1.4!important;
    border-radius:8px!important;
    white-space:normal!important;
    text-align:center!important;
}

html body #page .mxp-detail
    .mxp-vendor-buttons .mxp-btn {
    width:100%!important;
}

/* ORDER FORM */

html body #page .mxp-detail .mxp-order-box {
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    padding:14px!important;
    margin:12px 0!important;
}

html body #page .mxp-detail .mxp-order-fields {
    display:grid!important;
    grid-template-columns:
        repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
}

html body #page .mxp-detail .mxp-order-wide {
    grid-column:1/-1!important;
}

html body #page .mxp-detail .mxp-order-field,
html body #page .mxp-detail .mxp-order-field input,
html body #page .mxp-detail .mxp-order-field textarea {
    min-width:0!important;
    max-width:100%!important;
    width:100%!important;
}

html body #page .mxp-detail .mxp-order-summary {
    flex-wrap:wrap!important;
    gap:12px!important;
}

html body #page .mxp-detail
    .mxp-order-summary-actions {
    display:flex!important;
    flex-wrap:wrap!important;
    gap:8px!important;
    width:100%!important;
}

html body #page .mxp-detail
    .mxp-order-summary-actions button {
    flex:1 1 130px!important;
}

/* FOOTER AND NAVIGATION CLEARANCE */

html body #page .mxp-detail .mxp-footer-actions {
    display:flex!important;
    align-items:center;
    flex-wrap:wrap!important;
    justify-content:space-between!important;
    gap:12px!important;
    margin:20px 0 0!important;
    padding:12px 0!important;
    font-size:12px!important;
}

html body[data-mx-market-ui="detail"] #page,
html body.mx-flutter-market-workspace
    #page:has(> .mxp-detail) {
    padding-bottom:calc(
        var(--mxm-nav-height,76px) +
        env(safe-area-inset-bottom,0px) +
        24px
    )!important;
}

/* TABLETS AND MOBILE */

@media(max-width:820px) {

    html body #page main.mxp-detail {
        padding:12px 10px 20px!important;
    }

    html body #page .mxp-detail > .mxp-product,
    html body #page .mxp-detail > .mxp-lower-grid {
        grid-template-columns:minmax(0,1fr)!important;
        gap:14px!important;
    }

    html body #page .mxp-detail #mxMarketMainImage {
        max-height:300px!important;
    }

    html body #page .mxp-detail .mxp-summary h1 {
        font-size:23px!important;
        line-height:1.3!important;
    }

    html body #page .mxp-detail .mxp-price > strong {
        font-size:26px!important;
    }

    html body #page .mxp-detail .mxp-section,
    html body #page .mxp-detail > .mxp-lower-grid
        > .mxp-section {
        padding:14px!important;
    }

    html body #page .mxp-detail .mxp-description {
        font-size:13px!important;
    }

    html body #page .mxp-detail .mxp-order-fields {
        grid-template-columns:minmax(0,1fr)!important;
    }

    html body #page .mxp-detail .mxp-order-field input,
    html body #page .mxp-detail .mxp-order-field textarea {
        font-size:16px!important;
    }
}

@media(max-width:380px) {

    html body #page main.mxp-detail {
        padding-inline:6px!important;
    }

    html body #page .mxp-detail #mxMarketMainImage {
        max-height:250px!important;
    }

    html body #page .mxp-detail .mxp-vendor-card {
        grid-template-columns:40px minmax(0,1fr)!important;
    }

    html body #page .mxp-detail .mxp-vendor-avatar {
        width:40px!important;
        height:40px!important;
        min-width:40px!important;
    }
}
