/* Barras y búsqueda móviles compartidas por el sitio público y el CRM. */
.mobile-navigation,
.mobile-header-actions,
.public-mobile-controls {
    display: none;
}

.mobile-navigation-dialog:not([open]) {
    display: none;
}

.mobile-navigation-dialog {
    box-sizing: border-box;
    position: fixed;
    inset: 16px 0 auto;
    width: min(520px, calc(100% - 24px));
    max-height: calc(100dvh - 32px);
    padding: 24px;
    margin: 0 auto;
    overflow-y: auto;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    background: #fff;
    color: #202020;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    text-align: left;
}

.mobile-navigation-dialog::backdrop {
    background: rgb(0 0 0 / 25%);
}

.mobile-dialog-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.mobile-dialog-heading h2 {
    margin: 0;
    color: #171717;
    font-size: 24px;
    font-weight: 600;
}

.mobile-icon-button {
    box-sizing: border-box;
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #202020;
    text-decoration: none;
    cursor: pointer;
}

.mobile-icon-button svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mobile-icon-button:hover {
    background: #f5f5f5;
    color: #202020;
}

.mobile-search-label {
    display: block;
    margin-bottom: 10px;
    color: #545454;
    font-size: 14px;
}

.mobile-search-input {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #dedede;
    border-radius: 10px;
    background: #fafafa;
    color: #202020;
    font: inherit;
}

.mobile-property-search {
    inset: calc(var(--landing-header-height, 58px) + 12px) 0 auto;
    width: calc(100% - 32px);
    max-width: 480px;
    max-height: calc(100dvh - var(--landing-header-height, 58px) - 28px);
    padding: 0;
    border-color: #e5e5e5;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgb(0 0 0 / 12%);
}

.mobile-property-search::backdrop {
    background: rgb(0 0 0 / 25%);
    backdrop-filter: blur(2px);
}

.mobile-property-search-form {
    display: flex;
    align-items: center;
    padding: 4px;
    margin: 0;
}

.mobile-property-search:focus-within {
    border-color: #999;
}

.mobile-property-search .mobile-search-input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 0;
    border-radius: 12px;
    outline: none;
    background: transparent;
    box-shadow: none;
    font-size: 16px;
    line-height: 1.5;
}

.mobile-property-search .mobile-search-input::placeholder {
    color: #858580;
    opacity: 1;
}

.mobile-property-search .mobile-search-input:focus {
    outline: none;
    box-shadow: none;
}

.mobile-property-search .mobile-search-submit {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #666;
    cursor: pointer;
}

.mobile-property-search .mobile-search-submit:hover {
    background: #f5f5f5;
}

.mobile-property-search .mobile-search-submit svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mobile-menu-links,
.mobile-search-results {
    display: grid;
    padding: 0;
    margin: 0;
    list-style: none;
}

.mobile-menu-links a,
.mobile-search-result {
    display: flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border: 0;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    background: #fff;
    color: #202020;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.mobile-menu-links a::after,
.mobile-search-result::after {
    content: "›";
    color: #777;
    font-size: 22px;
}

.mobile-search-results {
    margin-top: 18px;
}

.mobile-search-empty {
    margin-top: 24px;
    color: #666;
    font-size: 14px;
}

.mobile-navigation-item:focus-visible,
.mobile-icon-button:focus-visible,
.mobile-search-input:focus-visible,
.mobile-search-submit:focus-visible,
.mobile-search-result:focus-visible,
.mobile-menu-links a:focus-visible {
    outline: 2px solid #b36a0d;
    outline-offset: 3px;
}

body.mobile-navigation-dialog-open {
    overflow: hidden;
}

@media (max-width: 899px) {
    .mobile-navigation {
        box-sizing: border-box;
        position: fixed;
        inset: auto 0 0;
        z-index: var(--mobile-navigation-z, 55);
        display: grid;
        height: calc(64px + env(safe-area-inset-bottom));
        grid-template-columns: repeat(var(--mobile-navigation-columns, 4), minmax(0, 1fr));
        padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
        border-top: 1px solid #e9e9e9;
        background: #fff;
        color: #252525;
        font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    /* Prevalece sobre los estilos generales de botones de cada página. */
    .mobile-navigation .mobile-navigation-item {
        box-sizing: border-box;
        position: relative;
        display: flex;
        min-width: 0;
        min-height: 60px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 6px 2px;
        border: 0;
        border-radius: 0;
        background: #fff;
        color: #363636;
        font: inherit;
        font-size: 11px;
        font-weight: 500;
        line-height: 1.2;
        text-decoration: none;
        cursor: pointer;
    }

    .mobile-navigation-item svg,
    .mobile-navigation-item i {
        width: 25px;
        height: 25px;
        font-size: 25px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.6;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-navigation-item:hover {
        color: #a35e08;
        text-decoration: none;
    }

    .mobile-navigation-item[aria-current="page"],
    .mobile-navigation-item[aria-expanded="true"] {
        color: #a35e08;
        font-weight: 600;
    }

    .mobile-navigation-item[aria-current="page"]::before,
    .mobile-navigation-item[aria-expanded="true"]::before {
        content: "";
        position: absolute;
        top: 0;
        width: 36px;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: #f7941f;
    }

    .mobile-header-actions,
    .main-header .public-mobile-controls {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .landing-page {
        --mobile-navigation-z: 1070;
        padding-bottom: calc(64px + env(safe-area-inset-bottom)) !important;
        scroll-padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    .landing-page .main-header {
        border-bottom-color: #e9e9e9;
    }

    .main-header .home-header-login,
    .main-header .home-header-sell-link {
        display: none;
    }

    .main-header .home-header-content > :first-child {
        display: none !important;
    }

    .main-header .landing-header-brand-column,
    .main-header .landing-header-login-column {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .main-header .landing-header-brand-column {
        justify-content: flex-start !important;
    }

    .main-header .landing-brand-logo {
        width: 150px;
        max-width: 100%;
        height: 34px;
    }

    .landing-page .home-search-shortcut {
        display: none !important;
    }

    .landing-page .whatsapp-widget {
        bottom: calc(78px + env(safe-area-inset-bottom));
    }

    .landing-page .whatsapp-widget-launcher {
        width: 48px;
        height: 48px;
    }

    .landing-page .whatsapp-widget-launcher svg {
        width: 29px;
        height: 29px;
    }

    .landing-page .whatsapp-widget-panel {
        max-height: calc(100dvh - 212px - env(safe-area-inset-bottom));
    }

    .landing-page .catalog-back-to-map {
        bottom: calc(138px + env(safe-area-inset-bottom));
    }

    body.catalog-mobile-filters-open .mobile-navigation {
        visibility: hidden;
    }
}
