/* ============================================================
   CEMI Core v1.2.99 — Header móvil / single property
   - Inicio: header sólido, no translúcido.
   - Al hacer scroll: desaparece de inmediato en todo el sitio.
   - Si vuelve a mostrarse al subir: aparece con opacidad ligera.
   - Single property: chips del hero libres del header.
   - Galería/Fotos: sin buscador encima y con respiración visual.
   ============================================================ */
:root{--cemi-hdr-height:68px;--cemi-sticky-search-h:64px;}

#cemi-hdr.cemi-hdr--fixed,
#cemi-hdr.cemi-hdr--fixed.is-at-top,
body.cemi-home-template #cemi-hdr.cemi-hdr--fixed:not(.is-scrolled),
body.cemi-home-page #cemi-hdr.cemi-hdr--fixed:not(.is-scrolled),
#cemi-hdr.cemi-hdr--transparent{
  background:rgba(26,34,49,.98)!important;
  border-bottom:1px solid rgba(255,255,255,.10)!important;
  box-shadow:0 8px 28px rgba(0,0,0,.20)!important;
  backdrop-filter:blur(14px)!important;
  -webkit-backdrop-filter:blur(14px)!important;
}
#cemi-hdr.cemi-hdr--fixed.is-scrolled,
#cemi-hdr.cemi-hdr--fixed.is-visible-on-scroll{
  background:rgba(26,34,49,.68)!important;
  border-bottom:1px solid rgba(255,255,255,.08)!important;
  box-shadow:0 10px 34px rgba(0,0,0,.18)!important;
  backdrop-filter:blur(16px)!important;
  -webkit-backdrop-filter:blur(16px)!important;
}
#cemi-hdr.cemi-hdr--fixed.menu-open,
#cemi-hdr.cemi-hdr--fixed.search-open{
  transform:translateY(0)!important;
  background:rgba(26,34,49,.98)!important;
}
#cemi-hdr.cemi-hdr--fixed.is-hidden-on-scroll:not(.menu-open):not(.search-open){
  transform:translateY(calc(-100% - 6px))!important;
}

/* El spacer solo reserva el alto del header. El buscador sticky NO empuja el hero. */
body:not(.cemi-home-template):not(.cemi-home-page) .cemi-hdr-spacer,
body.cemi-ui-single-property .cemi-hdr-spacer,
body.single-cemi_property .cemi-hdr-spacer,
body.single-opalestate_property .cemi-hdr-spacer{
  height:var(--cemi-hdr-height,68px)!important;
  min-height:var(--cemi-hdr-height,68px)!important;
  max-height:var(--cemi-hdr-height,68px)!important;
}

/* Single property: el hero empieza con aire interno real. */
body.cemi-ui-single-property .cemi-single-hero,
body.single-cemi_property .cemi-single-hero,
body.single-opalestate_property .cemi-single-hero{
  scroll-margin-top:calc(var(--cemi-hdr-height,68px) + 12px)!important;
}
body.cemi-ui-single-property .cemi-single-hero-inner,
body.single-cemi_property .cemi-single-hero-inner,
body.single-opalestate_property .cemi-single-hero-inner{
  padding-top:clamp(96px,10vh,128px)!important;
}
body.cemi-ui-single-property .cemi-single-hero-kickers,
body.single-cemi_property .cemi-single-hero-kickers,
body.single-opalestate_property .cemi-single-hero-kickers{
  position:relative!important;
  z-index:12!important;
  margin-top:0!important;
}

/* Buscador de single: solo aparece después del hero y toma el lugar del header. */
body.cemi-ui-single-property .cemi-sticky-search,
body.single-cemi_property .cemi-sticky-search,
body.single-opalestate_property .cemi-sticky-search{
  top:0!important;
  opacity:0!important;
  pointer-events:none!important;
  transform:translateY(-105%)!important;
  transition:opacity .18s ease, transform .22s ease!important;
  z-index:10010!important;
}
body.cemi-ui-single-property.cemi-sticky-search-active:not(.cemi-gallery-in-view) .cemi-sticky-search,
body.single-cemi_property.cemi-sticky-search-active:not(.cemi-gallery-in-view) .cemi-sticky-search,
body.single-opalestate_property.cemi-sticky-search-active:not(.cemi-gallery-in-view) .cemi-sticky-search{
  opacity:1!important;
  pointer-events:auto!important;
  transform:translateY(0)!important;
}
body.cemi-ui-single-property.cemi-gallery-in-view .cemi-sticky-search,
body.single-cemi_property.cemi-gallery-in-view .cemi-sticky-search,
body.single-opalestate_property.cemi-gallery-in-view .cemi-sticky-search,
body.cemi-ui-single-property.cemi-mobile-menu-open .cemi-sticky-search,
body.single-cemi_property.cemi-mobile-menu-open .cemi-sticky-search,
body.single-opalestate_property.cemi-mobile-menu-open .cemi-sticky-search{
  opacity:0!important;
  pointer-events:none!important;
  transform:translateY(-105%)!important;
}

/* Galería: al llegar desde Fotos no queda pegada al header ni debajo del buscador. */
body.cemi-ui-single-property #cemi-galeria,
body.single-cemi_property #cemi-galeria,
body.single-opalestate_property #cemi-galeria,
body.cemi-ui-single-property .cemi-gallery,
body.single-cemi_property .cemi-gallery,
body.single-opalestate_property .cemi-gallery{
  scroll-margin-top:22px!important;
}
body.cemi-ui-single-property.cemi-gallery-in-view #cemi-hdr,
body.single-cemi_property.cemi-gallery-in-view #cemi-hdr,
body.single-opalestate_property.cemi-gallery-in-view #cemi-hdr{
  transform:translateY(calc(-100% - 6px))!important;
}

@media(max-width:768px){
  :root{--cemi-hdr-height:64px;--cemi-sticky-search-h:104px;}
  #cemi-hdr .cemi-hdr-inner{height:64px!important;min-height:64px!important;}
  #cemi-hdr .cemi-hdr-logo-img{height:30px!important;max-width:132px!important;}
  #cemi-mob-nav.cemi-mob-nav,#cemi-hdr #cemi-mob-nav{top:64px!important;}

  body:not(.cemi-home-template):not(.cemi-home-page) .cemi-hdr-spacer,
  body.cemi-ui-single-property .cemi-hdr-spacer,
  body.single-cemi_property .cemi-hdr-spacer,
  body.single-opalestate_property .cemi-hdr-spacer{
    height:64px!important;
    min-height:64px!important;
    max-height:64px!important;
  }

  body.cemi-ui-single-property .cemi-single-hero-inner,
  body.single-cemi_property .cemi-single-hero-inner,
  body.single-opalestate_property .cemi-single-hero-inner{
    padding-top:92px!important;
  }
  body.cemi-ui-single-property .cemi-single-hero-kickers,
  body.single-cemi_property .cemi-single-hero-kickers,
  body.single-opalestate_property .cemi-single-hero-kickers{
    margin-bottom:12px!important;
  }
  .cemi-sticky-search-inner{width:calc(100% - 16px)!important;padding-top:7px!important;}
  .cemi-sticky-search-form{padding:8px!important;border-radius:0 0 18px 18px!important;}
  body.cemi-ui-single-property #cemi-galeria,
  body.single-cemi_property #cemi-galeria,
  body.single-opalestate_property #cemi-galeria,
  body.cemi-ui-single-property .cemi-gallery,
  body.single-cemi_property .cemi-gallery,
  body.single-opalestate_property .cemi-gallery{
    scroll-margin-top:18px!important;
  }
}

@media(max-width:420px){
  :root{--cemi-hdr-height:62px;}
  #cemi-hdr .cemi-hdr-inner{height:62px!important;min-height:62px!important;}
  #cemi-hdr .cemi-hdr-logo-img{height:28px!important;max-width:124px!important;}
  #cemi-mob-nav.cemi-mob-nav,#cemi-hdr #cemi-mob-nav{top:62px!important;}
  body.cemi-ui-single-property .cemi-single-hero-inner,
  body.single-cemi_property .cemi-single-hero-inner,
  body.single-opalestate_property .cemi-single-hero-inner{padding-top:90px!important;}
}


/* CEMI v1.2.100 — Header aparece al subir y buscador se coloca debajo */
body.cemi-ui-single-property .cemi-sticky-search.is-under-header,
body.single-cemi_property .cemi-sticky-search.is-under-header,
body.single-opalestate_property .cemi-sticky-search.is-under-header{
  top:var(--cemi-hdr-height,68px)!important;
  transform:translateY(0)!important;
}
body.cemi-ui-single-property .cemi-sticky-search.is-top,
body.single-cemi_property .cemi-sticky-search.is-top,
body.single-opalestate_property .cemi-sticky-search.is-top{
  top:0!important;
  transform:translateY(0)!important;
}
body.cemi-ui-single-property.cemi-sticky-search-active .cemi-sticky-search,
body.single-cemi_property.cemi-sticky-search-active .cemi-sticky-search,
body.single-opalestate_property.cemi-sticky-search-active .cemi-sticky-search{
  opacity:1!important;
  pointer-events:auto!important;
}
/* Se elimina la regla anterior que escondía header/buscador al estar en galería. */
body.cemi-ui-single-property.cemi-gallery-in-view .cemi-sticky-search,
body.single-cemi_property.cemi-gallery-in-view .cemi-sticky-search,
body.single-opalestate_property.cemi-gallery-in-view .cemi-sticky-search{
  opacity:1!important;
  pointer-events:auto!important;
}
body.cemi-ui-single-property.cemi-gallery-in-view #cemi-hdr,
body.single-cemi_property.cemi-gallery-in-view #cemi-hdr,
body.single-opalestate_property.cemi-gallery-in-view #cemi-hdr{
  transform:none!important;
}
/* Al navegar hacia Fotos, dejamos margen real para header + buscador. */
body.cemi-ui-single-property #cemi-galeria,
body.single-cemi_property #cemi-galeria,
body.single-opalestate_property #cemi-galeria{
  scroll-margin-top:calc(var(--cemi-hdr-height,68px) + var(--cemi-sticky-search-h,94px) + 18px)!important;
}
/* Ya no hay botón visible de descarga; la imagen abre opciones. */
.cemi-gallery-download{display:none!important;}
.cemi-gallery-img{cursor:zoom-in;}
.cemi-photo-actions{
  position:fixed!important;left:50%!important;bottom:18px!important;transform:translate(-50%,120%)!important;
  width:min(420px,calc(100vw - 28px))!important;z-index:10040!important;
  background:#1A2231!important;color:#fff!important;border:1px solid rgba(215,38,107,.42)!important;
  border-radius:22px!important;box-shadow:0 24px 60px rgba(0,0,0,.38)!important;padding:12px!important;
  opacity:0!important;pointer-events:none!important;transition:transform .2s ease,opacity .2s ease!important;
  font-family:Montserrat,Arial,sans-serif!important;
}
.cemi-photo-actions.is-open{transform:translate(-50%,0)!important;opacity:1!important;pointer-events:auto!important;}
.cemi-photo-actions-title{font-size:12px!important;font-weight:900!important;text-transform:uppercase!important;letter-spacing:.06em!important;margin:4px 6px 10px!important;color:rgba(255,255,255,.72)!important;}
.cemi-photo-actions-row{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;}
.cemi-photo-actions button,.cemi-photo-actions a{
  display:flex!important;align-items:center!important;justify-content:center!important;min-height:44px!important;border-radius:14px!important;
  border:1px solid rgba(255,255,255,.10)!important;background:rgba(255,255,255,.08)!important;color:#fff!important;
  font-size:13px!important;font-weight:850!important;text-decoration:none!important;cursor:pointer!important;
}
.cemi-photo-actions .is-primary{background:#D7266B!important;border-color:#D7266B!important;}
@media(max-width:768px){
  body.cemi-ui-single-property #cemi-galeria,
  body.single-cemi_property #cemi-galeria,
  body.single-opalestate_property #cemi-galeria{
    scroll-margin-top:calc(var(--cemi-hdr-height,64px) + var(--cemi-sticky-search-h,104px) + 16px)!important;
  }
}
