/* NStay V54 - UI polish overlay (public website). Loaded last in <head>; visual fixes only. */

/* 1. no sideways page scroll (detail-page tab bar is 100vw wide = wider than the page when a scrollbar is shown) */
html,body{overflow-x:clip}
.pd-tabs-shell{max-width:100vw}

/* 2. below-the-fold sections: always laid out -> no page-height jumps, no blank areas, anchors land in the right place */
.nstay-below-fold{content-visibility:visible!important;contain-intrinsic-size:none!important}

/* 3. listing filters (desktop): the sticky panel was taller than the screen -> "Apply Filters" could not be reached */
@media (min-width:901px){
  #filtersDesktop{max-height:calc(100vh - var(--ui54-ftop,100px) - 16px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
}

/* 4. daily briefing / news: 1 or 2 stories now fill the row instead of leaving 2/3 of it blank */
@media (min-width:861px){
  .dbh-cards:has(>.dbh-card:only-child){grid-template-columns:1fr}
  .dbh-cards>.dbh-card:only-child{grid-template-columns:minmax(0,420px) minmax(0,1fr);grid-template-rows:none}
  .dbh-cards>.dbh-card:only-child img{height:100%;aspect-ratio:auto;min-height:200px}
  .dbh-cards>.dbh-card:only-child h3{font-size:21px}
  .dbh-cards>.dbh-card:only-child .dbh-cb{align-self:center;display:grid;gap:10px;padding:28px 34px}
  .dbh-cards>.dbh-card:only-child .dbh-cb::after{content:"पूरी ख़बर पढ़ें →";font:700 13px Manrope,"Noto Sans Devanagari",sans-serif;color:#b58a45;margin-top:6px}
  .dbh-cards:has(>.dbh-card:nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* 5. Ask Naresh + back-to-top button no longer sit on top of each other on phones */
@media (max-width:899px){
  html body .nsx-top.nsx-top,html body.ns-has-ask .nsx-top.nsx-top{bottom:calc(146px + env(safe-area-inset-bottom,0px))!important}
}

/* 6. Ask Naresh on desktop: small round button on property / listing pages (the long pill covered the price & contact card); opens out on hover */
@media (min-width:900px){
  body:is(:has(.pd-aside),:has(#filtersDesktop)) .ask-naresh-launcher:not(:hover):not(:focus-visible){padding:5px!important;gap:0!important}
  body:is(:has(.pd-aside),:has(#filtersDesktop)) .ask-naresh-launcher:not(:hover):not(:focus-visible)>span:not(.ask-naresh-avatar){display:none!important}
}

/* 7. property photos grid: 4 photos in one row (was 3 + 1 alone), 2 photos side by side */
@media (min-width:700px){
  .pm586-grid:has(>:nth-child(4):last-child){grid-template-columns:repeat(4,minmax(0,1fr))}
  .pm586-grid:has(>:nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* 8. property page on phones: photos first, then price, key facts, highlights, then the contact form */
@media (max-width:899px){
  .pd-layout:has(>.pd-main>#hero-gallery){display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:16px!important}
  .pd-layout:has(>.pd-main>#hero-gallery)>.pd-main,
  .pd-layout:has(>.pd-main>#hero-gallery)>.pd-aside{display:contents!important}
  .pd-layout>.pd-main>*,.pd-layout>.pd-aside>*{min-width:0;order:6}
  .pd-layout>.pd-main>#hero-gallery{order:1}
  .pd-layout>.pd-aside>.pd-summary{order:2}
  .pd-layout>.pd-main>#overview{order:3}
  .pd-layout>.pd-main>#property-highlights{order:4}
  .pd-layout>.pd-aside>.pd-contact{order:5}
}

/* 9. duplicate "Connectivity & Places Nearby" block hidden when "Places Nearby" already shows the same links */
.pd-main:has(#nearbyLinks a) #explore-locality-section .pd-nearby-title,
.pd-main:has(#nearbyLinks a) #explore-locality-section #localityNearby{display:none!important}

/* 10. home "Explore Resale" categories on phones: compact rows instead of tall empty tiles */
@media (max-width:700px){
  .hp13-category-item>button{display:grid!important;grid-template-columns:44px minmax(0,1fr);column-gap:12px;align-items:center;min-height:0!important;padding:12px 14px!important;width:100%}
  .hp13-category-item>button>.ns-ico-host,.hp13-category-item>button>span:first-of-type{align-self:center;grid-column:1;grid-row:1 / span 2;margin:0!important}
  .hp13-category-item>button>b{grid-column:2;grid-row:1;margin:0!important;align-self:end}
  .hp13-category-item>button>small{grid-column:2;grid-row:2;margin:2px 0 0!important;align-self:start}
}

/* 11. project without a photo: branded placeholder instead of a grey box */
.pl-media:has(>.pl-noimg){background:linear-gradient(135deg,#0f2a47 0%,#1d4469 60%,#2b5a85 100%)!important;display:flex;align-items:center;justify-content:center}
.pl-media>.pl-noimg{position:absolute;inset:0;justify-content:center;display:flex!important;flex-direction:column;align-items:center;gap:10px;color:#f3e6cf!important;font:700 19px/1.3 Manrope,system-ui,sans-serif!important;text-align:center;padding:0 18px;opacity:1!important;letter-spacing:.2px}
.pl-media>.pl-noimg::before{content:"";width:38px;height:38px;background:#d4ad6b;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V7l7-4 7 4v14M9 21v-6h6v6M9 10h.01M15 10h.01'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V7l7-4 7 4v14M9 21v-6h6v6M9 10h.01M15 10h.01'/%3E%3C/svg%3E") center/contain no-repeat}
.pl-media>.pl-noimg::after{content:"Photos coming soon";font:600 11px/1 Manrope,system-ui,sans-serif;letter-spacing:1.2px;text-transform:uppercase;color:rgba(243,230,207,.7)}
.pl-card{min-height:0!important}

/* 12. home stats: tiles with nothing published yet */
#hpStats strong.ui54-soon{font-size:15px!important;line-height:1.9;color:#b58a45!important}

/* 13. phones: bigger tap area for footer & breadcrumb links */
@media (max-width:700px){
  footer a,.breadcrumb a,.breadcrumbs a,nav[aria-label="breadcrumb" i] a{display:inline-block;padding-block:7px}
}
