/* Mobile app-only responsive styles */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .filters {
        position: static;
        margin-bottom: 2rem;
    }

    .fab-container {
        bottom: 1rem;
        right: 1rem;
    }

    .fab {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .fab-small {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1.5rem;
    }

    .review-card-modal {
        width: min(760px, 96%);
        max-height: calc(100vh - 0.5rem);
    }

    .review-stamp-head {
        width: 78px;
        height: 104px;
    }

    .category-groups {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .map-container {
        left: env(safe-area-inset-left, 0px);
        right: env(safe-area-inset-right, 0px);
    }

    .map-search-bar.hidden-for-auth {
        display: none !important;
    }

    .auth-panel.focused {
        width: min(92vw, 340px);
        max-width: 340px;
        max-height: min(84vh, 620px);
        padding: 0.9rem;
    }

    .leaflet-popup-content-wrapper {
        border-radius: 10px;
        max-width: min(320px, calc(100vw - 1.4rem)) !important;
    }

    .leaflet-popup-content {
        margin: 0.28rem !important;
        max-width: min(308px, calc(100vw - 1.8rem)) !important;
    }

    .map-popup {
        min-width: 0;
        width: 100% !important;
        max-width: min(304px, calc(100vw - 2rem)) !important;
        gap: 0.3rem;
    }

    .map-popup-card {
        min-width: 0;
        width: 100% !important;
        max-width: min(304px, calc(100vw - 2rem)) !important;
    }

    .map-popup .map-popup-header-row {
        padding-right: 1.2rem;
    }

    .map-popup .map-report-flag-btn {
        margin-right: 0.4rem;
    }

    .map-popup h3 {
        font-size: 0.78rem;
        margin-bottom: 0.18rem;
    }

    .map-popup p {
        font-size: 0.66rem;
    }

    .map-popup .metric-scale-grid {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .map-popup .popup-metric-row {
        font-size: 0.62rem;
    }

    .results-sheet-handle-wrap {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0.1rem 0 0.25rem;
        flex: 0 0 auto;
    }

    .results-sheet-handle {
        width: 42px;
        height: 4px;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.25);
        cursor: ns-resize;
        touch-action: none;
    }

    .main-content {
        left: env(safe-area-inset-left, 0px);
        right: env(safe-area-inset-right, 0px);
        top: auto;
        bottom: 0;
        width: auto;
        max-width: none;
        height: 42vh;
        max-height: 62vh;
        padding: 0.45rem;
        gap: 0.35rem;
        border-radius: 14px 14px 0 0;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2);
        z-index: 9;
        transition: height 0.2s ease, max-height 0.2s ease, padding 0.2s ease;
    }

    .main-content.show-sidebar {
        display: flex;
    }

    .main-content.sheet-minimized {
        height: 34px;
        max-height: 34px;
        padding: 0.2rem 0.45rem;
        overflow: hidden;
    }

    .main-content.sheet-minimized .results,
    .main-content.sheet-minimized .filters {
        display: none !important;
    }

    .results {
        width: 100%;
        max-width: 100%;
        height: 100%;
        padding: 0.65rem;
        border-radius: 10px 10px 0 0;
        box-sizing: border-box;
        overflow-y: auto;
    }

    .results-content {
        width: 100%;
        margin: 0;
        padding-top: 0.35rem;
    }

    .restaurants-grid {
        width: 100%;
    }

    .results .loading.results-loading {
        width: 100%;
        margin: 0;
        min-height: 0;
        height: auto;
        padding: 0.6rem 0.3rem 0.9rem;
        align-items: center;
        justify-content: center;
    }

    .results .loading.results-loading span {
        display: block;
        font-size: 0.88rem;
        line-height: 1.2;
        white-space: normal;
        text-align: center;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        margin-bottom: 1rem;
        padding-bottom: 0.6rem;
    }

    .results-header h2 {
        font-size: 1.05rem;
    }

    .results-count {
        font-size: 0.8rem;
    }

    .results-sort-control {
        width: 100%;
    }

    .results-sort-button {
        width: auto;
        min-width: 0;
        justify-content: flex-start;
        gap: 0.22rem;
        margin-left: auto;
    }

    .sort-by-menu {
        left: 0;
        right: 0;
        min-width: 0;
        width: 100%;
    }

    .restaurants-grid {
        gap: 0.75rem;
        padding-bottom: 0.35rem;
    }

    .restaurant-name-list {
        padding-inline: 0.35rem;
        box-sizing: border-box;
    }

    .result-name-item {
        padding: 0.55rem 0.8rem;
        font-size: 0.88rem;
    }

    .restaurant-content {
        padding: 0.75rem;
    }

    .restaurant-top-row {
        flex-direction: column;
        gap: 0.55rem;
    }

    .restaurant-cuisine-tags {
        max-width: 100%;
        justify-content: flex-start;
    }

    body.center-near-results .map-center-floating-btn {
        left: 14px;
    }

    .map-search-bar {
        top: 0.75rem;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 1rem);
        max-width: calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 1rem);
        margin: 0;
        padding: 0.45rem;
        border-radius: 10px;
        box-sizing: border-box;
    }

    .map-search-bar.preload-popup,
    .map-search-bar.top-docked {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    .map-search-bar.preload-popup {
        top: 33vh;
        transform: translate(-50%, -50%) !important;
    }

    .map-search-bar.top-docked {
        top: calc(constant(safe-area-inset-top) + 1.35rem);
        top: calc(env(safe-area-inset-top, 0px) + 1.35rem);
    }

    .map-search-controls {
        display: flex;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.35rem;
        width: 100%;
    }

    .map-search-input-wrap {
        position: relative;
        width: 100%;
    }

    #mapAddressInput {
        width: 100% !important;
        max-width: none !important;
        padding: 0.28rem 0.45rem !important;
        font-size: 16px !important;
        line-height: 1.2;
        margin: 0;
    }

    .map-search-input-wrap #mapAddressSearchBtn {
        display: none !important;
    }

    .map-search-buttons {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.2rem;
        width: 100%;
    }

    .map-search-buttons > button {
        width: 100%;
        min-width: 0 !important;
        min-height: 30px;
        max-height: 30px;
        padding: 0.08rem 0.12rem !important;
        font-size: 0.74rem;
        line-height: 1;
    }

    .map-search-buttons > button .button-icon,
    #mapUseLocationBtn .map-location-btn-text .button-icon {
        width: 0.78rem;
        height: 0.78rem;
        margin-right: 0.1rem;
    }

    .map-search-buttons > button .emoji-icon,
    #mapUseLocationBtn .map-location-btn-text .emoji-icon {
        font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
        line-height: 1;
    }

    #mapUseLocationBtn {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 0 0.22rem !important;
    }

    #mapUseLocationBtn .map-location-btn-text {
        font-size: 0.68rem;
        letter-spacing: -0.01em;
        word-spacing: -0.12em;
    }

    .map-search-buttons > .auth-panel.minimized {
        position: relative !important;
        top: auto;
        right: auto;
        left: auto;
        z-index: auto;
        width: 100%;
        min-width: 0;
        max-width: none;
        height: 30px;
        min-height: 30px;
        max-height: 30px;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    .map-search-buttons > .modal-centered.minimized {
        position: relative !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        width: 100%;
        min-width: 0;
        min-height: 30px;
        max-height: 30px;
        height: 30px;
        margin: 0;
        padding: 0 0.2rem;
        border-radius: 8px;
    }

    .map-search-buttons > .modal-centered.minimized::before {
        position: absolute;
        inset: 0;
        transform: none !important;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.74rem;
        font-weight: 400;
        line-height: 1;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        text-align: center;
        font-family: inherit;
    }

    #mapUseLocationBtn,
    #mapCenterSearchBtn,
    #mapAccountBtn,
    #mapFiltersBtn {
        padding: 0.08rem 0.12rem !important;
        min-width: 0 !important;
        height: 30px;
    }

    #mapFiltersBtn {
        background: #474747;
        border: 1px solid #363636;
        color: #ffffff;
        font-weight: 600;
    }

    #mapFiltersBtn:hover {
        background: #474747;
    }

    #mapUseLocationBtn {
        gap: 0.2rem;
        background: #96652F;
        border-color: #7E5528;
    }

    #mapUseLocationBtn,
    #mapUseLocationBtn.loading,
    #mapUseLocationBtn:active,
    #mapUseLocationBtn:focus,
    #mapUseLocationBtn:disabled {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
        padding: 0.08rem 0.12rem !important;
        box-sizing: border-box !important;
        transform: none !important;
        -webkit-transform: none !important;
    }
}
