/* Vendeo Market v0.9.13 — listing detail balanced desktop columns
   Scope: listing detail only. Components keep their existing visual rules.
   Desktop/laptop: left stack = gallery + tabs + related; right stack = Astra summary only.
   <=1024px: restore the exact current mobile/tablet content order. */

@media (min-width:1025px){
  body.pd-listing-detail-v5-page .pd-product-v5-columns{
    display:grid!important;
    grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)!important;
    gap:36px!important;
    align-items:start!important;
  }
  body.pd-listing-detail-v5-page .pd-product-v5-column{
    min-width:0!important;
    display:flex!important;
    flex-direction:column!important;
    gap:28px!important;
    align-items:stretch!important;
  }
  body.pd-listing-detail-v5-page .pd-product-v5-column > :is(.pd-product-v5-gallery-card,.pd-product-v5-summary,.pd-product-v5-tabs,.pd-product-v5-related){
    width:100%!important;
    min-width:0!important;
    margin-top:0!important;
  }
}

@media (min-width:1025px) and (max-width:1180px){
  body.pd-listing-detail-v5-page .pd-product-v5-columns{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:24px!important;
  }
  body.pd-listing-detail-v5-page .pd-product-v5-column{gap:24px!important}
}

/* Preserve the current mobile/tablet sequence and spacing. */
@media (max-width:1024px){
  body.pd-listing-detail-v5-page .pd-product-v5-columns{
    display:flex!important;
    flex-direction:column!important;
    gap:0!important;
  }
  body.pd-listing-detail-v5-page .pd-product-v5-column{display:contents!important}
  body.pd-listing-detail-v5-page .pd-product-v5-gallery-card{order:1!important}
  body.pd-listing-detail-v5-page .pd-product-v5-lightbox,
  body.pd-listing-detail-v5-page .pd-lightbox{order:1!important}
  body.pd-listing-detail-v5-page .pd-product-v5-summary{order:2!important;margin-top:24px!important}
  body.pd-listing-detail-v5-page .pd-product-v5-tabs{order:3!important;margin-top:28px!important}
  body.pd-listing-detail-v5-page .pd-product-v5-related{order:4!important;margin-top:24px!important}
}

/* v0.9.18 — related items: use lower square frames and fill the box on desktop + mobile.
   Keep the approved v0.9.13 layout; only adjust the related-item image frame.
   The user prefers lower/squarer cards and accepts slight image stretching to remove side gaps. */
body.pd-listing-detail-v5-page .pd-product-v5-related-media{
  aspect-ratio:1 / 1 !important;
  display:block!important;
  overflow:hidden!important;
  background:#f0ebf4!important;
}
body.pd-listing-detail-v5-page .pd-product-v5-related-media img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:fill!important;
  object-position:center center!important;
  transform:none!important;
}
body.pd-listing-detail-v5-page .pd-product-v5-related-card:hover .pd-product-v5-related-media img{
  transform:none!important;
}

/* v0.9.28 — desktop-only smart presentation for badly letterboxed seller photos.
   Activated by JS only when the uploaded photo has strong dark edge bars or is extremely narrow.
   The stored original and mobile presentation remain untouched. */
@media (min-width:901px){
  body.pd-listing-detail-v5-page .pd-product-v5-main-img.is-smart-seller-media{
    position:relative!important;
    isolation:isolate!important;
    overflow:hidden!important;
    background:#f0ebf4!important;
  }
  body.pd-listing-detail-v5-page .pd-product-v5-main-img.is-smart-seller-media::before{
    content:"";
    position:absolute;
    inset:-24px;
    z-index:0;
    pointer-events:none;
    background-image:var(--pd-smart-gallery-bg,none);
    background-size:cover;
    background-position:center center;
    filter:blur(24px) saturate(.9) brightness(.94);
    transform:scale(1.08);
    opacity:.74;
  }
  body.pd-listing-detail-v5-page .pd-product-v5-main-img.is-smart-seller-media > img#pdMainImage{
    position:absolute!important;
    inset:0!important;
    z-index:1!important;
    width:100%!important;
    height:100%!important;
    max-width:100%!important;
    max-height:100%!important;
    object-fit:contain!important;
    object-position:center center!important;
    transform:none!important;
    background:transparent!important;
  }
  body.pd-listing-detail-v5-page .pd-product-v5-main-img.is-smart-seller-media:hover > img#pdMainImage{
    transform:none!important;
  }
  body.pd-listing-detail-v5-page .pd-product-v5-main-img.is-smart-seller-media .pd-product-v5-expand,
  body.pd-listing-detail-v5-page .pd-product-v5-main-img.is-smart-seller-media .pd-product-v5-count,
  body.pd-listing-detail-v5-page .pd-product-v5-main-img.is-smart-seller-media .pd-product-v5-nav{
    z-index:3!important;
  }
}
