/* ========================================================================== 
   APD 44.0.0 · shell único para Todo, Alojamientos, Experiencias y Servicios.
   Esta capa se carga última para neutralizar medidas históricas por plantilla.
   ========================================================================== */
:root {
    --apd44-shell-max: 1376px;
    --apd44-row-height: 78px;
    --apd44-open-height: 158px;
    --apd44-search-width: 680px;
    --apd44-search-height: 52px;
    --apd44-compact-height: 72px;
    --apd44-compact-search-width: 405px;
}

@media (min-width:1180px) {
    /* The four discovery routes use one and the same header box. */
    html body.apd44-unified-shell .apd5-header.is-discovery-context,
    html body.apd44-unified-shell.home .apd5-header.is-discovery-context {
        position:sticky !important;
        top:0 !important;
        z-index:1800 !important;
        width:100% !important;
        margin:0 !important;
        border-bottom:1px solid #ebebeb !important;
        background:rgba(255,255,255,.99) !important;
        box-shadow:none !important;
        overflow:visible !important;
        backdrop-filter:saturate(180%) blur(16px) !important;
        -webkit-backdrop-filter:saturate(180%) blur(16px) !important;
    }

    html body.apd44-unified-shell .apd5-header.is-discovery-context:not(.is-compact),
    html body.apd44-unified-shell .apd5-header.is-discovery-context.is-search-expanded,
    html body.apd44-unified-shell.home .apd5-header.is-discovery-context:not(.is-compact),
    html body.apd44-unified-shell.home .apd5-header.is-discovery-context.is-search-expanded {
        height:var(--apd44-open-height) !important;
        min-height:var(--apd44-open-height) !important;
        max-height:var(--apd44-open-height) !important;
    }

    /* Shared horizontal coordinate system. */
    html body.apd44-unified-shell .apd5-header.is-discovery-context .apd5-header-row,
    html body.apd44-unified-shell .apd5-header.is-discovery-context.is-compact .apd5-header-row,
    html body.apd44-unified-shell .apd5-header.is-discovery-context.is-compact.is-search-expanded .apd5-header-row,
    html body.apd44-unified-shell.home .apd5-header.is-discovery-context .apd5-header-row {
        position:relative !important;
        width:min(calc(100vw - 96px),var(--apd44-shell-max)) !important;
        min-width:0 !important;
        max-width:var(--apd44-shell-max) !important;
        height:var(--apd44-row-height) !important;
        min-height:var(--apd44-row-height) !important;
        max-height:var(--apd44-row-height) !important;
        margin:0 auto !important;
        padding:0 !important;
        display:grid !important;
        grid-template-columns:184px minmax(610px,1fr) 260px !important;
        align-items:center !important;
        column-gap:18px !important;
        transform:none !important;
    }

    /* Logo: same file, size and coordinate on every discovery page/state. */
    html body.apd44-unified-shell .apd5-header.is-discovery-context .apd5-logo,
    html body.apd44-unified-shell .apd5-header.is-discovery-context .apd5-logo img,
    html body.apd44-unified-shell .apd5-header.is-discovery-context.is-compact .apd5-logo,
    html body.apd44-unified-shell .apd5-header.is-discovery-context.is-compact .apd5-logo img,
    html body.apd44-unified-shell.home .apd5-header.is-discovery-context .apd5-logo,
    html body.apd44-unified-shell.home .apd5-header.is-discovery-context .apd5-logo img {
        width:96px !important;
        min-width:96px !important;
        max-width:96px !important;
        height:40px !important;
        min-height:40px !important;
        max-height:40px !important;
        margin:0 !important;
        padding:0 !important;
        justify-self:start !important;
        align-self:center !important;
        object-fit:contain !important;
        object-position:left center !important;
        opacity:1 !important;
        visibility:visible !important;
        transform:none !important;
        transition:opacity .12s ease !important;
    }

    /* Shared center navigation. */
    html body.apd44-unified-shell .apd5-header.is-discovery-context .apd5-main-nav,
    html body.apd44-unified-shell.home .apd5-header.is-discovery-context .apd5-main-nav {
        width:auto !important;
        min-width:0 !important;
        height:var(--apd44-row-height) !important;
        min-height:var(--apd44-row-height) !important;
        margin:0 !important;
        padding:0 !important;
        display:flex !important;
        align-items:center !important;
        justify-content:center !important;
        gap:28px !important;
        justify-self:stretch !important;
        transform:none !important;
    }
    html body.apd44-unified-shell .apd5-header.is-discovery-context .apd5-main-nav > a,
    html body.apd44-unified-shell.home .apd5-header.is-discovery-context .apd5-main-nav > a {
        position:relative !important;
        min-width:76px !important;
        height:72px !important;
        min-height:72px !important;
        margin:0 !important;
        padding:8px 4px 7px !important;
        display:flex !important;
        flex-direction:column !important;
        align-items:center !important;
        justify-content:center !important;
        gap:4px !important;
        transform:none !important;
    }
    html body.apd44-unified-shell .apd5-main-nav > a:hover { transform:translateY(-1px) !important; }
    html body.apd44-unified-shell .apd5-main-nav > a:active { transform:scale(.97) !important; }
    html body.apd44-unified-shell .apd5-main-nav > a > span:first-child,
    html body.apd44-unified-shell .apd5-main-nav .apd15-nav-svg,
    html body.apd44-unified-shell .apd5-main-nav svg {
        width:31px !important;
        min-width:31px !important;
        max-width:31px !important;
        height:31px !important;
        min-height:31px !important;
        max-height:31px !important;
    }
    html body.apd44-unified-shell .apd5-main-nav strong {
        font-size:11px !important;
        line-height:1.15 !important;
        font-weight:600 !important;
    }

    /* Account/host controls remain anchored to the exact same grid column. */
    html body.apd44-unified-shell .apd5-header.is-discovery-context .apd5-header-actions,
    html body.apd44-unified-shell.home .apd5-header.is-discovery-context .apd5-header-actions {
        width:auto !important;
        min-width:0 !important;
        height:var(--apd44-row-height) !important;
        min-height:var(--apd44-row-height) !important;
        margin:0 !important;
        padding:0 !important;
        display:flex !important;
        align-items:center !important;
        justify-content:flex-end !important;
        justify-self:end !important;
        gap:8px !important;
        opacity:1 !important;
        visibility:visible !important;
        transform:none !important;
    }
    html body.apd44-unified-shell .apd5-host-trigger {
        min-height:40px !important;
        padding:0 13px !important;
        font-size:11px !important;
        font-weight:650 !important;
    }
    html body.apd44-unified-shell .apd41-region-trigger,
    html body.apd44-unified-shell .apd25-menu-circle,
    html body.apd44-unified-shell .apd5-account-button.is-guest {
        width:36px !important;
        min-width:36px !important;
        max-width:36px !important;
        height:36px !important;
        min-height:36px !important;
        max-height:36px !important;
    }
    html body.apd44-unified-shell .apd25-account-cluster {
        width:76px !important;
        min-width:76px !important;
        max-width:76px !important;
        height:36px !important;
        min-height:36px !important;
        max-height:36px !important;
    }
    html body.apd44-unified-shell .apd25-account-avatar {
        width:32px !important;
        min-width:32px !important;
        max-width:32px !important;
        height:32px !important;
        min-height:32px !important;
        max-height:32px !important;
    }

    /* One initial search coordinate on the four routes. */
    html body.apd44-unified-shell .apd5-header.is-discovery-context:not(.is-compact) > .apd5-header-search-row,
    html body.apd44-unified-shell .apd5-header.is-discovery-context.is-compact.is-search-expanded > .apd5-header-search-row,
    html body.apd44-unified-shell.home .apd5-header.is-discovery-context:not(.is-compact) > .apd5-header-search-row {
        position:absolute !important;
        inset:88px auto auto 50% !important;
        z-index:20 !important;
        width:var(--apd44-search-width) !important;
        min-width:var(--apd44-search-width) !important;
        max-width:var(--apd44-search-width) !important;
        height:var(--apd44-search-height) !important;
        min-height:var(--apd44-search-height) !important;
        max-height:var(--apd44-search-height) !important;
        margin:0 !important;
        padding:0 !important;
        display:flex !important;
        align-items:center !important;
        justify-content:center !important;
        overflow:visible !important;
        transform:translateX(-50%) !important;
    }
    html body.apd44-unified-shell .apd5-header.is-discovery-context:not(.is-compact) > .apd5-header-search-row .apd5-search,
    html body.apd44-unified-shell .apd5-header.is-discovery-context.is-compact.is-search-expanded > .apd5-header-search-row .apd5-search,
    html body.apd44-unified-shell.home .apd5-header.is-discovery-context:not(.is-compact) > .apd5-header-search-row .apd5-search {
        width:var(--apd44-search-width) !important;
        min-width:var(--apd44-search-width) !important;
        max-width:var(--apd44-search-width) !important;
        height:var(--apd44-search-height) !important;
        min-height:var(--apd44-search-height) !important;
        max-height:var(--apd44-search-height) !important;
        margin:0 !important;
        transform:none !important;
    }

    /* Compact scroll state: same logo and action coordinates; only nav/search morph. */
    html body.apd44-unified-shell .apd5-header.is-discovery-context.is-compact:not(.is-search-expanded) {
        position:fixed !important;
        inset:0 0 auto 0 !important;
        height:var(--apd44-compact-height) !important;
        min-height:var(--apd44-compact-height) !important;
        max-height:var(--apd44-compact-height) !important;
        box-shadow:0 2px 12px rgba(0,0,0,.08) !important;
    }
    html body.apd44-unified-shell .apd5-header.is-discovery-context.is-compact:not(.is-search-expanded) .apd5-header-row {
        height:var(--apd44-compact-height) !important;
        min-height:var(--apd44-compact-height) !important;
        max-height:var(--apd44-compact-height) !important;
    }
    html body.apd44-unified-shell .apd5-header.is-discovery-context.is-compact:not(.is-search-expanded) .apd5-main-nav {
        opacity:0 !important;
        visibility:hidden !important;
        pointer-events:none !important;
        transform:none !important;
    }
    html body.apd44-unified-shell .apd5-header.is-discovery-context.is-compact:not(.is-search-expanded) > .apd5-header-search-row {
        position:absolute !important;
        inset:0 auto auto 50% !important;
        z-index:25 !important;
        width:var(--apd44-compact-search-width) !important;
        min-width:var(--apd44-compact-search-width) !important;
        max-width:min(var(--apd44-compact-search-width),calc(100vw - 590px)) !important;
        height:var(--apd44-compact-height) !important;
        min-height:var(--apd44-compact-height) !important;
        max-height:var(--apd44-compact-height) !important;
        margin:0 !important;
        padding:16px 0 !important;
        display:flex !important;
        align-items:center !important;
        justify-content:center !important;
        transform:translateX(-50%) !important;
        pointer-events:none !important;
    }
    html body.apd44-unified-shell .apd5-header.is-discovery-context.is-compact:not(.is-search-expanded) > .apd5-header-search-row .apd5-search {
        width:100% !important;
        min-width:0 !important;
        max-width:none !important;
        height:40px !important;
        min-height:40px !important;
        max-height:40px !important;
        pointer-events:auto !important;
        transform:none !important;
    }

    /* Never animate the shell laterally while navigating between routes. */
    html body.apd44-unified-shell .apd5-header-row,
    html body.apd44-unified-shell .apd5-logo,
    html body.apd44-unified-shell .apd5-logo img,
    html body.apd44-unified-shell .apd5-header-actions {
        animation:none !important;
        translate:none !important;
    }
}

/* Keep the shell stable on medium desktop widths without overlapping controls. */
@media (min-width:1024px) and (max-width:1179px) {
    html body.apd44-unified-shell .apd5-header.is-discovery-context .apd5-header-row {
        width:calc(100vw - 48px) !important;
        margin-inline:auto !important;
        grid-template-columns:130px minmax(500px,1fr) 230px !important;
        gap:12px !important;
    }
    html body.apd44-unified-shell .apd5-header.is-discovery-context .apd5-logo,
    html body.apd44-unified-shell .apd5-header.is-discovery-context .apd5-logo img {
        width:90px !important;
        min-width:90px !important;
        max-width:90px !important;
        height:38px !important;
    }
}
