/* Theo Properties RC1.0.15.91 — Laptop/MacBook Parent-Width Containment Lock
   Scope: public marketplace, 1181px–1799px only.
   Critical fix: size marketplace sections from the parent content box, never 100vw.
   Tablets <=1180px and large desktop >=1800px are intentionally untouched. */

@media (min-width:1181px) and (max-width:1799px){
  :root{ --tp91-gap:24px; }

  /* The .content parent already owns the laptop gutters. Child sections must
     consume that content box, not calculate their own viewport width. */
  body.theo-app #explore .marketplace-category-showcase,
  body.theo-app #explore .theo-featured-marketplace,
  body.theo-app #explore #available-properties.marketplace-results,
  body.theo-app #explore .how-theo-works.how-theo-works-v2{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-left:0!important;
    margin-right:0!important;
    box-sizing:border-box!important;
    overflow-x:hidden!important;
  }

  /* Headings and utility rows stay on the same parent-owned rail. */
  body.theo-app #explore .category-showcase-head,
  body.theo-app #explore .theo-featured-head,
  body.theo-app #explore #available-properties .marketplace-results-head,
  body.theo-app #explore #available-properties .marketplace-results-description,
  body.theo-app #explore #available-properties .alert-actions{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-left:0!important;
    margin-right:0!important;
    box-sizing:border-box!important;
  }

  /* Primary laptop composition: three generous columns. */
  body.theo-app #explore .category-showcase-grid,
  body.theo-app #explore .theo-featured-grid,
  body.theo-app #explore #available-properties .property-grid{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-auto-flow:row!important;
    gap:var(--tp91-gap)!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    box-sizing:border-box!important;
    overflow:visible!important;
    transform:none!important;
    scroll-snap-type:none!important;
  }

  body.theo-app #explore .category-showcase-grid > *,
  body.theo-app #explore .theo-featured-grid > *,
  body.theo-app #explore #available-properties .property-grid > *{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    box-sizing:border-box!important;
    flex:none!important;
    transform:none!important;
    scroll-snap-align:none!important;
  }

  /* Keep the first laptop view image-led: three cards, with View all for the fourth. */
  body.theo-app #explore .category-showcase-grid:not(.tp91-show-all) > :nth-child(n+4),
  body.theo-app #explore .theo-featured-grid:not(.tp91-show-all) > :nth-child(n+4){
    display:none!important;
  }
  body.theo-app #explore .category-showcase-grid.tp91-show-all > :nth-child(4):last-child,
  body.theo-app #explore .theo-featured-grid.tp91-show-all > :nth-child(4):last-child{
    grid-column:2!important;
  }

  /* Image geometry stays generous without forcing card width. */
  body.theo-app #explore .category-showcase-grid > .category-showcase-card,
  body.theo-app #explore .category-showcase-grid > .premium-category-card{
    aspect-ratio:1.62 / 1!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.theo-app #explore .theo-featured-grid .premium-property-card .property-photo.property-gallery,
  body.theo-app #explore .theo-featured-grid .premium-property-card .property-photo-overlay,
  body.theo-app #explore #available-properties .premium-property-card .property-photo.property-gallery,
  body.theo-app #explore #available-properties .premium-property-card .property-photo-overlay{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:auto!important;
    aspect-ratio:16 / 9!important;
  }

  /* Never let card copy establish a wider intrinsic track. */
  body.theo-app #explore .premium-property-card,
  body.theo-app #explore .premium-property-card .property-body,
  body.theo-app #explore .premium-property-card .property-body *{
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  body.theo-app #explore .premium-property-card .property-body h3,
  body.theo-app #explore .premium-property-card .address{
    overflow-wrap:normal!important;
    word-break:normal!important;
  }

  /* Laptop View-all actions remain lightweight and inside the rail. */
  body.theo-app #explore .category-showcase-head{ position:relative!important; }
  body.theo-app #explore .category-showcase-view-all,
  body.theo-app #explore .theo-featured-view-all{
    appearance:none!important;
    border:0!important;
    background:transparent!important;
    color:#a86a12!important;
    font:inherit!important;
    font-size:13px!important;
    font-weight:750!important;
    line-height:1.2!important;
    padding:8px 0!important;
    cursor:pointer!important;
    white-space:nowrap!important;
    text-decoration:none!important;
  }
  body.theo-app #explore .category-showcase-view-all{
    position:absolute!important;
    top:0!important;
    right:0!important;
  }
  body.theo-app #explore .category-carousel-controls{ display:none!important; }

  /* Journey card must obey exactly the same parent rail. */
  body.theo-app #explore .how-theo-works.how-theo-works-v2{
    padding-left:28px!important;
    padding-right:28px!important;
  }
  body.theo-app #explore .journey-stage-card,
  body.theo-app #explore .journey-stage-media,
  body.theo-app #explore .journey-stage-steps{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }

  /* No legacy rail affordance may extend beyond the parent on laptop. */
  body.theo-app #explore .category-showcase-grid::before,
  body.theo-app #explore .category-showcase-grid::after,
  body.theo-app #explore .theo-featured-grid::before,
  body.theo-app #explore .theo-featured-grid::after,
  body.theo-app #explore #available-properties .property-grid::before,
  body.theo-app #explore #available-properties .property-grid::after{
    content:none!important;
    display:none!important;
  }
}
