
/* ============================================
   BRAKEMARKET — SEARCH UX UPDATE
   ============================================ */

/* Product compatibility */

.bm-compatibility {
    margin: 12px 0;
    padding: 10px 12px;
    background: #f0faf5;
    border: 1px solid #d7eee1;
    border-radius: 9px;
    color: #285f45;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.bm-compatibility strong {
    color: #087747;
    font-weight: 800;
    margin-right: 4px;
}

/* Search results Back button */

.bm-back-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 12px 0 18px;
}

.bm-back-row > span {
    color: #777;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.bm-back-row > span strong {
    color: #111;
}

.bm-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #dce8e0;
    border-radius: 10px;
    background: #fff;
    color: #0a8a50;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}

.bm-back:hover {
    background: #eaf7ef;
    border-color: #0a8a50;
}

.bm-back:focus-visible {
    outline: 3px solid #0a8a50;
    outline-offset: 3px;
}

/* Improved product cards */

.product-card {
    transition:
        box-shadow .2s ease,
        border-color .2s ease;
}

.product-card:hover {
    border-color: #c9e6d5;
    box-shadow: 0 5px 22px rgba(0, 0, 0, .07);
}

.product-info h3 {
    overflow-wrap: anywhere;
}

/* Search loading feedback */

#catalogue-results[aria-busy="true"] {
    opacity: .72;
    transition: opacity .12s ease;
}

#catalogue-results[aria-busy="false"] {
    opacity: 1;
}

/* Sticky navigation */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
}

/* Desktop search improvements */

.search-form input[type="search"] {
    transition:
        border-color .15s,
        box-shadow .15s;
}

.search-form input[type="search"]:focus {
    border-color: #0a8a50;
    box-shadow: 0 0 0 3px rgba(10, 138, 80, .08);
}

/* Mobile layout */

@media (max-width: 700px) {

    .bm-search-wrap {
        position: sticky;
        top: 60px;
        z-index: 999;
        background: #f4f4f4;
    }

    .bm-back-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .bm-back {
        min-height: 42px;
        font-size: 13px;
    }

    .bm-compatibility {
        padding: 10px;
        font-size: 12px;
        line-height: 1.65;
    }

    .product-card {
        width: 100%;
    }

}

/* Extra-small phones */

@media (max-width: 400px) {

    .bm-search {
        padding: 0 12px;
    }

    .bm-search input {
        font-size: 16px !important;
    }

    .bm-compatibility {
        font-size: 11px;
    }

}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {

    .product-card,
    .bm-back,
    .search-form input[type="search"],
    #catalogue-results {
        transition: none;
    }

}
