/* ======================================================================
   APD 64.0.0 — critical UI fixes
   1) Auth modal always stays ABOVE the shared backdrop and remains tappable.
   2) Header globe/menu/search glyphs are centered consistently on every route.
   3) Desktop destination typing is always visible while suggestions are open.
   4) Expanded search action becomes a proper APD pill instead of clipped text.
   ====================================================================== */

/* ----------------------------------------------------------------------
   AUTH: APD63 accidentally lowered the auth sheet below the shared backdrop.
   The result was a greyed-out dialog where every tap hit the backdrop and
   immediately closed the login. Keep backdrop below and non-interactive while
   authentication is open; the auth modal itself already paints the dim layer.
   ---------------------------------------------------------------------- */
html.apd17-auth-open body #apd5-modal-backdrop,
body.apd17-auth-open #apd5-modal-backdrop{
    z-index:2147482000!important;
    pointer-events:none!important;
}
html body #apd5-auth-modal.apd5-auth-modal,
html body.apd17-auth-open #apd5-auth-modal.apd5-auth-modal{
    z-index:2147483000!important;
    pointer-events:auto!important;
    isolation:isolate!important;
}
html body #apd5-auth-modal .apd54-auth-dialog,
html body #apd5-auth-modal .apd5-auth-dialog{
    position:relative!important;
    z-index:20!important;
    pointer-events:auto!important;
}
html body #apd5-auth-modal .apd54-auth-dialog *,
html body #apd5-auth-modal .apd5-auth-dialog *{
    pointer-events:auto;
}
html body #apd5-auth-modal :where(input,select,textarea,button,a,label){
    touch-action:manipulation;
}

/* ----------------------------------------------------------------------
   HEADER: one exact geometry for globe + hamburger on all public pages.
   ---------------------------------------------------------------------- */
html body #apd5-header .apd5-header-actions :where(.apd41-region-trigger,.apd5-account-button.is-guest,.apd25-menu-circle){
    box-sizing:border-box!important;
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    max-height:36px!important;
    margin:0!important;
    padding:0!important;
    display:grid!important;
    place-items:center!important;
    border:0!important;
    border-radius:999px!important;
    background:#f7f7f7!important;
    color:#222!important;
    line-height:0!important;
    font-size:0!important;
    transform:none!important;
}
html body #apd5-header .apd5-header-actions :where(.apd41-region-trigger,.apd5-account-button.is-guest,.apd25-menu-circle) svg,
html body #apd5-header .apd5-header-actions :where(.apd41-region-trigger,.apd5-account-button.is-guest,.apd25-menu-circle) .apd5-icon{
    position:static!important;
    display:block!important;
    width:18px!important;
    min-width:18px!important;
    max-width:18px!important;
    height:18px!important;
    min-height:18px!important;
    max-height:18px!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    stroke-width:2!important;
    transform:none!important;
    vertical-align:middle!important;
}
html body #apd5-header .apd5-header-actions .apd25-account-cluster{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:8px!important;
}

/* ----------------------------------------------------------------------
   DESKTOP LOCATION TYPING: the active text/caret must never disappear.
   This deliberately outranks old compact/expanded precision layers.
   ---------------------------------------------------------------------- */
@media (min-width:768px){
    html body #apd5-search .apd5-search-field[data-search-field="location"].is-open{
        position:relative!important;
        overflow:visible!important;
    }
    html body #apd5-search .apd5-search-field[data-search-field="location"].is-open .apd26-inline-editor{
        position:absolute!important;
        z-index:250!important;
        top:0!important;
        right:38px!important;
        bottom:0!important;
        left:18px!important;
        width:auto!important;
        height:auto!important;
        margin:0!important;
        padding:0!important;
        display:flex!important;
        flex-direction:column!important;
        align-items:flex-start!important;
        justify-content:center!important;
        gap:2px!important;
        opacity:1!important;
        visibility:visible!important;
        background:transparent!important;
        pointer-events:auto!important;
    }
    html body #apd5-search .apd5-search-field[data-search-field="location"].is-open .apd26-inline-editor > span{
        display:block!important;
        opacity:1!important;
        visibility:visible!important;
        color:#222!important;
        font-size:11px!important;
        line-height:12px!important;
        font-weight:700!important;
        white-space:nowrap!important;
    }
    html body #apd5-search .apd5-search-field[data-search-field="location"].is-open input.apd26-search-inline-input,
    html body #apd5-search .apd5-search-field[data-search-field="location"].is-open #apd26-location-inline-input{
        position:relative!important;
        z-index:251!important;
        display:block!important;
        width:100%!important;
        min-width:0!important;
        height:20px!important;
        min-height:20px!important;
        max-height:20px!important;
        margin:0!important;
        padding:0!important;
        border:0!important;
        border-radius:0!important;
        outline:0!important;
        background:transparent!important;
        box-shadow:none!important;
        color:#222!important;
        -webkit-text-fill-color:#222!important;
        caret-color:#222!important;
        opacity:1!important;
        visibility:visible!important;
        font-size:14px!important;
        line-height:20px!important;
        font-weight:500!important;
        text-align:left!important;
        appearance:none!important;
        -webkit-appearance:none!important;
    }
    html body #apd5-search .apd5-search-field[data-search-field="location"].is-open input.apd26-search-inline-input::placeholder{
        color:#717171!important;
        -webkit-text-fill-color:#717171!important;
        opacity:1!important;
    }
    html body #apd5-search .apd5-search-field[data-search-field="location"].is-open [data-apd26-clear-location]:not([hidden]){
        z-index:260!important;
    }

    /* When a panel is open, show a real pill action with readable 'Buscar'. */
    html body #apd5-search.has-open-panel .apd5-search-submit,
    html body #apd5-header.is-compact #apd5-search.has-open-panel .apd5-search-submit,
    html body #apd5-header.is-search-expanded #apd5-search.has-open-panel .apd5-search-submit{
        width:88px!important;
        min-width:88px!important;
        max-width:88px!important;
        height:40px!important;
        min-height:40px!important;
        max-height:40px!important;
        padding:0 14px!important;
        display:flex!important;
        align-items:center!important;
        justify-content:center!important;
        gap:6px!important;
        place-self:center!important;
        border:0!important;
        border-radius:999px!important;
        background:#0d6fe8!important;
        color:#fff!important;
        line-height:1!important;
        overflow:hidden!important;
        transform:none!important;
    }
    html body #apd5-search.has-open-panel .apd5-search-submit > svg,
    html body #apd5-search.has-open-panel .apd5-search-submit > .apd5-icon{
        flex:0 0 16px!important;
        width:16px!important;
        height:16px!important;
        margin:0!important;
    }
    html body #apd5-search.has-open-panel .apd5-search-submit > span{
        display:inline-block!important;
        flex:0 0 auto!important;
        width:auto!important;
        max-width:none!important;
        margin:0!important;
        color:#fff!important;
        font-size:12px!important;
        line-height:14px!important;
        font-weight:700!important;
        white-space:nowrap!important;
        overflow:visible!important;
    }
}

/* iPhone auth stays opaque/white and usable, not greyed by a sibling layer. */
@media (max-width:767px){
    html body #apd5-auth-modal.apd5-auth-modal{
        z-index:2147483000!important;
    }
    html body #apd5-auth-modal .apd54-auth-dialog,
    html body #apd5-auth-modal .apd5-auth-dialog{
        background:#fff!important;
        opacity:1!important;
        filter:none!important;
        -webkit-filter:none!important;
    }
}
