/*
 * KingSoft / Osapa 2.2.4 migration — Phase 5
 * Navigation focus cleanup, shop price-filter spacing, AI-tab cleanup support,
 * and stable related-product cards.
 */

/*
 * Mega menu: the active item is already shown in red by the shop design.
 * Remove the large browser/Bootstrap focus rectangle that appears after a
 * mouse click on vehicle brands and part manufacturers.
 */
@media (min-width: 992px) {
    #mega_main_menu.primary a:focus,
    #mega_main_menu.primary a:active,
    #mega_main_menu.primary .item_link:focus,
    #mega_main_menu.primary .item_link:active,
    #mega_main_menu.primary .mega_dropdown a:focus,
    #mega_main_menu.primary .mega_dropdown a:active,
    .navigation-primary a:focus,
    .navigation-primary a:active {
        outline: 0 !important;
        outline-offset: 0 !important;
        box-shadow: none !important;
        text-decoration: none;
    }
}

/*
 * Shop sidebar price facet: give the CENA heading and the slider/range label
 * their own vertical breathing room.
 */
.ftc-sidebar .facetwp-facet.facetwp-type-slider {
    margin-top: 18px !important;
}

.ftc-sidebar .facetwp-facet.facetwp-type-slider .facetwp-slider {
    margin-top: 2px;
}

.ftc-sidebar .facetwp-facet.facetwp-type-slider .facetwp-slider-label {
    margin-bottom: 8px;
}

/* Stable four-column related-products layout, independent of Osapa card HTML. */
.single-product .kingsoft-related-products .kingsoft-related-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px;
    width: 100%;
    margin: 50px 0 0 !important;
    padding: 0 !important;
    list-style: none;
}

.single-product .kingsoft-related-products .kingsoft-related-card {
    float: none !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.single-product .kingsoft-related-products .kingsoft-related-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 340px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    background: #fff;
    text-decoration: none;
}

.single-product .kingsoft-related-products .kingsoft-related-image:hover {
    border-color: #ee1717;
}

.single-product .kingsoft-related-products .kingsoft-related-image img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    margin: 0 auto;
}

.single-product .kingsoft-related-products .kingsoft-related-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    margin-top: 14px;
}

.single-product .kingsoft-related-products .kingsoft-related-title {
    min-width: 0;
    color: #000;
    font-family: "Montserrat", "Open Sans", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.single-product .kingsoft-related-products .kingsoft-related-title:hover {
    color: #ea0028;
    text-decoration: none;
}

.single-product .kingsoft-related-products .kingsoft-related-price {
    min-width: 76px;
    text-align: right;
    color: #333;
    font-family: "Montserrat", "Open Sans", sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 22px;
    white-space: normal;
}

.single-product .kingsoft-related-products .kingsoft-related-price del,
.single-product .kingsoft-related-products .kingsoft-related-price ins {
    display: block;
    margin: 0;
    background: none;
}

.single-product .kingsoft-related-products .kingsoft-related-price del {
    color: #777;
    font-size: 13px;
    font-weight: 600;
}

.single-product .kingsoft-related-products .kingsoft-related-price ins {
    color: #333;
    text-decoration: none;
}

@media (max-width: 991px) {
    .single-product .kingsoft-related-products .kingsoft-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 599px) {
    .single-product .kingsoft-related-products .kingsoft-related-grid {
        grid-template-columns: 1fr;
    }

    .single-product .kingsoft-related-products .kingsoft-related-image {
        height: 300px;
    }
}
