/* Qalamoun Market 3.1.8 — Explore + listing mobile hotfix
   - Explore media truly fills the available phone viewport.
   - Removes the oversized opaque information rectangle.
   - Seller is collapsed to avatar; tap toggles a compact seller popover.
   - Fixes clipped/off-screen sticky actions on listing detail.
   Scope: mobile explore + listing detail only. */

@media (max-width:700px){
  /* ---------- Explore: real full-screen media ---------- */
  body.explore-page,
  body.explore-page .explore-feed,
  body.explore-page .explore-item{
    width:100vw!important;
    max-width:100vw!important;
    height:100dvh!important;
    min-height:100dvh!important;
    margin:0!important;
    padding:0!important;
    overflow-x:hidden!important;
  }

  body.explore-page .media-strip,
  body.explore-page .media-track,
  body.explore-page .media-frame{
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
    min-height:100%!important;
    max-height:none!important;
  }

  body.explore-page .media-frame img{
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
    min-width:100%!important;
    min-height:100%!important;
    object-fit:cover!important;
    object-position:center center!important;
    transform:none!important;
  }

  /* The previous double dark overlay made the lower half look like empty black space. */
  body.explore-page .media-frame::after{
    background:linear-gradient(180deg,
      rgba(0,0,0,.22) 0%,
      rgba(0,0,0,.03) 24%,
      rgba(0,0,0,0) 54%,
      rgba(0,0,0,.08) 70%,
      rgba(2,8,5,.32) 100%)!important;
  }
  body.explore-page .explore-item::after{
    inset:58% 0 0!important;
    background:linear-gradient(180deg,transparent 0%,rgba(1,7,4,.34) 100%)!important;
  }

  /* Product information is now an overlay, not a large glass card. */
  body.explore-page .explore-info,
  body.explore-page.explore-app-v313 .explore-info{
    right:16px!important;
    left:72px!important;
    bottom:18px!important;
    max-width:none!important;
    max-height:none!important;
    overflow:visible!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
    text-shadow:0 2px 12px rgba(0,0,0,.58)!important;
  }

  body.explore-page .explore-price{
    font-size:24px!important;
    line-height:1.05!important;
    text-shadow:0 2px 13px rgba(0,0,0,.58)!important;
  }
  body.explore-page .explore-info h2{
    margin:4px 0 4px!important;
    font-size:17px!important;
    line-height:1.28!important;
    -webkit-line-clamp:2!important;
    text-shadow:0 2px 13px rgba(0,0,0,.62)!important;
  }
  body.explore-page .explore-info p{
    display:-webkit-box!important;
    margin:0 0 6px!important;
    font-size:9.5px!important;
    line-height:1.5!important;
    -webkit-line-clamp:1!important;
    color:rgba(255,255,255,.88)!important;
    text-shadow:0 1px 8px rgba(0,0,0,.58)!important;
  }
  body.explore-page .explore-location{
    width:max-content!important;
    max-width:100%!important;
    color:rgba(255,255,255,.88)!important;
    font-size:9px!important;
    text-shadow:0 1px 8px rgba(0,0,0,.62)!important;
  }

  /* Seller: avatar by default, compact details only on tap. */
  body.explore-page .explore-seller-dock{
    position:relative!important;
    width:max-content!important;
    margin-top:9px!important;
    display:flex!important;
    align-items:flex-end!important;
    gap:8px!important;
    pointer-events:auto!important;
    text-shadow:none!important;
  }
  body.explore-page .explore-seller-toggle{
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    padding:0!important;
    border:0!important;
    border-radius:50%!important;
    background:transparent!important;
    display:grid!important;
    place-items:center!important;
    box-shadow:0 8px 24px rgba(0,0,0,.20)!important;
  }
  body.explore-page .explore-seller-toggle .explore-seller-avatar{
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    border-radius:50%!important;
    border:2px solid rgba(255,255,255,.9)!important;
    box-shadow:0 0 0 2px rgba(10,18,15,.18)!important;
  }
  body.explore-page .explore-seller-popover[hidden]{display:none!important}
  body.explore-page .explore-seller-popover{
    position:absolute!important;
    right:52px!important;
    bottom:0!important;
    min-width:176px!important;
    max-width:min(58vw,230px)!important;
    min-height:44px!important;
    padding:8px 9px!important;
    border-radius:15px!important;
    display:flex!important;
    align-items:center!important;
    gap:9px!important;
    background:rgba(7,15,11,.78)!important;
    border:1px solid rgba(255,255,255,.16)!important;
    box-shadow:0 12px 34px rgba(0,0,0,.28)!important;
    backdrop-filter:blur(16px) saturate(120%)!important;
    -webkit-backdrop-filter:blur(16px) saturate(120%)!important;
    color:#fff!important;
    animation:qm318SellerIn .16s ease both!important;
    z-index:30!important;
  }
  body.explore-page .explore-seller-popover-copy{
    min-width:0!important;
    flex:1!important;
    display:block!important;
  }
  body.explore-page .explore-seller-popover b{
    display:block!important;
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:10.5px!important;
    line-height:1.25!important;
  }
  body.explore-page .explore-seller-popover b i{color:#7df0ba!important;font-style:normal!important}
  body.explore-page .explore-seller-popover small{
    display:block!important;
    margin-top:2px!important;
    color:rgba(255,255,255,.66)!important;
    font-size:8px!important;
  }
  body.explore-page .explore-seller-popover>a{
    flex:none!important;
    padding:7px 9px!important;
    border-radius:10px!important;
    background:rgba(255,255,255,.12)!important;
    color:#fff!important;
    font-size:8px!important;
    font-weight:900!important;
    white-space:nowrap!important;
  }
  @keyframes qm318SellerIn{from{opacity:0;transform:translateX(5px) scale(.97)}to{opacity:1;transform:none}}

  /* Action rail stays compact and fully inside the viewport. */
  body.explore-page .explore-actions,
  body.explore-page.explore-app-v313 .explore-actions{
    left:10px!important;
    bottom:18px!important;
    gap:7px!important;
  }
  body.explore-page .explore-action{width:44px!important}
  body.explore-page .explore-action button,
  body.explore-page .explore-action a{
    width:42px!important;
    height:42px!important;
    border-radius:14px!important;
  }
  body.explore-page .explore-action small{display:none!important}

  /* ---------- Listing detail: fix cropped sticky buttons ---------- */
  body.listing-app-v313 .listing-modern-shell{
    padding-bottom:calc(92px + env(safe-area-inset-bottom))!important;
  }
  body.listing-app-v313 .listing-sticky-cta{
    position:fixed!important;
    z-index:100!important;
    left:8px!important;
    right:8px!important;
    bottom:max(8px,env(safe-area-inset-bottom))!important;
    transform:none!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    height:64px!important;
    min-height:64px!important;
    box-sizing:border-box!important;
    margin:0!important;
    padding:7px!important;
    display:flex!important;
    align-items:stretch!important;
    gap:6px!important;
    overflow:hidden!important;
    border-radius:20px!important;
  }
  body.listing-app-v313 .listing-sticky-cta>*{
    min-width:0!important;
    max-width:none!important;
    box-sizing:border-box!important;
  }
  body.listing-app-v313 .listing-sticky-cta>a,
  body.listing-app-v313 .listing-sticky-cta>button,
  body.listing-app-v313 .listing-sticky-cta>form{
    flex:1 1 0!important;
    width:auto!important;
  }
  body.listing-app-v313 .listing-owner-state{
    margin:0!important;
    display:flex!important;
    min-width:0!important;
  }
  body.listing-app-v313 .listing-owner-state .listing-call-btn{
    width:100%!important;
    min-width:0!important;
    height:100%!important;
    flex:1 1 auto!important;
  }
  body.listing-app-v313 .listing-sticky-cta .listing-save-cta{
    flex:0 0 46px!important;
    width:46px!important;
    min-width:46px!important;
    padding:0!important;
  }
  body.listing-app-v313 .listing-sticky-cta .listing-call-btn,
  body.listing-app-v313 .listing-sticky-cta .listing-message-btn,
  body.listing-app-v313 .listing-sticky-cta .listing-offer-btn{
    min-width:0!important;
    margin:0!important;
    padding:0 7px!important;
    border-radius:15px!important;
    font-size:10.5px!important;
    line-height:1.15!important;
    white-space:nowrap!important;
  }
  body.listing-app-v313 .listing-sticky-cta .listing-offer-btn{
    flex:1 1 0!important;
  }
  body.listing-app-v313 .listing-sticky-cta svg{
    width:17px!important;
    height:17px!important;
    flex:none!important;
  }
}

@media (max-width:360px){
  body.explore-page .explore-info{right:12px!important;left:64px!important}
  body.explore-page .explore-info p{display:none!important}
  body.explore-page .explore-price{font-size:22px!important}
  body.explore-page .explore-info h2{font-size:15.5px!important}
  body.explore-page .explore-seller-popover{min-width:164px!important;max-width:62vw!important}

  body.listing-app-v313 .listing-sticky-cta{
    left:6px!important;
    right:6px!important;
    gap:4px!important;
    padding:6px!important;
  }
  body.listing-app-v313 .listing-sticky-cta .listing-call-btn,
  body.listing-app-v313 .listing-sticky-cta .listing-message-btn,
  body.listing-app-v313 .listing-sticky-cta .listing-offer-btn{
    padding-inline:5px!important;
    font-size:9.5px!important;
    gap:3px!important;
  }
  body.listing-app-v313 .listing-sticky-cta .listing-call-btn svg,
  body.listing-app-v313 .listing-sticky-cta .listing-message-btn svg{
    display:none!important;
  }
}
