/* CEMI Core v1.2.178 — Corrección real mobile sheets
   - Solo Buscar + Agendar
   - Elimina visualmente WhatsApp sticky anterior
   - Agenda y búsqueda como sheet/drawer, escritorio intacto */

@media (max-width:768px){
  body.cemi-has-mobile-sticky-contact{
    padding-bottom:calc(82px + env(safe-area-inset-bottom,0px))!important;
  }

  /* Cualquier barra anterior queda anulada; solo vive la 178 */
  .cemi-mobile-sticky-contact:not(.cemi-mobile-actions-178){
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  .cemi-mobile-sticky-wa,
  .cemi-mobile-sticky-contact .cemi-mobile-sticky-wa,
  .cemi-mobile-actions-178 .cemi-mobile-sticky-wa{
    display:none!important;
    width:0!important;
    min-width:0!important;
    flex:0 0 0!important;
    overflow:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
  }

  .cemi-mobile-sticky-contact.cemi-mobile-actions-178{
    position:fixed!important;
    left:12px!important;
    right:12px!important;
    bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;
    z-index:10040!important;
    display:grid!important;
    grid-template-columns:1fr 1.18fr!important;
    gap:8px!important;
    padding:8px!important;
    border-radius:22px!important;
    background:rgba(18,24,36,.95)!important;
    border:1px solid rgba(255,255,255,.10)!important;
    box-shadow:0 18px 48px rgba(0,0,0,.42), 0 -1px 0 rgba(215,38,107,.25), 0 -10px 30px rgba(215,38,107,.055)!important;
    backdrop-filter:blur(16px)!important;
    -webkit-backdrop-filter:blur(16px)!important;
  }
  .cemi-mobile-sticky-contact.cemi-mobile-actions-178 button{
    appearance:none!important;
    -webkit-appearance:none!important;
    min-width:0!important;
    width:100%!important;
    min-height:48px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:8px!important;
    border-radius:16px!important;
    text-decoration:none!important;
    font:900 13px/1 Montserrat,system-ui,sans-serif!important;
    letter-spacing:-.01em!important;
    cursor:pointer!important;
  }
  .cemi-mobile-sticky-contact.cemi-mobile-actions-178 .cemi-mobile-sticky-search{
    border:1px solid rgba(255,255,255,.12)!important;
    background:rgba(255,255,255,.065)!important;
    color:#fff!important;
    box-shadow:none!important;
  }
  .cemi-mobile-sticky-contact.cemi-mobile-actions-178 .cemi-mobile-sticky-schedule{
    border:1px solid rgba(215,38,107,.46)!important;
    background:linear-gradient(135deg,rgba(215,38,107,.96),rgba(239,75,134,.92))!important;
    color:#fff!important;
    box-shadow:0 10px 24px rgba(215,38,107,.22)!important;
  }

  body.cemi-mobile-contact-open:before,
  body.cemi-mobile-search-open:before{
    content:""!important;
    position:fixed!important;
    inset:0!important;
    z-index:10030!important;
    background:rgba(6,10,18,.58)!important;
    backdrop-filter:blur(7px)!important;
    -webkit-backdrop-filter:blur(7px)!important;
  }

  /* Ocultar el contacto largo en el flujo móvil; solo aparece al abrir Agendar */
  body:not(.cemi-mobile-contact-open) .cemi-single-contact-side-wrap,
  body:not(.cemi-mobile-contact-open) .cemi-single-property .cemi-single-contact-side-wrap,
  body:not(.cemi-mobile-contact-open) .single-cemi_property .cemi-single-contact-side-wrap,
  body:not(.cemi-mobile-contact-open) .single-opalestate_property .cemi-single-contact-side-wrap{
    height:0!important;
    max-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }

  .cemi-single-contact-side-wrap,
  .cemi-single-property .cemi-single-contact-side-wrap{
    position:fixed!important;
    inset:0!important;
    z-index:10031!important;
    display:flex!important;
    align-items:flex-end!important;
    justify-content:center!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:18px 12px calc(18px + env(safe-area-inset-bottom,0px))!important;
    pointer-events:none!important;
    opacity:0!important;
    visibility:hidden!important;
    background:transparent!important;
  }
  body.cemi-mobile-contact-open .cemi-single-contact-side-wrap,
  body.cemi-mobile-contact-open .cemi-single-property .cemi-single-contact-side-wrap{
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
    height:auto!important;
    max-height:none!important;
  }
  .cemi-single-contact-side-wrap #cemi-contacto,
  .cemi-single-property .cemi-single-contact-side-wrap #cemi-contacto{
    position:relative!important;
    width:min(100%,440px)!important;
    max-height:min(84vh,760px)!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch!important;
    margin:0!important;
    padding-top:46px!important;
    border-radius:24px 24px 20px 20px!important;
    transform:translateY(22px)!important;
    transition:transform .24s ease, opacity .24s ease!important;
  }
  body.cemi-mobile-contact-open .cemi-single-contact-side-wrap #cemi-contacto{
    transform:translateY(0)!important;
  }

  /* Buscador: normalmente no estorba en mobile; al tocar Buscar se abre como sheet */
  body:not(.cemi-mobile-search-open) #cemi-sticky-search,
  body:not(.cemi-mobile-search-open) .cemi-sticky-search{
    pointer-events:none!important;
  }
  body.cemi-mobile-search-open #cemi-sticky-search,
  body.cemi-mobile-search-open .cemi-sticky-search{
    position:fixed!important;
    inset:0!important;
    z-index:10032!important;
    display:flex!important;
    align-items:flex-end!important;
    justify-content:center!important;
    width:100%!important;
    height:auto!important;
    max-height:none!important;
    padding:18px 12px calc(18px + env(safe-area-inset-bottom,0px))!important;
    margin:0!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
    transform:none!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  body.cemi-mobile-search-open #cemi-sticky-search .cemi-sticky-search-inner,
  body.cemi-mobile-search-open .cemi-sticky-search .cemi-sticky-search-inner{
    position:relative!important;
    width:min(100%,440px)!important;
    max-height:min(80vh,680px)!important;
    overflow:auto!important;
    padding:46px 14px 14px!important;
    border-radius:24px 24px 20px 20px!important;
    background:linear-gradient(180deg,rgba(26,34,49,.98),rgba(13,20,32,.985))!important;
    border:1px solid rgba(255,255,255,.08)!important;
    box-shadow:0 -1px 0 rgba(215,38,107,.38),0 -12px 34px rgba(215,38,107,.07),0 28px 70px rgba(0,0,0,.56)!important;
  }
  body.cemi-mobile-search-open #cemi-sticky-search .cemi-sticky-search-form,
  body.cemi-mobile-search-open .cemi-sticky-search .cemi-sticky-search-form{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    padding:0!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
  }
  body.cemi-mobile-search-open #cemi-sticky-search .cemi-sticky-search-field,
  body.cemi-mobile-search-open .cemi-sticky-search .cemi-sticky-search-field{
    width:100%!important;
    min-width:0!important;
    display:block!important;
    padding:12px!important;
    border-radius:16px!important;
    background:rgba(255,255,255,.055)!important;
    border:1px solid rgba(255,255,255,.10)!important;
  }
  body.cemi-mobile-search-open #cemi-sticky-search input,
  body.cemi-mobile-search-open #cemi-sticky-search select,
  body.cemi-mobile-search-open .cemi-sticky-search input,
  body.cemi-mobile-search-open .cemi-sticky-search select{
    width:100%!important;
    color:#fff!important;
    background:transparent!important;
  }
  body.cemi-mobile-search-open #cemi-sticky-search select option,
  body.cemi-mobile-search-open .cemi-sticky-search select option{color:#111!important;}
  body.cemi-mobile-search-open #cemi-sticky-search .cemi-sticky-search-actions,
  body.cemi-mobile-search-open .cemi-sticky-search .cemi-sticky-search-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
    width:100%!important;
  }

  .cemi-mobile-sheet-close,
  .cemi-mobile-contact-close,
  .cemi-mobile-search-close{
    position:absolute!important;
    right:12px!important;
    top:10px!important;
    z-index:5!important;
    width:34px!important;
    height:34px!important;
    border-radius:999px!important;
    border:1px solid rgba(255,255,255,.12)!important;
    background:rgba(255,255,255,.07)!important;
    color:#fff!important;
    font-size:22px!important;
    line-height:1!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    cursor:pointer!important;
  }
}

@media (min-width:769px){
  .cemi-mobile-sticky-contact,
  .cemi-mobile-sheet-close,
  .cemi-mobile-contact-close,
  .cemi-mobile-search-close{display:none!important;}
}
