
/* STEP86: marketplace visual redesign, desktop-first with clean mobile fallback */
:root{--a86-ink:#102a2e;--a86-muted:#65747b;--a86-line:#dfe5e7;--a86-bg:#f2f4f5;--a86-green:#00a86b;--a86-dark:#073b3d}
body.ads-subdomain-body{background:var(--a86-bg)}
.ads-page{max-width:1440px!important;margin:0 auto!important;padding:28px 24px 96px!important}
.ads86-hero{position:relative;background:#fff;border-radius:20px;padding:34px 36px 28px;margin-bottom:28px;box-shadow:0 8px 30px rgba(16,42,46,.06)}
.ads86-hero-copy{max-width:760px}.ads86-eyebrow{font-size:13px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--a86-green)}
.ads86-hero h1{font-size:42px;line-height:1.08;margin:8px 0 10px;color:var(--a86-ink)}.ads86-hero p{font-size:18px;line-height:1.5;color:var(--a86-muted);margin:0}
.ads86-stats{display:flex;gap:22px;flex-wrap:wrap;margin-top:18px;color:var(--a86-muted)}.ads86-stats strong{color:var(--a86-ink);font-size:20px}
.ads86-submit{position:absolute;right:36px;top:36px;background:var(--a86-green);color:#fff!important;padding:15px 23px;border-radius:10px;font-weight:800;text-decoration:none}
.ads86-search-form{display:grid;grid-template-columns:minmax(0,2fr) minmax(220px,.8fr) 150px;gap:0;margin-top:30px;border:1px solid var(--a86-line);border-radius:12px;overflow:visible;background:#fff}
.ads86-search-form>label{padding:12px 18px;border-right:1px solid var(--a86-line)}.ads86-search-form label>span{display:block;font-size:12px;color:var(--a86-muted);margin-bottom:4px}.ads86-search-main>div{display:flex;align-items:center;gap:10px}.ads86-search-icon{font-size:25px!important;margin:0!important;color:var(--a86-ink)!important}
.ads86-search-form input,.ads86-search-form select{width:100%;border:0!important;background:transparent!important;box-shadow:none!important;padding:5px 0!important;font-size:17px;color:var(--a86-ink);outline:none}.ads86-search-form>button{border:0;background:var(--a86-dark);color:#fff;font-size:17px;font-weight:800;cursor:pointer}
.ads86-more-filters{grid-column:1/-1;border-top:1px solid var(--a86-line);padding:0 18px}.ads86-more-filters summary{padding:13px 0;cursor:pointer;color:var(--a86-muted);font-weight:700}.ads86-more-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;padding:0 0 17px}.ads86-more-grid label{border:1px solid var(--a86-line);border-radius:9px;padding:9px 12px}.ads86-photo-check{display:flex;align-items:center;gap:10px}.ads86-photo-check input{width:20px!important}.ads86-photo-check span{margin:0!important}
.ads-kufar-topbar,.ads-filter-panel.ads-kufar-filters,.ads-kufar-actions-row{display:none!important}
.ads-kufar-categories{background:#fff!important;border-radius:18px!important;padding:24px!important;margin-bottom:28px!important;box-shadow:0 5px 20px rgba(16,42,46,.04)}
.ads-kufar-category-scroller{gap:22px!important}.ads-kufar-category-item{min-width:150px!important}.ads-kufar-category-figure{width:76px!important;height:76px!important}.ads-kufar-category-name{font-weight:700!important;color:var(--a86-ink)!important}
.ads-layout{display:block!important}.ads-side-column{display:none!important}.ads-main-column{width:100%!important;max-width:none!important}.ads-section-head{margin:22px 0 16px!important}.ads-section-head h2{font-size:30px!important;color:var(--a86-ink)}
.ads-grid.ads-kufar-cards{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:14px!important}
.kf-ad-card{position:relative!important;background:#fff!important;border:0!important;border-radius:6px!important;overflow:hidden!important;box-shadow:0 1px 0 rgba(0,0,0,.03)!important;transition:transform .16s ease,box-shadow .16s ease!important;min-width:0!important}.kf-ad-card:hover{transform:translateY(-2px);box-shadow:0 8px 24px rgba(16,42,46,.10)!important}
.kf-ad-photo{height:auto!important;aspect-ratio:4/3!important;background:#e8ecee!important;border-radius:0!important}.kf-ad-photo img{width:100%!important;height:100%!important;object-fit:cover!important}.kf-card-gallery-prev,.kf-card-gallery-next,.kf-detail-gallery-prev,.kf-detail-gallery-next{display:none!important}.kf-card-gallery-dots{display:none!important}.kf-photo-count{background:rgba(0,0,0,.58)!important;color:#fff!important;border-radius:14px!important;font-size:12px!important;padding:4px 8px!important}
.kf-ad-body{padding:13px 14px 15px!important;min-height:172px!important;display:flex!important;flex-direction:column!important}.kf-ad-title{font-size:17px!important;line-height:1.3!important;font-weight:600!important;color:var(--a86-ink)!important;min-height:44px!important}.kf-ad-price{font-size:19px!important;font-weight:800!important;color:var(--a86-ink)!important;margin-top:auto!important;padding-top:12px!important}.kf-ad-meta{display:flex!important;justify-content:space-between!important;gap:8px!important;font-size:13px!important;color:var(--a86-muted)!important;margin-top:10px!important}.kf-ad-seller{font-size:12px!important;color:#8a969b!important;margin-top:5px!important}.ad-type-badge{font-size:11px!important;align-self:flex-start!important;margin-bottom:7px!important}
/* detail */
.ad-detail-page.kf-detail{width:min(1420px,calc(100% - 48px))!important;max-width:1420px!important;margin:30px auto 90px!important;display:block!important;min-height:0!important}.kf-detail-breadcrumbs{margin-bottom:18px!important;color:var(--a86-muted)}
.ad-detail-page .kf-detail-grid{display:grid!important;grid-template-columns:minmax(0,1fr) 390px!important;gap:20px!important;align-items:start!important;min-height:0!important}.ad-detail-page .kf-detail-media{min-height:0!important;background:#fff;border-radius:10px;padding:18px!important}.ad-detail-page .kf-detail-gallery{display:grid!important;grid-template-columns:88px minmax(0,1fr)!important;gap:14px!important;min-height:0!important}.ad-detail-page .kf-detail-thumbs{display:flex!important;flex-direction:column!important;gap:10px!important;max-height:650px!important;overflow:auto!important}.ad-detail-page .kf-detail-thumb{width:82px!important;height:72px!important;border:2px solid transparent!important;border-radius:7px!important;overflow:hidden!important}.ad-detail-page .kf-detail-thumb.is-active{border-color:var(--a86-green)!important}.ad-detail-page .kf-detail-thumb img{width:100%;height:100%;object-fit:cover}.ad-detail-page .kf-detail-main-photo{height:650px!important;min-height:650px!important;background:#eef1f2!important;border-radius:8px!important;overflow:hidden!important}.ad-detail-page .kf-detail-main-photo img{width:100%!important;height:100%!important;object-fit:contain!important}.kf-detail-gallery-dots{display:none!important}
.ad-detail-page .kf-detail-side{width:auto!important;position:sticky!important;top:18px!important;background:transparent!important;border:0!important;padding:0!important}.kf-detail-head,.kf-contact-actions,.kf-seller-card,.kf-phone-box,.kf-safe-box{background:#fff!important;border:0!important;border-radius:10px!important;padding:20px!important;margin:0 0 12px!important;box-shadow:none!important}.kf-detail-price{font-size:31px!important}.kf-detail-head h1{font-size:27px!important;line-height:1.25!important}.kf-contact-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important}.kf-contact-actions .kf-primary-action,.kf-contact-actions .kf-secondary-action{grid-column:1/-1!important}.ad-contact-action{min-height:52px!important;border-radius:7px!important;font-weight:800!important}.kf-seller-card{display:flex!important}.kf-detail-description,.kf-ad-map-section,.related-ads{background:#fff!important;border:0!important;border-radius:10px!important;padding:28px!important;margin:20px 0 0!important;box-shadow:none!important}.kf-detail-description{width:calc(100% - 410px)!important;max-width:none!important}.kf-detail-description h2,.related-ads h2{font-size:27px!important;margin:0 0 18px!important;color:var(--a86-ink)}.ad-description{font-size:17px!important;line-height:1.65!important;color:#263b3f!important}.related-ads-grid{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:14px!important}.related-classified-card{background:#fff!important;border:1px solid var(--a86-line)!important;border-radius:7px!important;overflow:hidden!important;padding:0 0 14px!important;text-decoration:none!important}.related-classified-card img,.related-no-image{width:100%!important;height:160px!important;object-fit:cover!important;border-radius:0!important}.related-classified-card strong,.related-classified-card span{display:block!important;padding:0 13px!important}.related-classified-card strong{font-size:16px!important;line-height:1.3!important;margin-top:11px!important;color:var(--a86-ink)}.related-classified-card span{font-size:17px!important;font-weight:800!important;margin-top:8px!important;color:var(--a86-ink)}
.ads-seo-intro{background:#fff!important;border-radius:12px!important;padding:24px!important}
@media(max-width:1100px){.ads-grid.ads-kufar-cards{grid-template-columns:repeat(3,minmax(0,1fr))!important}.ad-detail-page .kf-detail-grid{grid-template-columns:minmax(0,1fr) 340px!important}.related-ads-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media(max-width:899px){body.ads-subdomain-body{background:#fff}.ads-page{padding:14px 14px 84px!important}.ads86-hero{padding:22px 16px 16px;border-radius:14px}.ads86-hero h1{font-size:30px}.ads86-hero p{font-size:15px}.ads86-submit{position:static;display:inline-block;margin-top:16px}.ads86-search-form{grid-template-columns:1fr;margin-top:18px;overflow:hidden}.ads86-search-form>label{border-right:0;border-bottom:1px solid var(--a86-line)}.ads86-search-form>button{height:54px}.ads86-more-grid{grid-template-columns:1fr 1fr}.ads-grid.ads-kufar-cards{grid-template-columns:1fr!important;gap:0!important}.kf-ad-card{display:grid!important;grid-template-columns:42% 58%!important;border-bottom:1px solid var(--a86-line)!important;border-radius:0!important;padding:12px 0!important;box-shadow:none!important}.kf-ad-photo{aspect-ratio:1/1!important;border-radius:8px!important}.kf-ad-body{min-height:0!important;padding:3px 0 3px 13px!important}.kf-ad-title{min-height:0!important;font-size:17px!important}.kf-ad-meta{flex-direction:column!important;gap:2px!important}.ad-detail-page.kf-detail{width:100%!important;margin:0 auto 82px!important}.ad-detail-page .kf-detail-grid{display:block!important}.ad-detail-page .kf-detail-media{padding:0!important;border-radius:0!important}.ad-detail-page .kf-detail-gallery{display:block!important}.ad-detail-page .kf-detail-thumbs{display:flex!important;flex-direction:row!important;max-height:none!important;padding:10px 12px!important;overflow-x:auto!important}.ad-detail-page .kf-detail-thumb{flex:0 0 72px!important;height:58px!important}.ad-detail-page .kf-detail-main-photo{height:70vh!important;min-height:420px!important;border-radius:0!important}.ad-detail-page .kf-detail-side{position:static!important;padding:12px!important}.kf-detail-description,.kf-ad-map-section,.related-ads{width:auto!important;margin:12px!important;padding:20px!important}.related-ads-grid{display:flex!important;overflow-x:auto!important;grid-template-columns:none!important}.related-classified-card{flex:0 0 230px!important}.kf-detail-breadcrumbs{padding:12px!important;white-space:nowrap;overflow:auto}.kf-contact-actions{grid-template-columns:1fr!important}.kf-contact-actions>*{grid-column:auto!important}}
@media(max-width:520px){.ads86-more-grid{grid-template-columns:1fr}.ads86-stats{gap:10px;flex-direction:column}.ad-detail-page .kf-detail-main-photo{height:58vh!important;min-height:360px!important}.kf-detail-head h1{font-size:25px!important}}

/* STEP87: targeted stability pass; preserves Step86 architecture and functionality. */
.ads86-hero{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    column-gap:32px!important;
    align-items:start!important;
}
.ads86-hero-copy{grid-column:1;min-width:0}
.ads86-submit{
    position:static!important;
    grid-column:2;
    grid-row:1;
    white-space:nowrap;
    align-self:start;
}
.ads86-search-form{grid-column:1/-1;width:100%;min-width:0}

/* Stable cards: no inherited image dimensions or empty vertical areas. */
.ads-grid.ads-kufar-cards{align-items:stretch!important}
.kf-ad-card{height:100%!important}
.kf-ad-photo,.kf-card-gallery-link,.kf-card-gallery-track{
    position:relative!important;
    display:block!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    aspect-ratio:4/3!important;
    overflow:hidden!important;
}
.kf-card-gallery-track img{
    position:absolute!important;
    inset:0!important;
    display:block!important;
    width:100%!important;
    height:100%!important;
    max-width:none!important;
    max-height:none!important;
    object-fit:cover!important;
}
.kf-ad-body{min-height:148px!important}
.kf-ad-title{
    display:-webkit-box!important;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden!important;
}

/* OLX-like detail gallery. The button is explicitly sized: fixes Chrome/Firefox white canvas bug. */
.ad-detail-page .kf-detail-gallery{
    width:100%!important;
    min-width:0!important;
    align-items:stretch!important;
}
.ad-detail-page .kf-detail-main-photo{
    position:relative!important;
    width:100%!important;
    height:clamp(430px,55vw,650px)!important;
    min-height:0!important;
    max-height:650px!important;
    aspect-ratio:auto!important;
    contain:layout paint!important;
}
.ad-detail-page .kf-detail-open-photo{
    position:absolute!important;
    inset:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    overflow:hidden!important;
    cursor:zoom-in!important;
}
.ad-detail-page .kf-detail-open-photo img,
.ad-detail-page .kf-detail-main-photo img{
    position:static!important;
    display:block!important;
    flex:0 0 auto!important;
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    max-width:100%!important;
    max-height:100%!important;
    object-fit:contain!important;
    object-position:center!important;
    background:transparent!important;
}
.ad-detail-page .kf-detail-thumbs{scrollbar-width:thin}
.ad-detail-page .kf-detail-thumb{
    flex:0 0 auto!important;
    padding:0!important;
    background:#eef1f2!important;
    cursor:pointer!important;
}
.ad-detail-page .kf-detail-thumb img{display:block!important;max-width:none!important}
.kf-detail-gallery-arrow{
    display:flex!important;
    position:absolute!important;
    z-index:9!important;
    top:50%!important;
    transform:translateY(-50%)!important;
    align-items:center!important;
    justify-content:center!important;
    width:44px!important;
    height:56px!important;
    padding:0!important;
    border:0!important;
    border-radius:8px!important;
    background:rgba(255,255,255,.92)!important;
    color:#102a2e!important;
    box-shadow:0 3px 14px rgba(0,0,0,.16)!important;
    font-size:34px!important;
    line-height:1!important;
    cursor:pointer!important;
}
.kf-detail-gallery-prev{left:12px!important}
.kf-detail-gallery-next{right:12px!important}

/* Compact horizontal related listings, including seller listings. */
.related-ads{overflow:hidden!important}
.related-ads-grid{
    display:flex!important;
    grid-template-columns:none!important;
    gap:14px!important;
    overflow-x:auto!important;
    overscroll-behavior-inline:contain;
    scroll-snap-type:x proximity;
    padding-bottom:8px!important;
}
.related-classified-card{
    flex:0 0 220px!important;
    min-width:0!important;
    scroll-snap-align:start;
}
.related-classified-card img,.related-no-image{height:145px!important}
.related-classified-card strong{
    display:-webkit-box!important;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    min-height:42px;
    overflow:hidden!important;
}

@media(max-width:899px){
    .ads86-hero{display:block!important}
    .ads86-submit{display:inline-flex!important;position:static!important;margin-top:16px!important}
    .ad-detail-page .kf-detail-gallery{display:flex!important;flex-direction:column!important}
    .ad-detail-page .kf-detail-main-photo{
        order:1!important;
        width:100%!important;
        height:min(68vh,560px)!important;
        min-height:320px!important;
        max-height:560px!important;
    }
    .ad-detail-page .kf-detail-thumbs{
        order:2!important;
        display:flex!important;
        flex-direction:row!important;
        width:100%!important;
        padding:10px 12px!important;
    }
    .kf-detail-gallery-arrow{width:40px!important;height:50px!important;font-size:30px!important}
    .related-classified-card{flex-basis:210px!important}
}
@media(max-width:520px){
    .ad-detail-page .kf-detail-main-photo{
        height:min(58vh,460px)!important;
        min-height:280px!important;
    }
    .kf-ad-body{min-height:0!important}
    .related-classified-card{flex-basis:190px!important}
    .related-classified-card img,.related-no-image{height:128px!important}
}
