/* Mobile listing controls. Native Magento/Amasty widgets retain all behavior. */
@media (max-width: 767px) {
    .page-products [data-ht-filter-code] > .filter-options-title {
        box-sizing: border-box;
        min-height: 48px;
        padding: 14px 32px 14px 0;
        position: relative;
    }

    .page-products [data-ht-filter-code] > .filter-options-title::after {
        background: none;
        border: 0;
        border-bottom: 2px solid currentColor;
        border-right: 2px solid currentColor;
        color: #171b1e;
        content: '';
        display: block;
        height: 8px;
        position: absolute;
        right: 8px;
        top: 18px;
        transform: rotate(45deg);
        width: 8px;
    }

    .page-products [data-ht-filter-code].active > .filter-options-title::after {
        top: 22px;
        transform: rotate(225deg);
    }

    /* Amasty's outer rectangle must not show behind the rounded toggle. */
    .page-products .amfinder-common-wrapper {
        background: transparent;
        border: 0 !important;
        box-shadow: none;
        padding: 0;
    }

    .page-products .filter:not(.active) .filter-title strong,
    .page-products .amfinder-common-wrapper .amfinder-title {
        align-items: center;
        border: 2px solid #ffff00;
        border-radius: 28px;
        box-sizing: border-box;
        box-shadow: 0 2px 5px rgba(0, 0, 0, .12);
        cursor: pointer;
        display: flex;
        font-size: 16px;
        font-weight: 800;
        gap: 12px;
        justify-content: center;
        letter-spacing: .03em;
        line-height: 1.35;
        margin: 0;
        min-height: 52px;
        padding: 12px 52px;
        position: relative;
        text-align: center;
        text-transform: uppercase;
        width: 100%;
        -webkit-tap-highlight-color: rgba(255, 255, 0, .18);
    }

    .page-products .filter:not(.active) .filter-title strong {
        background: #fff;
        border-color: #171b1e;
        color: #171b1e !important;
    }

    .page-products .amfinder-common-wrapper .amfinder-title {
        background: #ffff00 !important;
        color: #111 !important;
    }

    /* Visible filter icon, independent of icon-font loading. */
    .page-products .filter:not(.active) .filter-title strong::before {
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23171b1e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 6h18M3 12h18M3 18h18'/%3E%3Ccircle cx='8' cy='6' r='2' fill='white'/%3E%3Ccircle cx='16' cy='12' r='2' fill='white'/%3E%3Ccircle cx='9' cy='18' r='2' fill='white'/%3E%3C/svg%3E") center / contain no-repeat;
        content: '';
        height: 24px;
        left: 18px;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 24px;
    }

    /* Replace the tiny triangles with larger, high-contrast chevrons. */
    .page-products .filter:not(.active) .filter-title strong::after,
    .page-products .amfinder-common-wrapper .amfinder-title::before {
        background: none;
        border: 0;
        border-bottom: 2px solid currentColor;
        border-right: 2px solid currentColor;
        color: #171b1e;
        content: '';
        display: block;
        height: 10px;
        left: auto;
        margin: 0;
        position: absolute;
        right: 22px;
        top: 50%;
        transform: translateY(-70%) rotate(45deg);
        width: 10px;
    }

    .page-products .amfinder-common-wrapper .amfinder-title::after {
        content: none;
        display: none;
    }

    .page-products .amfinder-common-wrapper form.open > .amfinder-title::before {
        transform: translateY(-25%) rotate(225deg);
    }

    .page-products .filter:not(.active) .filter-title strong:hover,
    .page-products .filter:not(.active) .filter-title strong:active {
        background: #f0f1f2;
    }

    .page-products .amfinder-common-wrapper .amfinder-title:hover,
    .page-products .amfinder-common-wrapper .amfinder-title:active {
        background: #eeee00 !important;
    }

    .page-products .filter:not(.active) .filter-title strong:focus-visible,
    .page-products .amfinder-common-wrapper .amfinder-title:focus-visible {
        outline: 3px solid #171b1e;
        outline-offset: 3px;
    }

    .page-products .amfinder-common-wrapper form.open > .amfinder-toggle {
        border-radius: 16px;
        margin-top: 10px;
    }

    /* Keep only the brand visible in the drawer's 56px header strip. */
    body.page-products.filter-active .page-header {
        background: transparent !important;
        box-shadow: none !important;
        display: block !important;
        height: 56px !important;
        left: 0;
        margin: 0 !important;
        pointer-events: none;
        position: fixed !important;
        right: 56px;
        top: 0 !important;
        visibility: hidden;
        width: auto !important;
        z-index: 1002 !important;
    }

    body.page-products.filter-active .page-header .nav-toggle {
        display: none !important;
    }

    body.page-products.filter-active .page-header .logo {
        align-items: center;
        display: flex !important;
        float: none;
        height: 56px;
        justify-content: flex-start;
        left: 16px !important;
        margin: 0 !important;
        max-width: calc(100vw - 100px);
        padding: 0;
        pointer-events: none;
        position: fixed !important;
        top: 0 !important;
        transform: none !important;
        visibility: visible;
        width: 180px;
        z-index: 1002 !important;
    }

    body.page-products.filter-active .page-header .logo img {
        display: block;
        height: auto;
        margin: 0 !important;
        max-height: 32px;
        max-width: 100%;
        object-fit: contain;
        width: auto !important;
    }
}
