@media (max-width: 991.98px) {
    body .mobile-search-topbar {
        position: relative;
        inset: auto;
        z-index: 2;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        flex: 0 0 60px;
        height: 60px;
        padding: 4px 8px;
        border: 1px solid var(--store-border);
        border-radius: 18px;
        background: color-mix(in srgb, var(--colorMain, #315c4b) 4%, Canvas);
        box-shadow: 0 4px 16px rgb(25 35 45 / 5%);
    }
    body .mobile-search-container .close-search {
        position: relative;
        inset: auto;
        grid-column: 1;
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid var(--store-border);
        border-radius: 12px;
        color: var(--store-ink);
        background: Canvas;
        font-size: 19px;
    }
    body .mobile-search-container .search-container {
        position: relative;
        inset: auto;
        grid-column: 2;
        width: auto;
        height: 48px;
        min-width: 0;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 12px;
        background: transparent;
        box-shadow: none;
    }
    body .mobile-search-container .search-container .search-input {
        height: 48px;
        min-height: 48px;
        padding-inline: 50px 12px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        font-size: 15px;
    }
    body .mobile-search-container .search-container .search-action { top: 4px; right: 4px; }
    body .mobile-search-container .search-results {
        position: fixed;
        top: calc(max(12px, env(safe-area-inset-top)) + 60px);
        right: 16px;
        bottom: max(20px, env(safe-area-inset-bottom));
        left: 16px;
        width: auto;
        height: auto;
        z-index: 1;
    }
}
@media (max-width: 991.98px) {
    body .mobile-search-container .search-container .search-input:focus,
    body .mobile-search-container .search-container .search-input:focus-visible {
        border: 0;
        outline: 0;
        box-shadow: none;
        background: transparent;
    }
}


/* Keep mobile search results full-height, scrollable, and visually aligned with desktop. */
@media (max-width: 991.98px) {
    body .mobile-search-container .search-results {
        position: fixed;
        top: calc(max(12px, env(safe-area-inset-top, 0px)) + 60px);
        right: 16px;
        bottom: 0;
        left: 16px;
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        width: auto;
        height: auto;
        min-height: 0;
        max-height: none;
        margin: 0;
        padding: 10px 0 max(12px, env(safe-area-inset-bottom, 0px));
        overflow-x: hidden;
        overflow-y: auto;
        border: 0;
        border-radius: 0;
        background: Canvas;
        box-shadow: none;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        -webkit-overflow-scrolling: touch;
    }

    body .mobile-search-container .search-result-items {
        display: grid;
        flex: 0 0 auto;
        align-content: start;
        gap: 10px;
        max-height: none;
        overflow: visible;
        padding: 0;
    }

    body .mobile-search-container .search-results .h-product-item {
        grid-template-columns: 112px minmax(0, 1fr);
        align-items: center;
        gap: 18px;
        min-height: 142px;
        padding: 14px 16px;
        border-radius: 16px;
    }

    body .mobile-search-container .search-results .h-product-item-thumb {
        width: 112px;
        height: 112px;
        border-radius: 10px;
    }

    body .mobile-search-container .search-results .h-product-item .title {
        margin-bottom: 8px;
        font-size: 16px;
        line-height: 1.8;
    }

    body .mobile-search-container .search-results .h-product-item .price { font-size: 15px; }
    body .mobile-search-container .search-results .h-product-item .price.dash-on { font-size: 13px; }
    body .mobile-search-container .search-results .h-product-item .price.color-green { font-size: 17px; }
    body .mobile-search-container .search-results .h-product-item .search-result-unit { margin-top: 2px; font-size: 12px; }
    body .mobile-search-container .search-results .search-result-discount { min-width: 42px; min-height: 32px; padding-inline: 10px; font-size: 13px; }

    body .mobile-search-container .search-results .search-more {
        position: static;
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        min-height: 50px;
        margin: 12px 0 0;
        padding: 10px 16px;
        border: 1px solid color-mix(in srgb, var(--colorMain, #315c4b) 24%, var(--store-border));
        border-radius: 14px;
        color: var(--colorMain, #315c4b);
        background: color-mix(in srgb, var(--colorMain, #315c4b) 6%, Canvas);
        font-size: 15px;
        font-weight: 600;
        line-height: 1.6;
        text-align: center;
        text-decoration: none;
    }
}

@media (max-width: 430px) {
    body .mobile-search-container .search-results .h-product-item {
        grid-template-columns: 84px minmax(0, 1fr);
        gap: 12px;
        min-height: 116px;
        padding: 12px;
    }

    body .mobile-search-container .search-results .h-product-item-thumb {
        width: 84px;
        height: 84px;
    }

    body .mobile-search-container .search-results .h-product-item .title { font-size: 15px; line-height: 1.7; }
    body .mobile-search-container .search-results .h-product-item .price { font-size: 14px; }
    body .mobile-search-container .search-results .h-product-item .price.color-green { font-size: 15px; }
}
