/* AirlyGo D4166R2.4.12 — late-loaded responsive result-card + map rail/popup hotfix.
   Presentation-only. Loaded AFTER premium R2.4.9 so collision/reflow rules own the cascade.
   Supplier/search/PREBOOK/FX/payment/booking authority is untouched. */
:root{--ag2412-navy:#0b1f38;--ag2412-orange:#f97316;--ag2412-line:#e3e8ec;--ag2412-muted:#657386}

/* -------- Search result cards: normal-flow geometry, no overlays -------- */
#searchResults #results.results-list{container-type:inline-size;container-name:ag2412-results}
#searchResults .hotel-card{min-width:0!important}
#searchResults .hotel-card .hotel-title,#searchResults .hotel-card .hotel-title a,
#searchResults .hotel-card .hotel-location,#searchResults .hotel-card .ag415-stay-summary,
#searchResults .hotel-card .ag4153-room-block,#searchResults .hotel-card .ag4153-room-block .room-name,
#searchResults .hotel-card .ag4153-room-block .board-name,#searchResults .hotel-card .hotel-keyfacts{
  max-width:100%!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;
  -webkit-line-clamp:unset!important;-webkit-box-orient:initial!important;overflow-wrap:anywhere!important
}
#searchResults .hotel-card .ag4163-benefits{
  position:static!important;inset:auto!important;transform:none!important;display:flex!important;flex-wrap:wrap!important;
  align-items:flex-start!important;gap:6px!important;max-width:100%!important;margin:9px 0 0!important;overflow:visible!important
}
#searchResults .hotel-card .ag4163-benefit{
  position:static!important;inset:auto!important;transform:none!important;display:inline-flex!important;flex:0 1 auto!important;
  max-width:100%!important;width:auto!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;
  overflow-wrap:anywhere!important;line-height:1.25!important
}
#searchResults .hotel-card>.hotel-price-panel,#searchResults .hotel-card .price-block,#searchResults .hotel-card .availability-button{
  position:static!important;inset:auto!important;transform:none!important
}
#searchResults .hotel-card .price-total-primary,#searchResults .hotel-card .ag4164-price-value,
#searchResults .hotel-card .price-nightly-secondary{white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important}

/* Medium card: image + content, then a dedicated commercial footer. */
@media(max-width:1180px){
  #searchResults .hotel-card{
    display:grid!important;grid-template-columns:clamp(190px,31vw,260px) minmax(0,1fr)!important;
    grid-template-areas:"photo details" "price price"!important;grid-template-rows:auto auto!important;
    height:auto!important;min-height:0!important;max-height:none!important;align-items:stretch!important;overflow:hidden!important
  }
  #searchResults .hotel-card>.hotel-photo{grid-area:photo!important;width:auto!important;height:auto!important;min-height:230px!important;max-height:none!important;align-self:stretch!important}
  #searchResults .hotel-card>.hotel-photo img{width:100%!important;height:100%!important;min-height:230px!important;object-fit:cover!important}
  #searchResults .hotel-card>.hotel-content{grid-area:details!important;display:flex!important;flex-direction:column!important;width:auto!important;min-width:0!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;padding:16px!important}
  #searchResults .hotel-card>.hotel-price-panel{
    grid-area:price!important;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(220px,max-content)!important;
    grid-template-areas:"review price" "cta cta"!important;gap:10px 18px!important;align-items:center!important;
    width:auto!important;height:auto!important;min-height:0!important;padding:14px 18px 17px!important;border-left:0!important;border-top:1px solid var(--ag2412-line)!important
  }
  #searchResults .hotel-card>.hotel-price-panel .review-box{grid-area:review!important;justify-self:start!important;min-width:0!important}
  #searchResults .hotel-card>.hotel-price-panel .price-block{grid-area:price!important;justify-self:end!important;text-align:right!important;min-width:max-content!important;max-width:100%!important}
  #searchResults .hotel-card>.hotel-price-panel .availability-button{grid-area:cta!important;width:100%!important;min-height:48px!important;margin:0!important}
  #searchResults .hotel-card .price-total-primary{justify-content:flex-end!important}
}
@container ag2412-results (max-width:900px){
  .hotel-card{display:grid!important;grid-template-columns:clamp(190px,31cqw,255px) minmax(0,1fr)!important;grid-template-areas:"photo details" "price price"!important;grid-template-rows:auto auto!important;height:auto!important;max-height:none!important;overflow:hidden!important}
  .hotel-card>.hotel-photo{grid-area:photo!important;width:auto!important;height:auto!important;min-height:230px!important;max-height:none!important;align-self:stretch!important}
  .hotel-card>.hotel-photo img{width:100%!important;height:100%!important;min-height:230px!important;object-fit:cover!important}
  .hotel-card>.hotel-content{grid-area:details!important;display:flex!important;flex-direction:column!important;min-width:0!important;width:auto!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;padding:16px!important}
  .hotel-card>.hotel-price-panel{grid-area:price!important;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(220px,max-content)!important;grid-template-areas:"review price" "cta cta"!important;gap:10px 18px!important;align-items:center!important;width:auto!important;height:auto!important;min-height:0!important;padding:14px 18px 17px!important;border-left:0!important;border-top:1px solid var(--ag2412-line)!important}
  .hotel-card>.hotel-price-panel .review-box{grid-area:review!important;justify-self:start!important;min-width:0!important}
  .hotel-card>.hotel-price-panel .price-block{grid-area:price!important;justify-self:end!important;text-align:right!important;min-width:max-content!important}
  .hotel-card>.hotel-price-panel .availability-button{grid-area:cta!important;width:100%!important;min-height:48px!important;margin:0!important}
}

/* Narrow result column / phones: real reflow, not squeezed desktop columns. */
@container ag2412-results (max-width:620px){
  .hotel-card{grid-template-columns:1fr!important;grid-template-areas:"photo" "details" "price"!important;border-radius:16px!important}
  .hotel-card>.hotel-photo{min-height:0!important;height:220px!important;max-height:220px!important}
  .hotel-card>.hotel-photo img{min-height:0!important;height:220px!important;max-height:220px!important}
  .hotel-card>.hotel-content{padding:15px 16px 13px!important}
  .hotel-card>.hotel-price-panel{grid-template-columns:1fr!important;grid-template-areas:"review" "price" "cta"!important;align-items:start!important;gap:9px!important;padding:13px 16px 16px!important}
  .hotel-card>.hotel-price-panel .review-box,.hotel-card>.hotel-price-panel .price-block{justify-self:start!important;text-align:left!important;min-width:0!important;width:100%!important}
  .hotel-card .price-total-primary{justify-content:flex-start!important}
  .hotel-card .price-nightly-secondary{text-align:left!important}
}
@media(max-width:700px){
  #searchResults .hotel-card{grid-template-columns:1fr!important;grid-template-areas:"photo" "details" "price"!important}
  #searchResults .hotel-card>.hotel-photo{height:220px!important;min-height:0!important;max-height:220px!important}
  #searchResults .hotel-card>.hotel-photo img{height:220px!important;min-height:0!important;max-height:220px!important}
  #searchResults .hotel-card>.hotel-content{padding:15px 16px 13px!important}
  #searchResults .hotel-card>.hotel-price-panel{grid-template-columns:1fr!important;grid-template-areas:"review" "price" "cta"!important;align-items:start!important;gap:9px!important;padding:13px 16px 16px!important}
  #searchResults .hotel-card>.hotel-price-panel .review-box,#searchResults .hotel-card>.hotel-price-panel .price-block{justify-self:start!important;text-align:left!important;min-width:0!important;width:100%!important}
  #searchResults .hotel-card .price-total-primary{justify-content:flex-start!important}
  #searchResults .hotel-card .price-nightly-secondary{text-align:left!important}
}
@media(max-width:390px){#searchResults .hotel-card>.hotel-photo,#searchResults .hotel-card>.hotel-photo img{height:196px!important;max-height:196px!important}#searchResults .hotel-card .hotel-title{font-size:18px!important;line-height:1.2!important}}

/* -------- Map count: visible truthfulness -------- */
.ag4166-map-floating-controls{flex-wrap:wrap!important}
.ag4166-map-count{
  display:inline-flex;align-items:center;min-height:42px;padding:0 14px;border-radius:10px;background:rgba(255,255,255,.96);
  border:1px solid rgba(11,31,56,.08);box-shadow:0 5px 18px rgba(11,31,56,.14);color:var(--ag2412-navy);
  font-size:12px;font-weight:800;white-space:nowrap
}


@media(max-width:900px){
  .ag4166-map-count{min-height:38px!important;padding:0 10px!important;font-size:11px!important;flex:0 0 auto!important}
}

/* -------- Map rail: all content in normal flow; nothing overlays price/benefits -------- */
@media(min-width:901px){
  .ag4166-map-rail{width:min(610px,calc(100vw - 160px))!important}
  .ag4166-rail-toggle{left:min(638px,calc(100vw - 132px))!important}
  .ag4166-rail-toggle.is-collapsed{left:28px!important}
  .ag4166-rail-card{display:grid!important;grid-template-columns:220px minmax(0,1fr)!important;height:auto!important;min-height:252px!important;max-height:none!important;grid-template-rows:auto!important;overflow:hidden!important}
  .ag4166-rail-media{height:auto!important;min-height:252px!important;max-height:none!important;align-self:stretch!important}
  .ag4166-rail-body{display:flex!important;flex-direction:column!important;height:auto!important;min-height:252px!important;max-height:none!important;overflow:visible!important;padding:13px 14px 14px 16px!important}
  .ag4166-rail-top,.ag4166-rail-stars,.ag4166-rail-location,.ag4166-rail-rate,.ag4166-rail-perks,.ag4166-rail-price,.ag4166-rail-actions{position:static!important;inset:auto!important;transform:none!important;grid-column:auto!important;grid-row:auto!important}
  .ag4166-rail-top h3{font-size:17px!important;line-height:1.26!important;display:block!important;overflow:visible!important;white-space:normal!important;-webkit-line-clamp:unset!important;overflow-wrap:anywhere!important}
  .ag4166-rail-location,.ag4166-rail-rate{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere!important;line-height:1.35!important}
  .ag4166-rail-perks{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;align-items:flex-start!important;gap:5px!important;max-height:none!important;overflow:visible!important;margin-top:7px!important}
  .ag4166-rail-perks span{width:auto!important;max-width:100%!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere!important}
  .ag4166-rail-price{margin-top:auto!important;padding-top:10px!important;text-align:right!important;flex:0 0 auto!important}
  .ag4166-rail-actions{margin-top:8px!important;flex:0 0 auto!important}
  .ag4166-rail-actions a{width:100%!important;min-height:40px!important;box-sizing:border-box!important}
}

/* -------- Selected map popup: full room/meal copy and stable responsive width -------- */
.maplibregl-popup-content{width:min(420px,calc(100vw - 28px))!important;max-width:calc(100vw - 28px)!important;overflow:visible!important}
.ag4166-info{max-width:none!important;min-width:0!important}
.ag4166-info-head h3,.ag4166-info-rate,.ag4169-hover-rate,.ag4166-hover-preview-head strong{
  display:block!important;max-width:100%!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;
  -webkit-line-clamp:unset!important;-webkit-box-orient:initial!important;overflow-wrap:anywhere!important
}
.ag4166-info-rate{margin-top:6px!important;line-height:1.38!important}
.ag4166-info-perks{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;gap:5px!important;max-height:none!important;overflow:visible!important}
.ag4166-info-perks span{max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere!important}
.ag4166-info-price{position:static!important;margin:10px 0 4px!important;text-align:left!important}
.ag4166-info-price .ag4166-total-line{justify-content:flex-start!important}
.ag4166-hover-preview{height:auto!important;max-height:none!important}
.ag4166-hover-preview-body{overflow:visible!important}
@media(max-width:700px){
  body.ag4166-map-active .maplibregl-popup-content{width:calc(100vw - 20px)!important;max-width:calc(100vw - 20px)!important;padding:8px!important}
  .ag4166-info{display:block!important}
  .ag4166-info>.ag4166-preview-gallery{width:100%!important;height:150px!important;min-height:150px!important;border-radius:12px!important}
  .ag4166-info-body{padding:10px 4px 3px!important}
  .ag4166-info-perks{display:flex!important}
}

/* Preserve all valid-coordinate pins. Selection is a visual state only; no geographic transform hacks. */
.ag4166-price-pin[hidden]{display:flex!important}
.ag4166-price-pin,.ag4166-price-pin:hover,.ag4166-price-pin.is-hover,.ag4166-price-pin.is-active,.ag4166-price-pin.is-selected{background-clip:padding-box!important}

@media(prefers-reduced-motion:reduce){#searchResults .hotel-card,.ag4166-rail-card,.ag4166-price-pin{transition:none!important}}
