/* ==========================================================
   BRAKE SYSTEM PAGES (/Brake, product pages, Front / Rear Model List, Measurement Diagram, Caliper Strength Test)
   Loaded only by Views/Brake/*.cshtml via ~/bundles/brake-css, after pages/product.css
   (content blocks, tables, warranty notice and RELATED PRODUCTS shared by every product category).
   ========================================================== */

/* ---- Product groups: the banner across the page, then the products ---- */
.brake-group {
    padding-bottom: 48px;
}

.brake-group__banner {
    margin-bottom: 40px;
}

/* width 100%, auto height: the banner keeps its 1920x515 proportions at every width. */
.brake-group__banner-img {
    display: block;
    width: 100%;
    height: auto;
}

/* Grid groups: four across, the last row centred (as on the old site). */
.brake-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px 32px;
}

.brake-grid > .brake-card {
    flex: 0 0 calc((100% - 96px) / 4);
}

.brake-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #111;
    text-align: center;
    text-decoration: none;
}

.brake-card__media {
    display: block;
    width: 100%;
}

.brake-card__img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.2s;
}

.brake-card__name {
    font-size: 16px;
    line-height: 1.3;
    transition: color 0.2s;
}

.brake-card:hover .brake-card__img,
.brake-card:focus-visible .brake-card__img {
    transform: scale(1.1);
}

.brake-card:hover .brake-card__name,
.brake-card:focus-visible .brake-card__name {
    color: #a18f00;
}

.brake-card:focus-visible {
    outline: 3px solid #ffed00;
    outline-offset: 3px;
}

/* List groups (accessories): a slanted name button beside the picture, two across; the picture takes the larger share. */
.brake-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 48px;
}

.brake-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 0;
    color: #111;
    text-decoration: none;
}

.brake-item__name {
    position: relative;
    isolation: isolate;
    display: flex;
    flex: 0 0 36%;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 8px 28px;
    font-size: 16px;
    line-height: 1.25;
    text-align: center;
    background-color: #111;
    clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 18px 100%, 0 50%);
    transition: color 0.2s;
}

.brake-item__name::before {
    position: absolute;
    inset: 1px 1.5px;
    z-index: -1;
    background-color: #fff;
    clip-path: polygon(17.5px 0, calc(100% - 17.5px) 0, 100% 50%, calc(100% - 17.5px) 100%, 17.5px 100%, 0 50%);
    content: "";
    transition: background-color 0.2s;
}

.brake-item__media {
    display: block;
    flex: 1 1 0;
    min-width: 0;
}

.brake-item__img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.2s;
}

.brake-item:hover .brake-item__name,
.brake-item:focus-visible .brake-item__name {
    color: #ffed00;
}

.brake-item:hover .brake-item__name::before,
.brake-item:focus-visible .brake-item__name::before {
    background-color: #111;
}

.brake-item:hover .brake-item__img,
.brake-item:focus-visible .brake-item__img {
    transform: scale(1.1);
}

.brake-item:focus-visible {
    outline: 3px solid #ffed00;
    outline-offset: 3px;
}

/* ---- Rear enlarged disc kits (the REAR ENLARGED DISC KIT page and under each brand of the rear list) ---- */
.brake-discs__caption {
    margin: 48px 0 0;
    color: #111;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.brake-discs__note {
    margin: 8px 0 0;
    color: #555;
    text-align: center;
}

/* The black bar above a brand's kit table in the rear list. */
.brake-discs__head {
    margin: 0;
    padding: 6px 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    background-color: #111;
}

.brake-discs__head small {
    font-size: 13px;
    font-weight: 400;
}

/*.product-table-wrap + .brake-discs__head {
    margin-top: 16px;
}*/

/* ---- Measurement diagram ---- */
.brake-measure__intro {
    max-width: 960px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.brake-measure__intro p {
    margin: 0 0 0.6em;
}

.brake-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 48px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.brake-step__label {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 14px;
    color: #111;
    font-family: "Sui Generis", Arial, sans-serif;
    font-size: 18px;
    background-color: #ffed00;
}

.brake-step__zoom {
    display: block;
    cursor: zoom-in;
}

.brake-step__zoom:focus-visible {
    outline: 3px solid #ffed00;
    outline-offset: 3px;
}

.brake-step__img {
    display: block;
    width: 100%;
    height: auto;
}

.brake-step__text {
    margin: 12px 0 0;
    line-height: 1.6;
}

/* ---- Caliper strength test: one certificate at a time (Bootstrap carousel) ---- */
.brake-certs {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 48px;
}

.brake-certs__zoom {
    display: block;
    width: fit-content;
    margin: 0 auto;
    cursor: zoom-in;
}

.brake-certs__img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - var(--nav-h) - 120px);
    border: 1px solid #c8c8c8;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.brake-certs .carousel-control-prev,
.brake-certs .carousel-control-next {
    width: 12%;
}

.brake-certs .carousel-control-prev-icon,
.brake-certs .carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.65);
    background-size: 45%;
}

.brake-certs .carousel-indicators {
    margin-bottom: 0;
}

.brake-certs .carousel-indicators [data-bs-target] {
    background-color: #111;
}

/* ==========================================================
   Brake pages: responsive
   ========================================================== */
@media (max-width: 991.98px) {
    .brake-grid > .brake-card {
        flex-basis: calc((100% - 64px) / 3);
    }

    .brake-list {
        gap: 8px 24px;
    }

    .brake-item__name {
        flex-basis: 40%;
        padding: 8px 22px;
        font-size: 13px;
    }
}

@media (max-width: 767.98px) {
    .brake-group__banner {
        margin-bottom: 24px;
    }

    .brake-grid {
        gap: 28px 16px;
    }

    .brake-grid > .brake-card {
        flex-basis: calc((100% - 16px) / 2);
    }

    .brake-card__name {
        font-size: 14px;
    }

    .brake-list,
    .brake-steps {
        grid-template-columns: minmax(0, 1fr);
    }

    .brake-item {
        padding: 4px 0;
    }

    .brake-item__name {
        flex-basis: 44%;
        padding: 8px 18px;
    }

    .brake-certs .carousel-control-prev,
    .brake-certs .carousel-control-next {
        width: 16%;
    }

    .brake-certs .carousel-control-prev-icon,
    .brake-certs .carousel-control-next-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brake-card__img,
    .brake-card__name,
    .brake-item__name,
    .brake-item__name::before,
    .brake-item__img {
        transition: none;
    }

    .brake-card:hover .brake-card__img,
    .brake-card:focus-visible .brake-card__img,
    .brake-item:hover .brake-item__img,
    .brake-item:focus-visible .brake-item__img {
        transform: none;
    }
}
