:root{--navy:#06183f;--orange:#ff4a1f;--line:#e4e8ef;--muted:#667085;--green:#0e9f61}
*{box-sizing:border-box}
body{margin:0;background:#f6f7fa;color:#101828;font-family:"Inter",Arial,sans-serif}
a{text-decoration:none;color:inherit}button,input{font:inherit}
.listing-header{width:min(calc(100% - 28px),1450px);margin:auto;min-height:76px;display:grid;grid-template-columns:auto minmax(280px,1fr) auto;align-items:center;gap:22px}
.listing-logo{display:flex;align-items:flex-end;font-family:"Poppins",sans-serif;font-size:30px;font-weight:800;line-height:.85}.listing-logo span{color:var(--navy)}.listing-logo b{color:var(--orange)}.listing-logo small{font-family:"Inter",sans-serif;font-size:9px;color:var(--navy);margin-left:-91px;transform:translateY(15px)}
.listing-search{height:46px;border:1px solid #dbe0e8;background:#fff;border-radius:14px;display:flex;align-items:center;overflow:hidden}.listing-search>i{margin-left:14px;color:#98a2b3}.listing-search input{width:100%;min-width:0;border:0;outline:0;padding:0 12px}.listing-search button{width:52px;height:100%;border:0;background:var(--navy);color:#fff}
.listing-header-actions{display:flex;align-items:center;gap:15px}.listing-header-actions a{font-size:11px;font-weight:700}.listing-header-actions .sell-link{padding:10px 13px;border-radius:10px;background:var(--orange);color:#fff}
.listing-shell{width:min(calc(100% - 28px),1280px);margin:14px auto 60px}
.breadcrumb{display:flex;align-items:center;gap:8px;margin:8px 2px 14px;color:#667085;font-size:10px;white-space:nowrap;overflow:hidden}.breadcrumb i{font-size:7px}.breadcrumb span{overflow:hidden;text-overflow:ellipsis}
.owner-status{padding:10px 12px;border-radius:10px;margin-bottom:12px;font-size:11px;font-weight:700}.status-pending{background:#fff5db;color:#8a5a00}.status-rejected,.status-blocked{background:#fff0ee;color:#b42318}.status-sold{background:#eef1f5;color:#667085}
.listing-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:14px;align-items:start}
.listing-main{display:grid;gap:12px}.listing-side{display:grid;gap:12px;position:sticky;top:16px}
.gallery-card,.details-card,.price-card,.seller-card{background:#fff;border:1px solid var(--line);border-radius:18px}
.gallery-card{padding:12px}.main-photo{height:min(57vw,610px);max-height:610px;border-radius:13px;overflow:hidden;background:#eef1f5;display:grid;place-items:center}.main-photo img{width:100%;height:100%;object-fit:contain;background:#f3f4f6}.no-photo{font-size:46px;color:#a7b0bd}
.thumb-row{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;margin-top:9px}.thumb{aspect-ratio:1;border:2px solid transparent;border-radius:10px;padding:0;overflow:hidden;background:#eef1f5;cursor:pointer}.thumb.active{border-color:#ff4a1f}.thumb img{width:100%;height:100%;object-fit:cover}
.details-card{padding:20px}.section-title h2{font-family:"Poppins",sans-serif;margin:0 0 12px;color:var(--navy);font-size:18px}.description{margin:0;color:#475467;font-size:12px;line-height:1.7}
.detail-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.detail-grid>div{padding:12px;border:1px solid #edf0f4;border-radius:11px;background:#fafbfc}.detail-grid span{display:block;color:#98a2b3;font-size:9px}.detail-grid strong{display:block;margin-top:4px;font-size:11.5px}
.safety-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.safety-grid span{display:flex;align-items:flex-start;gap:8px;padding:11px;border-radius:10px;background:#fafbfc;color:#475467;font-size:10px;line-height:1.45}.safety-grid i{color:#0ca363;margin-top:2px}
.price-card{padding:20px}.status-line{display:flex;align-items:center;justify-content:space-between;gap:10px}.category-pill,.sold-pill,.negotiable{display:inline-flex;padding:5px 8px;border-radius:999px;font-size:8.5px;font-weight:800}.category-pill{background:#eef3ff;color:#315cc9}.sold-pill{background:#eef1f5;color:#667085}.negotiable{background:#eaf9f1;color:#117047;margin-top:8px}
.price-card h1{font-family:"Poppins",sans-serif;margin:12px 0 6px;font-size:24px;line-height:1.2;color:var(--navy)}.price{font-size:29px;font-weight:800;color:#111827}
.listing-meta{display:grid;gap:8px;margin-top:18px;padding-top:15px;border-top:1px solid #edf0f4}.listing-meta span{display:flex;align-items:center;gap:8px;color:#667085;font-size:10.5px}.listing-meta i{width:14px;color:#7f8ca0}
.contact-btn,.login-chat-btn,.owner-actions a{min-height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;gap:8px;font-size:11px;font-weight:800}.contact-btn{margin-top:17px;background:var(--orange);color:#fff}.login-chat-btn{margin-top:8px;background:var(--navy);color:#fff}.owner-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:17px}.owner-actions a:first-child{background:var(--orange);color:#fff}.owner-actions a:last-child{background:#f2f4f7;color:#344054}
.seller-card{padding:17px}.seller-kicker{font-size:8px;font-weight:800;letter-spacing:.12em;color:#98a2b3}.seller-profile{display:flex;align-items:center;gap:11px;margin-top:10px}.seller-avatar{width:52px;height:52px;border-radius:50%;overflow:hidden;background:#eef1f5;display:grid;place-items:center;color:#8492a6}.seller-avatar img{width:100%;height:100%;object-fit:cover}.seller-profile>div:last-child{display:flex;flex-direction:column}.seller-profile strong{font-size:12px}.seller-profile small{margin-top:3px;color:#667085;font-size:9.5px}.seller-profile small i{color:#0ca363}.seller-card>p{margin:12px 0 0;padding-top:10px;border-top:1px solid #edf0f4;color:#667085;font-size:9.5px}
.related-section{margin-top:18px}.related-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.related-head h2{font-family:"Poppins",sans-serif;margin:0;color:var(--navy);font-size:20px}.related-head a{color:#2767ff;font-size:10px;font-weight:700}.related-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:11px}.related-card{overflow:hidden;border:1px solid var(--line);border-radius:14px;background:#fff}.related-image{height:155px;background:#eef1f5;display:grid;place-items:center;color:#a7b0bd;font-size:28px}.related-image img{width:100%;height:100%;object-fit:cover}.related-card>div:last-child{padding:10px}.related-card h3{margin:0 0 5px;font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.related-card strong{display:block;font-size:15px}.related-card small{display:block;margin-top:5px;color:#667085;font-size:9px}
.not-found{min-height:420px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;background:#fff;border:1px solid var(--line);border-radius:18px;padding:30px}.not-found>i{font-size:42px;color:#a5afbb}.not-found h1{font-family:"Poppins",sans-serif;margin:14px 0 5px;color:var(--navy)}.not-found p{margin:0 0 16px;color:#667085;font-size:12px}.not-found a{padding:10px 14px;border-radius:10px;background:var(--orange);color:#fff;font-size:11px;font-weight:800}
@media(max-width:980px){.listing-layout{grid-template-columns:1fr}.listing-side{position:static;grid-template-columns:1fr 1fr}.price-card{grid-column:1/-1}.related-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:680px){.listing-header{width:calc(100% - 16px);grid-template-columns:1fr auto;padding:8px 0}.listing-logo{font-size:25px}.listing-logo small{display:none}.listing-search{grid-column:1/-1;grid-row:2}.listing-header-actions .sell-link{display:none}.listing-header-actions a{font-size:0}.listing-header-actions i{font-size:20px}.listing-shell{width:calc(100% - 16px);margin-top:8px}.main-photo{height:420px}.thumb-row{grid-template-columns:repeat(5,1fr)}.listing-side{grid-template-columns:1fr}.price-card{grid-column:auto}.detail-grid,.safety-grid{grid-template-columns:1fr}.related-grid{grid-template-columns:repeat(2,1fr)}.related-image{height:120px}}


/* UPDATE 18 — GLOBAL READABILITY */
body{
    color:#101828;
}

small{
    font-size:12px !important;
    color:#475467 !important;
    line-height:1.45 !important;
}

input,
select,
textarea,
button{
    color:#101828;
}

::placeholder{
    color:#667085 !important;
    opacity:1;
}

/* Listing detail readability */
.listing-logo small,
.listing-header-actions a,
.breadcrumb,
.owner-status,
.description,
.detail-grid span,
.detail-grid strong,
.safety-grid span,
.category-pill,
.sold-pill,
.negotiable,
.listing-meta span,
.contact-btn,
.login-chat-btn,
.owner-actions a,
.seller-kicker,
.seller-profile strong,
.seller-profile small,
.seller-card>p,
.related-head a,
.related-card h3,
.related-card small,
.not-found p{
    font-size:12px !important;
}

.breadcrumb,
.description,
.detail-grid span,
.safety-grid span,
.listing-meta span,
.seller-kicker,
.seller-profile small,
.seller-card>p,
.related-card small,
.not-found p{
    color:#475467 !important;
}


/* UPDATE 19 — GLOBAL PUBLIC WIDTH MATCH HOME */
.listing-header,
.listing-shell{
    width:min(calc(100% - 28px),1540px) !important;
    max-width:1540px !important;
}

.listing-header{
    padding-left:4px;
    padding-right:4px;
}

.listing-layout{
    grid-template-columns:minmax(0,1fr) 390px;
}

@media(max-width:680px){
    .listing-header,
    .listing-shell{
        width:calc(100% - 16px) !important;
    }
}



/* UPDATE 21 — LISTING DETAIL SAVE BUTTON */
.listing-title-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:start;
    gap:12px;
    margin-top:12px;
}
.listing-title-row h1{
    margin:0 !important;
}
.detail-favorite{
    width:42px;
    height:42px;
    border:1px solid #e2e7ee;
    border-radius:50%;
    display:grid;
    place-items:center;
    background:#fff;
    color:#475467;
    cursor:pointer;
    font-size:17px;
}
.detail-favorite.is-saved{
    color:#ff3f59;
    background:#fff2f4;
    border-color:#ffd7de;
}


/* UPDATE 24 — LISTING NOTIFICATION BELL */
.listing-notification-link{position:relative;display:inline-flex!important;align-items:center;justify-content:center;min-width:32px}
.listing-notification-badge{position:absolute;top:-7px;right:-7px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;background:#ff4a1f;color:#fff;font-size:10px!important;font-weight:800;border:2px solid #fff}

.listing-header-actions .listing-notification-link{width:38px;height:38px;border:1px solid #e1e6ed;border-radius:50%;display:grid;place-items:center}
.listing-header-actions .listing-notification-link i{font-size:18px}


/* UPDATE 27 — REPORT & SAFETY */
.listing-report-success{display:flex;align-items:center;gap:7px;margin-bottom:10px;padding:10px 12px;border-radius:10px;background:#eaf9f1;color:#117047;font-size:12px;font-weight:700}
.report-ad-link{min-height:38px;margin-top:8px;border-radius:9px;display:flex;align-items:center;justify-content:center;gap:7px;border:1px solid #e0e5ec;background:#fff;color:#667085;font-size:12px;font-weight:700}
.report-ad-link:hover,.report-seller-link:hover{color:#b42318;border-color:#f2b8b3;background:#fff7f6}
.report-seller-link{display:flex;align-items:center;justify-content:center;gap:7px;margin-top:11px;padding-top:11px;border-top:1px solid #edf0f4;color:#667085;font-size:12px;font-weight:700}


/* UPDATE 28 — DESKTOP LISTING IMAGE GALLERY */
.gallery-card{
    padding:12px;
    overflow:hidden;
}

.gallery-media{
    display:grid;
    grid-template-columns:minmax(0,1fr) 96px;
    gap:10px;
    align-items:stretch;
}

.gallery-card.single-image .gallery-media{
    grid-template-columns:1fr;
}

.main-photo{
    position:relative;
    height:clamp(390px,34vw,500px) !important;
    max-height:500px !important;
    min-width:0;
    border-radius:13px;
    overflow:hidden;
    background:#eef1f5;
    display:grid;
    place-items:center;
}

.main-photo-button{
    position:relative;
    width:100%;
    height:100%;
    padding:0;
    border:0;
    display:block;
    background:#f3f4f6;
    cursor:zoom-in;
    overflow:hidden;
}

.main-photo-button img{
    width:100%;
    height:100%;
    object-fit:contain;
    background:#f3f4f6;
}

.main-photo-zoom{
    position:absolute;
    right:12px;
    bottom:12px;
    min-height:34px;
    padding:0 11px;
    display:inline-flex;
    align-items:center;
    gap:7px;
    border-radius:9px;
    background:rgba(6,24,63,.88);
    color:#fff;
    font-size:11px;
    font-weight:800;
    box-shadow:0 4px 14px rgba(6,24,63,.18);
    backdrop-filter:blur(5px);
}

.thumb-rail{
    min-width:0;
    height:clamp(390px,34vw,500px);
    max-height:500px;
    display:grid;
    grid-template-rows:30px minmax(0,1fr) 30px;
    gap:6px;
}

.thumb-viewport{
    min-height:0;
    overflow-y:auto;
    display:flex;
    flex-direction:column;
    gap:7px;
    scroll-behavior:smooth;
    scrollbar-width:none;
    overscroll-behavior:contain;
}

.thumb-viewport::-webkit-scrollbar{
    display:none;
}

.thumb{
    width:100%;
    min-height:79px;
    height:79px;
    flex:0 0 79px;
    padding:3px;
    border:2px solid transparent;
    border-radius:10px;
    overflow:hidden;
    background:#eef1f5;
    cursor:pointer;
    transition:border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.thumb:hover{
    border-color:#cfd6df;
}

.thumb.active{
    border-color:#ff4a1f;
    box-shadow:0 0 0 1px rgba(255,74,31,.12);
}

.thumb img{
    width:100%;
    height:100%;
    display:block;
    object-fit:cover;
    border-radius:6px;
}

.thumb-scroll{
    width:100%;
    height:30px;
    border:1px solid #dfe4eb;
    border-radius:8px;
    display:grid;
    place-items:center;
    background:#fff;
    color:#344054;
    cursor:pointer;
    font-size:11px;
    transition:.15s ease;
}

.thumb-scroll:hover:not(:disabled){
    border-color:#b8c2cf;
    background:#f8fafc;
}

.thumb-scroll:disabled{
    opacity:.28;
    cursor:default;
}

/* Full-screen popup gallery */
body.lightbox-open{
    overflow:hidden;
}

.listing-lightbox{
    position:fixed;
    inset:0;
    z-index:9999;
    display:none;
    align-items:center;
    justify-content:center;
    padding:24px;
}

.listing-lightbox.open{
    display:flex;
}

.listing-lightbox-backdrop{
    position:absolute;
    inset:0;
    background:rgba(3,10,24,.92);
    backdrop-filter:blur(3px);
}

.listing-lightbox-panel{
    position:relative;
    z-index:1;
    width:min(94vw,1450px);
    height:min(92vh,900px);
    display:flex;
    align-items:center;
    justify-content:center;
}

.lightbox-image-wrap{
    width:100%;
    height:100%;
    display:grid;
    place-items:center;
}

.lightbox-image-wrap img{
    display:block;
    max-width:100%;
    max-height:100%;
    object-fit:contain;
    border-radius:8px;
    box-shadow:0 20px 60px rgba(0,0,0,.28);
    user-select:none;
}

.lightbox-close{
    position:absolute;
    z-index:3;
    top:0;
    right:0;
    width:44px;
    height:44px;
    border:0;
    border-radius:50%;
    display:grid;
    place-items:center;
    background:rgba(255,255,255,.13);
    color:#fff;
    font-size:20px;
    cursor:pointer;
    backdrop-filter:blur(5px);
}

.lightbox-counter{
    position:absolute;
    z-index:3;
    top:7px;
    left:50%;
    transform:translateX(-50%);
    min-height:31px;
    padding:0 11px;
    display:flex;
    align-items:center;
    gap:5px;
    border-radius:999px;
    background:rgba(0,0,0,.38);
    color:#fff;
    font-size:12px;
    font-weight:700;
}

.lightbox-nav{
    position:absolute;
    z-index:3;
    top:50%;
    width:48px;
    height:48px;
    transform:translateY(-50%);
    border:0;
    border-radius:50%;
    display:grid;
    place-items:center;
    background:rgba(255,255,255,.14);
    color:#fff;
    font-size:18px;
    cursor:pointer;
    backdrop-filter:blur(6px);
    transition:.15s ease;
}

.lightbox-nav:hover{
    background:rgba(255,255,255,.24);
}

.lightbox-prev{
    left:0;
}

.lightbox-next{
    right:0;
}

@media(max-width:980px){
    .main-photo,
    .thumb-rail{
        height:clamp(380px,54vw,500px) !important;
        max-height:500px !important;
    }
}

@media(max-width:680px){
    .gallery-media{
        grid-template-columns:1fr;
        grid-template-rows:auto auto;
        gap:8px;
    }

    .main-photo{
        height:360px !important;
        max-height:360px !important;
    }

    .thumb-rail{
        height:auto !important;
        max-height:none !important;
        display:grid;
        grid-template-columns:30px minmax(0,1fr) 30px;
        grid-template-rows:82px;
        gap:6px;
    }

    .thumb-viewport{
        flex-direction:row;
        overflow-x:auto;
        overflow-y:hidden;
        gap:7px;
    }

    .thumb{
        width:82px;
        min-width:82px;
        height:82px;
        min-height:82px;
        flex:0 0 82px;
    }

    .thumb-scroll{
        width:30px;
        height:82px;
    }

    .thumb-scroll-up i{
        transform:rotate(-90deg);
    }

    .thumb-scroll-down i{
        transform:rotate(-90deg);
    }

    .main-photo-zoom{
        right:9px;
        bottom:9px;
        min-height:32px;
        padding:0 9px;
        font-size:10px;
    }

    .listing-lightbox{
        padding:10px;
    }

    .listing-lightbox-panel{
        width:100%;
        height:92vh;
    }

    .lightbox-close{
        top:4px;
        right:4px;
        width:40px;
        height:40px;
    }

    .lightbox-nav{
        width:40px;
        height:40px;
    }

    .lightbox-prev{
        left:3px;
    }

    .lightbox-next{
        right:3px;
    }
}

@media(max-width:430px){
    .main-photo{
        height:320px !important;
        max-height:320px !important;
    }
}


/* UPDATE 29 — VERIFIED DEALER ON LISTING */
.seller-dealer-link{color:#06183f}
.seller-dealer-link:hover{color:#315cc9}
.view-dealer-profile{min-height:37px;margin-top:10px;border-radius:9px;display:flex;align-items:center;justify-content:center;gap:7px;background:#eef3ff;color:#315cc9;font-size:12px;font-weight:800}


/* =========================================================
   UPDATE 31 — MOBILE RESPONSIVE & UI CONSISTENCY
   ========================================================= */
html,body{
    max-width:100%;
    overflow-x:hidden;
}
img,video,svg{
    max-width:100%;
}
@media(max-width:900px){
    input,select,textarea{
        font-size:16px !important;
    }
    button,a{
        -webkit-tap-highlight-color:transparent;
    }
}

@media(max-width:680px){
    .listing-header{
        width:calc(100% - 10px);
        min-height:auto;
        padding:7px 0 9px;
        gap:7px;
    }
    .listing-logo{font-size:24px}
    .listing-search{
        height:43px;
        border-radius:11px;
    }
    .listing-header-actions{
        gap:5px;
    }
    .listing-header-actions .listing-notification-link{
        width:38px;height:38px;
    }
    .listing-header-actions .top-user-trigger{
        height:38px;
    }
    .listing-shell{
        width:calc(100% - 10px);
        margin-top:6px;
    }
    .breadcrumb{
        overflow-x:auto;
        white-space:nowrap;
        padding-bottom:4px;
        scrollbar-width:none;
    }
    .breadcrumb::-webkit-scrollbar{display:none}
    .listing-layout{gap:8px}
    .gallery-card{padding:7px;border-radius:13px}
    .main-photo{
        height:300px!important;
        max-height:300px!important;
        border-radius:10px;
    }
    .thumb-rail{
        grid-template-rows:72px!important;
        height:auto!important;
    }
    .thumb,.thumb-scroll{
        height:72px!important;
        min-height:72px!important;
    }
    .thumb{
        width:72px!important;
        min-width:72px!important;
        flex-basis:72px!important;
    }
    .main-photo-zoom{
        min-height:30px;
        font-size:10px;
    }
    .listing-side{
        gap:8px;
    }
    .price-card,.seller-card,.detail-card,.safety-card{
        padding:14px;
        border-radius:13px;
    }
    .price-card h1{font-size:24px}
    .price-card .price{font-size:25px}
    .contact-btn,.login-chat-btn,.report-ad-link,.view-dealer-profile{
        min-height:42px;
    }
    .seller-profile{
        align-items:center;
    }
    .seller-avatar{
        width:48px;height:48px;
    }
    .detail-grid,.safety-grid{gap:7px}
    .related-grid{gap:7px}
    .related-card{border-radius:10px}
    .related-image{height:125px}
    .listing-lightbox{padding:6px}
    .lightbox-counter{top:4px}
}
@media(max-width:430px){
    .main-photo{
        height:270px!important;
        max-height:270px!important;
    }
    .related-image{height:115px}
}


/* UPDATE 32 — MOBILE QA ROUND 2 HARDENING */
@media(max-width:900px){
    main,section,article,aside,header,footer,nav,form,div{
        min-width:0;
    }
    h1,h2,h3,h4,p,span,strong,small,a,label{
        overflow-wrap:anywhere;
    }
    table{
        max-width:100%;
    }
}

@media(max-width:680px){
    .listing-header{
        overflow:visible!important;
    }
    .listing-header-actions{
        min-width:0!important;
        flex-wrap:nowrap!important;
    }
    .listing-header-actions .top-user-menu{
        flex:0 0 auto;
    }
    .listing-search input{
        min-width:0!important;
    }
    .listing-layout,
    .listing-main,
    .listing-side,
    .gallery-card,
    .gallery-media{
        min-width:0!important;
        max-width:100%!important;
    }
    .price-card h1,
    .detail-card,
    .seller-card{
        overflow-wrap:anywhere;
    }
}




/* =========================================================
   UPDATE 37A — VIEW AD MOBILE LAYOUT HOTFIX
   Final override after Update 19/28/31/32 rules.
   ========================================================= */

/* Update 19 reintroduced the desktop 390px sidebar after the
   original <=980px media rule. Force the responsive layout here,
   at the END of the stylesheet so it always wins. */
@media(max-width:980px){
    .listing-layout{
        display:grid !important;
        grid-template-columns:minmax(0,1fr) !important;
        width:100% !important;
        min-width:0 !important;
        max-width:100% !important;
        gap:12px !important;
        align-items:start !important;
    }

    /* Flatten the two desktop wrappers so mobile/tablet can use a
       sensible content order: photos -> price -> seller -> details. */
    .listing-main,
    .listing-side{
        display:contents !important;
    }

    .gallery-card{
        order:1;
        width:100% !important;
        min-width:0 !important;
        max-width:100% !important;
    }

    .price-card{
        order:2;
        grid-column:auto !important;
        width:100% !important;
        min-width:0 !important;
        max-width:100% !important;
    }

    .seller-card{
        order:3;
        width:100% !important;
        min-width:0 !important;
        max-width:100% !important;
    }

    .listing-main > .details-card{
        order:4;
        width:100% !important;
        min-width:0 !important;
        max-width:100% !important;
    }

    .listing-lightbox{
        order:99;
    }

    .details-card,
    .detail-grid,
    .safety-grid,
    .description{
        width:100% !important;
        min-width:0 !important;
        max-width:100% !important;
    }

    .description,
    .details-card p,
    .details-card span,
    .details-card strong{
        white-space:normal !important;
        overflow-wrap:break-word !important;
        word-break:normal !important;
    }

    .listing-side{
        position:static !important;
        top:auto !important;
    }
}

@media(max-width:680px){
    .listing-shell{
        width:calc(100% - 10px) !important;
        max-width:none !important;
        margin:6px auto 34px !important;
        overflow:visible !important;
    }

    .listing-layout{
        gap:8px !important;
    }

    .gallery-card,
    .price-card,
    .seller-card,
    .details-card{
        border-radius:13px !important;
        overflow:hidden;
    }

    .gallery-card{
        padding:7px !important;
    }

    .gallery-media{
        display:grid !important;
        grid-template-columns:minmax(0,1fr) !important;
        grid-template-rows:auto auto !important;
        width:100% !important;
        min-width:0 !important;
        max-width:100% !important;
        gap:7px !important;
    }

    .main-photo{
        width:100% !important;
        min-width:0 !important;
        max-width:100% !important;
        height:300px !important;
        max-height:300px !important;
        border-radius:10px !important;
    }

    .main-photo-button,
    .main-photo-button img{
        width:100% !important;
        min-width:0 !important;
        max-width:100% !important;
        height:100% !important;
    }

    .main-photo-button img{
        object-fit:contain !important;
    }

    .thumb-rail{
        width:100% !important;
        min-width:0 !important;
        max-width:100% !important;
        height:auto !important;
        max-height:none !important;
        display:grid !important;
        grid-template-columns:30px minmax(0,1fr) 30px !important;
        grid-template-rows:72px !important;
        gap:6px !important;
    }

    .thumb-viewport{
        width:100% !important;
        min-width:0 !important;
        max-width:100% !important;
        display:flex !important;
        flex-direction:row !important;
        overflow-x:auto !important;
        overflow-y:hidden !important;
    }

    .thumb{
        width:72px !important;
        min-width:72px !important;
        height:72px !important;
        min-height:72px !important;
        flex:0 0 72px !important;
    }

    .thumb-scroll{
        width:30px !important;
        min-width:30px !important;
        height:72px !important;
        min-height:72px !important;
    }

    .price-card,
    .seller-card,
    .details-card{
        padding:14px !important;
    }

    .listing-title-row{
        grid-template-columns:minmax(0,1fr) 42px !important;
        width:100% !important;
        min-width:0 !important;
        gap:9px !important;
    }

    .listing-title-row h1{
        min-width:0 !important;
        max-width:100% !important;
        font-size:22px !important;
        line-height:1.25 !important;
        overflow-wrap:break-word !important;
        word-break:normal !important;
    }

    .price{
        font-size:25px !important;
        line-height:1.15 !important;
    }

    .listing-meta{
        width:100% !important;
        min-width:0 !important;
    }

    .listing-meta span{
        min-width:0 !important;
        overflow-wrap:break-word !important;
        word-break:normal !important;
    }

    .seller-profile{
        width:100% !important;
        min-width:0 !important;
    }

    .seller-profile > div:last-child{
        min-width:0 !important;
        flex:1 1 auto !important;
    }

    .seller-profile strong,
    .seller-profile small,
    .seller-card > p{
        overflow-wrap:break-word !important;
        word-break:normal !important;
    }

    .section-title h2{
        font-size:17px !important;
        line-height:1.3 !important;
    }

    .description{
        display:block !important;
        font-size:12px !important;
        line-height:1.65 !important;
        writing-mode:horizontal-tb !important;
        text-orientation:mixed !important;
        letter-spacing:normal !important;
    }

    .detail-grid,
    .safety-grid{
        display:grid !important;
        grid-template-columns:minmax(0,1fr) !important;
        width:100% !important;
        min-width:0 !important;
        gap:7px !important;
    }

    .detail-grid > div,
    .safety-grid > span{
        width:100% !important;
        min-width:0 !important;
        max-width:100% !important;
        overflow-wrap:break-word !important;
        word-break:normal !important;
    }

    .contact-btn,
    .login-chat-btn,
    .report-ad-link,
    .view-dealer-profile,
    .report-seller-link{
        width:100% !important;
        min-width:0 !important;
    }

    .related-section{
        width:100% !important;
        min-width:0 !important;
    }

    .related-grid{
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    }
}

@media(max-width:430px){
    .main-photo{
        height:270px !important;
        max-height:270px !important;
    }

    .price-card,
    .seller-card,
    .details-card{
        padding:12px !important;
    }
}


/* UPDATE 37B — MOBILE CRITICAL FALLBACK
   The same essential rules are also inline in listing.php so browser/CDN
   cache cannot keep the broken desktop grid on mobile. */
@media(max-width:980px){
    .listing-layout{
        display:block!important;
        grid-template-columns:none!important;
        width:100%!important;
        min-width:0!important;
        max-width:100%!important;
    }
    .listing-main,
    .listing-side{
        display:block!important;
        position:static!important;
        width:100%!important;
        min-width:0!important;
        max-width:100%!important;
    }
    .gallery-card,
    .price-card,
    .seller-card,
    .details-card{
        width:100%!important;
        min-width:0!important;
        max-width:100%!important;
    }
}


/* =========================================================
   UPDATE 38 — GALLERY / READABILITY / SHARED CARD QA
   ========================================================= */
.main-photo{
    position:relative;
}
.main-photo-nav{
    position:absolute;
    z-index:5;
    top:50%;
    width:42px;
    height:42px;
    transform:translateY(-50%);
    border:1px solid rgba(255,255,255,.85);
    border-radius:50%;
    display:grid;
    place-items:center;
    background:rgba(6,24,63,.72);
    color:#fff;
    cursor:pointer;
    box-shadow:0 5px 18px rgba(6,24,63,.2);
    backdrop-filter:blur(4px);
}
.main-photo-prev{left:12px}
.main-photo-next{right:12px}
.main-photo-nav:hover{background:#06183f}

.listing-lightbox{
    padding:12px!important;
}
.listing-lightbox-panel{
    width:calc(100vw - 24px)!important;
    height:calc(100dvh - 24px)!important;
    max-width:none!important;
    max-height:none!important;
    overflow:hidden!important;
}
.lightbox-image-wrap{
    width:100%!important;
    height:100%!important;
    padding:36px 58px 18px!important;
    overflow:hidden!important;
}
.lightbox-image-wrap img{
    width:auto!important;
    height:auto!important;
    max-width:100%!important;
    max-height:100%!important;
    object-fit:contain!important;
    object-position:center!important;
    border-radius:8px;
}

.description{
    font-size:14px!important;
    line-height:1.75!important;
    color:#344054!important;
}
.detail-grid span{
    font-size:11.5px!important;
    color:#667085!important;
}
.detail-grid strong{
    font-size:14px!important;
    line-height:1.4!important;
}
.safety-grid span{
    font-size:12.5px!important;
    line-height:1.55!important;
}
.section-title h2{
    font-size:19px!important;
}
.related-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:11px;
}
.contact-email-btn{
    background:#fff!important;
    color:#06183f!important;
    border:1px solid #d9e0ea!important;
}
@media(max-width:980px){
    .related-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:680px){
    .main-photo-nav{
        width:38px;
        height:38px;
    }
    .main-photo-prev{left:8px}
    .main-photo-next{right:8px}
    .lightbox-image-wrap{
        padding:46px 38px 24px!important;
    }
    .description{font-size:13.5px!important}
    .detail-grid strong{font-size:13.5px!important}
    .safety-grid span{font-size:12px!important}
}


/* =========================================================
   UPDATE 38A — LIGHTBOX EXACT VIEWPORT FIT
   Full image must remain visible for every aspect ratio.
   ========================================================= */
.listing-lightbox{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100dvh!important;
    padding:0!important;
    overflow:hidden!important;
}

.listing-lightbox-panel{
    position:absolute!important;
    inset:0!important;
    width:100vw!important;
    height:100dvh!important;
    max-width:none!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    display:block!important;
}

.lightbox-image-wrap{
    position:absolute!important;
    inset:0!important;
    width:100vw!important;
    height:100dvh!important;
    max-width:none!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
}

.lightbox-fit-image,
.lightbox-image-wrap #lightboxImage{
    display:block!important;
    position:relative!important;
    flex:0 0 auto!important;
    width:auto!important;
    height:auto!important;
    min-width:0!important;
    min-height:0!important;
    max-width:none!important;
    max-height:none!important;
    margin:auto!important;
    padding:0!important;
    object-fit:contain!important;
    object-position:center center!important;
    transform:none!important;
    border-radius:8px!important;
}

.lightbox-close{
    top:12px!important;
    right:12px!important;
}

.lightbox-counter{
    top:12px!important;
}

.lightbox-prev{
    left:12px!important;
}

.lightbox-next{
    right:12px!important;
}

@media(max-width:680px){
    .lightbox-close{
        top:8px!important;
        right:8px!important;
    }

    .lightbox-counter{
        top:8px!important;
    }

    .lightbox-prev{
        left:6px!important;
    }

    .lightbox-next{
        right:6px!important;
    }
}


/* UPDATE 39 — LOCATION IN LISTING HEADER */
@media(min-width:901px){
    .listing-header{
        grid-template-columns:auto 175px minmax(260px,1fr) auto!important;
        gap:12px!important;
    }
}
.listing-location-picker{
    height:44px;
    display:flex;
    align-items:center;
    gap:7px;
    padding:0 10px;
    border:1px solid #dbe0e8;
    border-radius:12px;
    background:#fff;
}
.listing-location-picker>i:first-child{color:#ff4a1f}
.listing-location-picker>i:last-child{font-size:9px;color:#667085;pointer-events:none}
.listing-location-picker select{
    width:100%;
    min-width:0;
    height:100%;
    border:0;
    outline:0;
    appearance:none;
    background:transparent;
    color:#344054;
    font-size:11px;
    font-weight:700;
}
@media(max-width:900px){
    .listing-location-picker{display:none}
}
