/* ============================================================
   Findar V46116C — Sticky tabs fix ONLY SAFE
   Base: V46116B. Scope: single property page only.
   Goal: keep Aperçu/Description/Caractéristiques/Quartier/Ensoleillement
   fixed under the price/contact bar while scrolling.
   No routing / no rewrite / no template replacement.
   ============================================================ */

:root{
  --fmp16c-admin-h:0px;
  --fmp16c-header-h:var(--fmp-global-header-h, 74px);
  --fmp16c-scroll-summary-h:76px;
  --fmp16c-tabs-h:54px;
  --fmp16c-sticky-gap:0px;
}

body.admin-bar{ --fmp16c-admin-h:var(--fmp-global-admin-top, 32px); }

body.findar-mobile-premium-single .fmp16a-sticky-pdp{
  position:sticky!important;
  top:calc(var(--fmp16c-admin-h,0px) + var(--fmp16c-header-h,var(--fmp-global-header-h,74px)))!important;
  z-index:99960!important;
  overflow:visible!important;
  background:rgba(255,255,255,.985)!important;
}

/* Keep the tabs visually attached to the V46116A price bar before the scroll-summary appears. */
body.findar-mobile-premium-single .fmp16a-sticky-tabs{
  position:relative!important;
  z-index:2!important;
  min-height:var(--fmp16c-tabs-h,54px)!important;
  background:rgba(255,255,255,.985)!important;
  -webkit-backdrop-filter:blur(14px)!important;
  backdrop-filter:blur(14px)!important;
  border-radius:0!important;
  box-shadow:none!important;
  display:flex!important;
  align-items:center!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none!important;
}
body.findar-mobile-premium-single .fmp16a-sticky-tabs::-webkit-scrollbar{display:none!important;}

/* When the existing Findar price/contact bar appears, pin the section tabs directly under it. */
body.findar-mobile-premium-single.fmp-single-scroll-ready .fmp16a-sticky-tabs{
  position:fixed!important;
  top:calc(var(--fmp16c-admin-h,0px) + var(--fmp16c-header-h,var(--fmp-global-header-h,74px)) + var(--fmp16c-scroll-summary-h,76px))!important;
  left:0!important;
  right:0!important;
  z-index:99979!important;
  min-height:var(--fmp16c-tabs-h,54px)!important;
  height:var(--fmp16c-tabs-h,54px)!important;
  padding-left:max(18px, calc((100vw - 1280px) / 2 + 24px))!important;
  padding-right:max(18px, calc((100vw - 1280px) / 2 + 24px))!important;
  border-top:1px solid rgba(226,232,240,.72)!important;
  border-bottom:1px solid rgba(226,232,240,.92)!important;
  background:rgba(255,255,255,.985)!important;
  box-shadow:0 10px 26px rgba(15,23,42,.055)!important;
}

body.findar-mobile-premium-single.fmp-single-scroll-ready .fmp16a-sticky-tabs a{
  min-height:var(--fmp16c-tabs-h,54px)!important;
}

/* Prevent the original V46116A card from visually fighting with the fixed system bar. */
body.findar-mobile-premium-single.fmp-single-scroll-ready .fmp16a-sticky-pdp{
  box-shadow:none!important;
  border-color:transparent!important;
}

body.findar-mobile-premium-single .fmp16a-sticky-tabs a{
  flex:0 0 auto!important;
  min-height:var(--fmp16c-tabs-h,54px)!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  text-decoration:none!important;
}

body.findar-mobile-premium-single .fmp16a-sticky-tabs a::after{
  bottom:0!important;
}

/* Correct anchor landing position: header + price/contact bar + tabs + breathing room. */
body.findar-mobile-premium-single #fmp-tab-apercu,
body.findar-mobile-premium-single #fmp-tab-description,
body.findar-mobile-premium-single #fmp-tab-caracteristiques,
body.findar-mobile-premium-single #fmp-tab-quartier,
body.findar-mobile-premium-single #fmp-tab-ensoleillement{
  scroll-margin-top:calc(var(--fmp16c-admin-h,0px) + var(--fmp16c-header-h,var(--fmp-global-header-h,74px)) + var(--fmp16c-scroll-summary-h,76px) + var(--fmp16c-tabs-h,54px) + 18px)!important;
}

/* Make sure content starts below the fixed tab rail when a tab is clicked and the rail is pinned. */
body.findar-mobile-premium-single.fmp-single-scroll-ready .fmp-trulia-content{
  scroll-margin-top:calc(var(--fmp16c-admin-h,0px) + var(--fmp16c-header-h,var(--fmp-global-header-h,74px)) + var(--fmp16c-scroll-summary-h,76px) + var(--fmp16c-tabs-h,54px) + 18px)!important;
}

@media (max-width:782px){
  body.admin-bar{ --fmp16c-admin-h:46px; }
}

@media (max-width:760px){
  :root{ --fmp16c-tabs-h:50px; --fmp16c-scroll-summary-h:62px; }
  body.findar-mobile-premium-single.fmp-single-scroll-ready .fmp16a-sticky-tabs{
    padding-left:12px!important;
    padding-right:12px!important;
    gap:16px!important;
  }
  body.findar-mobile-premium-single .fmp16a-sticky-tabs a{
    font-size:13px!important;
    padding-left:4px!important;
    padding-right:4px!important;
  }
  body.findar-mobile-premium-single #fmp-tab-apercu,
  body.findar-mobile-premium-single #fmp-tab-description,
  body.findar-mobile-premium-single #fmp-tab-caracteristiques,
  body.findar-mobile-premium-single #fmp-tab-quartier,
  body.findar-mobile-premium-single #fmp-tab-ensoleillement{
    scroll-margin-top:calc(var(--fmp16c-admin-h,0px) + var(--fmp16c-header-h,var(--fmp-global-header-h,64px)) + var(--fmp16c-scroll-summary-h,62px) + var(--fmp16c-tabs-h,50px) + 14px)!important;
  }
}
