/* Shared phone layout. Desktop dimensions remain controlled by the existing styles. */
@media (max-width: 767px) {
    .site-header .header-inner.header-inner--with-search {
        column-gap: 6px;
    }

    .site-header .brand-logo {
        width: 80px;
        height: auto;
    }

    .site-header :is(.header-actions, .anonymous-actions, .authenticated-actions) {
        gap: 4px;
    }

    .site-header .header-actions .button {
        min-height: 44px;
        padding: 8px 6px;
        font-size: .78rem;
    }

    .site-header .anonymous-actions .button-quiet {
        display: inline-flex;
    }

    .site-header :is(.theme-toggle, .header-icon-link) {
        width: 40px;
        height: 44px;
        min-width: 40px;
        flex-basis: 40px;
    }

    .site-header .platform-selector > summary {
        min-width: 40px;
        min-height: 44px;
        padding: 8px;
        justify-content: center;
    }

    .mobile-filter-toggle .filter-toggle-chevron {
        display: grid;
        place-items: center;
        width: 18px;
        height: 18px;
        align-self: center;
        line-height: 0;
        color: #fff;
    }

    html[data-theme="light"] .mobile-filter-toggle .filter-toggle-chevron {
        color: #071842;
    }

    .mobile-filter-toggle .filter-toggle-chevron svg {
        display: block;
        width: 18px;
        height: 18px;
    }

    /* The selector sits near the left edge; anchor its menu to the viewport. */
    .site-header .platform-menu,
    .site-header .header-notification-popover {
        position: fixed;
        top: 62px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        max-height: calc(100dvh - 170px - env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: none;
    }

    .site-header .platform-menu a {
        min-height: 44px;
    }

    .page-main :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea),
    .header-category-search input {
        font-size: 16px;
        min-width: 0;
        max-width: 100%;
    }

    .header-category-search :is(input, button),
    .market-pagination-link,
    .market-pagination-size select {
        min-height: 44px;
    }

    .market-pagination-number {
        min-width: 44px;
    }

    .home-hero-grid {
        padding-block: 28px 24px;
    }

    .home-hero-copy h1 {
        font-size: clamp(2rem, 8.8vw, 2.4rem);
        line-height: 1.12;
    }
}

@media (max-width: 640px) {
    :root {
        --site-footer-height: 92px;
    }

    .site-footer {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .site-footer .footer-inner .footer-publish {
        width: 90px;
        min-height: 28px;
        height: 28px;
        align-self: center;
        padding: 3px 4px;
        gap: 3px;
        font-size: .625rem;
        line-height: 1;
        white-space: nowrap;
    }

    .site-footer .footer-legal {
        white-space: normal;
        text-align: center;
    }
}

@media (max-width: 760px) {
    body {
        padding-bottom: 0;
    }

    .site-footer {
        position: static;
        min-height: 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .footer-inner {
        height: auto;
        min-height: 0;
    }

    .vehicle-detail-page .gallery-thumbnail-strip {
        grid-template-columns: minmax(0, 1fr);
    }

    .vehicle-detail-page .gallery-thumbnail-scroll,
    .image-lightbox-nav {
        display: none;
    }

    .vehicle-detail-page .gallery-thumbnails {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        min-width: 0;
        scrollbar-width: none;
    }

    .vehicle-detail-page .gallery-thumbnails::-webkit-scrollbar {
        display: none;
    }

    .gallery-main,
    .image-lightbox img {
        touch-action: pan-y;
    }
}
