/**
 * Findar V46170 — Mobile Finish / Responsive Repair.
 * Scope: mobile finish only. No DB/CPT/routes/canonical/contact changes.
 * Fixes observed on iPhone screenshots: wrong header thumbnail, clipped cards,
 * intrusive privacy pill, carousel overflow, oversized headings and dead space.
 */

/* Brand source is now a bundled Findar asset, not the mutable WP custom_logo setting. */
#fmp-theme-mobile-header .fmp-theme-logo picture,
#fmp-theme-mobile-header .fmp-theme-logo img{
  display:block!important;
  width:auto!important;
  height:auto!important;
}
#fmp-theme-mobile-header .fmp-theme-logo img{
  max-width:118px!important;
  max-height:38px!important;
  object-fit:contain!important;
}
.fmp-drawer-logo-img{max-width:132px!important;max-height:46px!important;object-fit:contain!important;}

@media (max-width:768px){
  html,body{max-width:100%!important;overflow-x:hidden!important;}
  main#main-content{overflow-x:clip!important;}

  /* 1. One calm, reliable mobile header everywhere. */
  body.fmp-global-fixed-header-active{--fmp-global-header-h:60px!important;padding-top:60px!important;}
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header.fmp-theme-mobile-header{
    height:60px!important;
    grid-template-columns:38px 42px minmax(0,1fr) 72px!important;
    gap:7px!important;
    padding:0 9px!important;
    border-bottom:1px solid #e6ebf2!important;
    background:rgba(255,255,255,.99)!important;
    box-shadow:0 3px 12px rgba(15,23,42,.035)!important;
  }
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header .fmp-theme-menu{
    width:36px!important;height:36px!important;min-width:36px!important;
    border-radius:10px!important;border-color:#d8e0eb!important;background:#fff!important;
    box-shadow:none!important;
  }
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header .fmp-theme-logo{
    display:grid!important;place-items:center!important;
    width:42px!important;min-width:42px!important;height:40px!important;
    overflow:hidden!important;border-radius:9px!important;background:#fff!important;
  }
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header .fmp-theme-logo picture{
    width:42px!important;height:36px!important;display:grid!important;place-items:center!important;
  }
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header .fmp-theme-logo img{
    width:42px!important;max-width:42px!important;height:32px!important;max-height:32px!important;
    object-fit:contain!important;object-position:center!important;
  }
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header .fmp-theme-search,
  body.findar-mobile-premium-single #fmp-theme-mobile-header .fmp-theme-search{
    display:flex!important;
    min-width:0!important;width:100%!important;height:38px!important;
    padding:0 9px!important;border:1px solid #d5dde8!important;border-radius:10px!important;
    background:#f8fafc!important;box-shadow:none!important;
  }
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header .fmp-theme-search > span{font-size:14px!important;color:#53627a!important;}
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header .fmp-theme-search input{
    min-width:0!important;width:100%!important;height:36px!important;
    padding:0!important;font-size:12.5px!important;font-weight:700!important;color:#172033!important;
  }
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header .fmp-theme-search input::placeholder{color:#69778e!important;opacity:1!important;}
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header .fmp-theme-publish{
    height:38px!important;min-height:38px!important;min-width:0!important;
    padding:0 9px!important;border-radius:10px!important;font-size:12px!important;font-weight:850!important;
  }
  body.findar-mobile-premium-single.fmp-global-fixed-header-active #fmp-theme-mobile-header.fmp-theme-mobile-header{
    grid-template-columns:38px 42px minmax(0,1fr) 72px!important;
  }
  /* The single page carried its own historical mobile nav; the global header is the one source of truth. */
  body.findar-mobile-premium-single .fmp-mobile-property-nav,
  body.single-propriete .fmp-mobile-property-nav{display:none!important;}

  /* 2. Privacy remains accessible but stops covering content. */
  body .findar-consent-open,
  body.single-propriete .findar-consent-open,
  body.findar-mobile-premium-single .findar-consent-open{
    display:grid!important;place-items:center!important;
    left:8px!important;right:auto!important;
    width:30px!important;min-width:30px!important;max-width:30px!important;
    height:30px!important;min-height:30px!important;max-height:30px!important;
    padding:0!important;margin:0!important;
    overflow:hidden!important;border:1px solid rgba(148,163,184,.58)!important;
    border-radius:999px!important;background:rgba(255,255,255,.88)!important;
    color:#64748b!important;font-size:0!important;line-height:1!important;
    opacity:.72!important;box-shadow:0 4px 14px rgba(15,23,42,.10)!important;
    backdrop-filter:blur(10px)!important;-webkit-backdrop-filter:blur(10px)!important;
  }
  body .findar-consent-open{bottom:10px!important;}
  body.single-propriete .findar-consent-open,
  body.findar-mobile-premium-single .findar-consent-open{bottom:calc(82px + env(safe-area-inset-bottom))!important;}
  body .findar-consent-open::before{
    content:'⚙'!important;display:block!important;font-size:14px!important;line-height:1!important;color:#64748b!important;
  }
  body .findar-consent-open:focus-visible,
  body .findar-consent-open:hover{opacity:1!important;}

  /* 3. Homepage: search first, Decision secondary, less visual noise. */
  body.findar-mobile-premium-home .fli-hero{min-height:650px!important;}
  body.findar-mobile-premium-home .fli-hero .fhd-hero__content{
    width:min(100% - 24px,720px)!important;gap:14px!important;
    padding-top:24px!important;padding-bottom:26px!important;
  }
  body.findar-mobile-premium-home .fli-hero .fhd-eyebrow{padding:7px 10px!important;font-size:10.5px!important;}
  body.findar-mobile-premium-home .fli-hero .fhd-hero__title{
    max-width:560px!important;font-size:clamp(38px,10.6vw,48px)!important;
    line-height:.98!important;letter-spacing:-.052em!important;
  }
  body.findar-mobile-premium-home .fli-hero .fhd-hero__copy>p{
    max-width:560px!important;margin-top:10px!important;font-size:14px!important;line-height:1.42!important;
  }
  body.findar-mobile-premium-home .fli-hero .fde-home-cta-row--living{
    margin-top:12px!important;justify-content:center!important;
  }
  body.findar-mobile-premium-home .fli-hero .fde-home-cta-row--living .fde-home-cta{
    flex:0 1 auto!important;min-height:42px!important;padding:0 16px!important;font-size:12.5px!important;
  }
  body.findar-mobile-premium-home .fli-hero .fde-home-cta-row--living .fde-home-cta:not(.fde-home-cta--primary){display:none!important;}
  body.findar-mobile-premium-home .fli-hero .fhd-search-card{
    width:100%!important;padding:7px!important;border-radius:17px!important;
  }
  body.findar-mobile-premium-home .fli-hero .fhd-search-tabs{gap:5px!important;padding:0 0 7px!important;}
  body.findar-mobile-premium-home .fli-hero .fhd-search-tabs :is(button,a){
    flex:1 1 0!important;min-width:0!important;min-height:38px!important;padding:0 9px!important;
    font-size:12px!important;border-radius:10px!important;
  }
  body.findar-mobile-premium-home .fli-hero .fhd-search-tabs a:last-child{display:none!important;}
  body.findar-mobile-premium-home .fli-hero .fhd-search-form{
    display:grid!important;grid-template-columns:minmax(0,1fr) 48px!important;
    gap:6px!important;padding:6px!important;border-radius:13px!important;
  }
  body.findar-mobile-premium-home .fli-hero .fhd-search-field--type,
  body.findar-mobile-premium-home .fli-hero .fhd-search-field--budget{display:none!important;}
  body.findar-mobile-premium-home .fli-hero .fhd-search-field--location{min-width:0!important;}
  body.findar-mobile-premium-home .fli-hero .fhd-search-field--location>span:first-child{display:none!important;}
  body.findar-mobile-premium-home .fli-hero .fhd-search-field__input{min-height:48px!important;}
  body.findar-mobile-premium-home .fli-hero .fhd-search-field__input input{
    min-width:0!important;font-size:13px!important;white-space:nowrap!important;text-overflow:ellipsis!important;
  }
  body.findar-mobile-premium-home .fli-hero .fhd-search-submit{
    width:48px!important;min-width:48px!important;min-height:48px!important;padding:0!important;border-radius:12px!important;
  }
  body.findar-mobile-premium-home .fli-hero .fhd-search-submit span{display:none!important;}
  body.findar-mobile-premium-home .fli-hero .fhd-map-cta-row{display:none!important;}
  body.findar-mobile-premium-home .fli-hero .fli-trust{gap:7px 12px!important;margin-top:2px!important;font-size:10.5px!important;}

  /* 4. Editorial proportions / rhythm. */
  body.findar-mobile-premium-home .fhd-section{padding-block:28px!important;}
  body.findar-mobile-premium-home .fhd-section-head{gap:14px!important;margin-bottom:20px!important;}
  body.findar-mobile-premium-home .fhd-section-head h2,
  body.findar-mobile-premium-home .fhd-intelligence h2,
  body.findar-mobile-premium-home .fhd-action-band h2{
    font-size:clamp(29px,8vw,35px)!important;line-height:1.02!important;letter-spacing:-.045em!important;
    text-wrap:balance!important;
  }
  body.findar-mobile-premium-home .fhd-section-head p{font-size:14px!important;line-height:1.45!important;}
  body.findar-mobile-premium-home .fhd-feed-footer{padding:16px 0 0!important;margin:0!important;min-height:0!important;}
  body.findar-mobile-premium-home .fhd-listings{padding-bottom:24px!important;}
  body.findar-mobile-premium-home .fhd-intelligence{padding-top:24px!important;}
  body.findar-mobile-premium-home .fhd-action-band{padding-top:24px!important;padding-bottom:30px!important;}

  /* 5. Discovery + intelligence: deliberate swipe, never accidental clipping. */
  body.findar-mobile-premium-home .fhd-discovery-grid{
    display:grid!important;grid-auto-flow:column!important;grid-template-columns:none!important;
    grid-auto-columns:min(86vw,340px)!important;gap:12px!important;
    width:calc(100vw - 24px)!important;max-width:none!important;
    margin-right:calc((100vw - 100%) / -2)!important;
    padding:0 18px 10px 0!important;
    overflow-x:auto!important;overflow-y:hidden!important;
    scroll-snap-type:x mandatory!important;scroll-padding-inline:0!important;
    scrollbar-width:none!important;-webkit-overflow-scrolling:touch!important;
  }
  body.findar-mobile-premium-home .fhd-discovery-grid::-webkit-scrollbar{display:none!important;}
  body.findar-mobile-premium-home .fhd-discovery-tile{
    width:auto!important;min-width:0!important;max-width:none!important;min-height:245px!important;
    scroll-snap-align:start!important;scroll-snap-stop:normal!important;
  }
  body.findar-mobile-premium-home .fhd-intelligence__panel{
    padding:22px 16px!important;border-radius:22px!important;overflow:hidden!important;
  }
  body.findar-mobile-premium-home .fhd-intelligence__grid{
    display:grid!important;grid-auto-flow:column!important;grid-template-columns:none!important;
    grid-auto-columns:min(86%,330px)!important;gap:12px!important;
    width:calc(100% + 16px)!important;margin-right:-16px!important;padding:0 16px 5px 0!important;
    overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x mandatory!important;
    scrollbar-width:none!important;-webkit-overflow-scrolling:touch!important;
  }
  body.findar-mobile-premium-home .fhd-intelligence__grid::-webkit-scrollbar{display:none!important;}
  body.findar-mobile-premium-home .fhd-intelligence-card{
    width:auto!important;min-width:0!important;max-width:none!important;min-height:190px!important;
    scroll-snap-align:start!important;
  }

  /* 6. Property cards: full-width media then readable content. Never 75/25 split on phone. */
  body.findar-mobile-premium-home .fhd-property-grid,
  body.findar-mobile-premium-search .fmp-results-grid{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:14px!important;overflow:visible!important;
  }
  body.findar-mobile-premium-home .fhd-property-grid .fhd-feed-item,
  body.findar-mobile-premium-search .fmp-results-grid > *{
    width:100%!important;min-width:0!important;max-width:100%!important;
  }
  body.findar-mobile-premium-home .fhd-property-grid .fmp-property-card,
  body.findar-mobile-premium-search .fmp-property-card{
    display:flex!important;flex-direction:column!important;
    width:100%!important;min-width:0!important;max-width:100%!important;height:auto!important;
    overflow:hidden!important;border-radius:20px!important;
    background:#fff!important;border:1px solid #dde5ef!important;
    box-shadow:0 8px 24px rgba(15,23,42,.055)!important;
  }
  body.findar-mobile-premium-home .fhd-property-grid .fmp-property-media,
  body.findar-mobile-premium-search .fmp-property-card .fmp-property-media{
    display:block!important;position:relative!important;
    width:100%!important;min-width:0!important;max-width:100%!important;height:auto!important;min-height:0!important;
    aspect-ratio:16/10!important;border-radius:0!important;overflow:hidden!important;
  }
  body.findar-mobile-premium-home .fhd-property-grid .fmp-property-media img,
  body.findar-mobile-premium-search .fmp-property-card .fmp-property-media img,
  body.findar-mobile-premium-home .fhd-property-grid .fmp-property-photo-link,
  body.findar-mobile-premium-search .fmp-property-card .fmp-property-photo-link{
    width:100%!important;height:100%!important;max-width:100%!important;display:block!important;
  }
  body.findar-mobile-premium-home .fhd-property-grid .fmp-property-media img,
  body.findar-mobile-premium-search .fmp-property-card .fmp-property-media img{
    object-fit:cover!important;object-position:center!important;
  }
  body.findar-mobile-premium-home .fhd-property-grid .fmp-property-body,
  body.findar-mobile-premium-search .fmp-property-card .fmp-property-body{
    display:block!important;position:relative!important;
    width:100%!important;min-width:0!important;max-width:100%!important;height:auto!important;min-height:0!important;
    padding:14px 15px 16px!important;overflow:visible!important;
  }
  body.findar-mobile-premium-home .fhd-property-grid .fmp-property-mainline,
  body.findar-mobile-premium-search .fmp-property-card .fmp-property-mainline{
    display:flex!important;align-items:flex-start!important;gap:10px!important;width:100%!important;min-width:0!important;
  }
  body.findar-mobile-premium-home .fhd-property-grid .fmp-property-price,
  body.findar-mobile-premium-search .fmp-property-card .fmp-property-price{
    display:block!important;max-width:100%!important;font-size:25px!important;line-height:1.05!important;white-space:normal!important;
  }
  body.findar-mobile-premium-home .fhd-property-grid .fmp-property-title,
  body.findar-mobile-premium-search .fmp-property-card .fmp-property-title{
    width:100%!important;max-width:100%!important;margin:9px 0 6px!important;
    font-size:18px!important;line-height:1.18!important;letter-spacing:-.025em!important;
    overflow:visible!important;white-space:normal!important;text-overflow:clip!important;
  }
  body.findar-mobile-premium-home .fhd-property-grid .fmp-property-title a,
  body.findar-mobile-premium-search .fmp-property-card .fmp-property-title a{
    display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important;
    overflow:hidden!important;white-space:normal!important;
  }
  body.findar-mobile-premium-home .fhd-property-grid .fmp-property-location,
  body.findar-mobile-premium-search .fmp-property-card .fmp-property-location{
    margin:0!important;font-size:13px!important;line-height:1.35!important;white-space:normal!important;
  }
  body.findar-mobile-premium-home .fhd-property-grid .fmp-property-facts,
  body.findar-mobile-premium-search .fmp-property-card .fmp-property-facts{
    display:flex!important;flex-wrap:wrap!important;gap:6px 10px!important;margin:9px 0 0!important;
  }
  body.findar-mobile-premium-home .fhd-property-grid .fmp-property-link,
  body.findar-mobile-premium-search .fmp-property-card .fmp-property-link{margin-top:11px!important;}

  /* 7. Single property mobile polish: readable top, no horizontal data clipping. */
  body.findar-mobile-premium-single .fmp-trulia-topline h1,
  body.single-propriete .fmp-trulia-topline h1{
    font-size:clamp(28px,8.2vw,36px)!important;line-height:1.02!important;letter-spacing:-.045em!important;
    overflow-wrap:anywhere!important;
  }
  body.findar-mobile-premium-single .fmp-trulia-price,
  body.single-propriete .fmp-trulia-price{font-size:clamp(34px,10vw,44px)!important;line-height:1!important;}
  body.findar-mobile-premium-single .fmp-pdp-chips,
  body.single-propriete .fmp-pdp-chips{grid-template-columns:1fr!important;}
  body.findar-mobile-premium-single .fmp-pdp-chip,
  body.single-propriete .fmp-pdp-chip{min-width:0!important;overflow:hidden!important;}
  body.findar-mobile-premium-single .fmp-pdp-chip strong,
  body.single-propriete .fmp-pdp-chip strong{overflow-wrap:anywhere!important;}
  body.findar-mobile-premium-single .fmp64-seller-card,
  body.single-propriete .fmp64-seller-card{border-radius:20px!important;}
  body.findar-mobile-premium-single .fmp64-seller-head h2,
  body.single-propriete .fmp64-seller-head h2{font-size:24px!important;line-height:1.06!important;}
  body.findar-mobile-premium-single .fmp16e-about-card h2,
  body.single-propriete .fmp16e-about-card h2{font-size:28px!important;line-height:1.05!important;}
  body.findar-mobile-premium-single .fmp-trulia-description,
  body.single-propriete .fmp-trulia-description{font-size:16px!important;line-height:1.55!important;}
  body.findar-mobile-premium-single #fmp-rc-contact-bar.fmp-rc-contact-bar,
  body.single-propriete #fmp-rc-contact-bar.fmp-rc-contact-bar{
    left:8px!important;right:8px!important;bottom:max(8px,env(safe-area-inset-bottom))!important;
    z-index:1100!important;
  }
  body.findar-mobile-premium-single{padding-bottom:92px!important;}
}

@media (max-width:390px){
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header.fmp-theme-mobile-header{
    grid-template-columns:36px 38px minmax(0,1fr) 68px!important;gap:6px!important;padding-inline:7px!important;
  }
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header .fmp-theme-logo,
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header .fmp-theme-logo picture{width:38px!important;min-width:38px!important;}
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header .fmp-theme-logo img{width:38px!important;max-width:38px!important;}
  body.fmp-global-fixed-header-active #fmp-theme-mobile-header .fmp-theme-publish{padding-inline:7px!important;font-size:11.5px!important;}
  body.findar-mobile-premium-home .fli-hero .fhd-hero__title{font-size:clamp(36px,10.2vw,44px)!important;}
  body.findar-mobile-premium-home .fhd-section-head h2,
  body.findar-mobile-premium-home .fhd-intelligence h2,
  body.findar-mobile-premium-home .fhd-action-band h2{font-size:30px!important;}
}
