body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 a[href*="/product-categorie/carplay-box/"],
body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 a[href*="/product-categorie/carplay-box/"],
body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 button[class*="brand"],
body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 button[class*="brand"],
body.tax-product_cat.term-carplay-box .btpc-brand-card {
    border-color: #343740 !important;
}

body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 .is-selected,
body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 .is-selected,
body.tax-product_cat.term-carplay-box .btpc-brand-card.is-selected {
    border-color: #f51b2b !important;
}

body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1,
body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
    margin-top: 34px !important;
}

/* A routed catalog or product detail is a separate screen. The legacy
 * brand-grid rule above intentionally uses !important, so route state must
 * override it explicitly instead of relying on the HTML hidden attribute. */
body.tax-product_cat.term-carplay-box.btpc-is-open #bt-mini-brand-step-v1,
body.tax-product_cat.term-carplay-box.btpc-is-open #bt-bmw-brand-step-v1,
body.tax-product_cat.term-carplay-box.btpc-is-open .bt-mini-catalog-head,
body.tax-product_cat.term-carplay-box.btpc-is-open .bt-bmw-catalog-head,
body.tax-product_cat.term-carplay-box.btpc-is-open .btpc-brands-more {
    display: none !important;
}

body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 > [class*="brand-card"],
body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 > [class*="brand-card"] {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 170px !important;
    margin: 0 !important;
    padding: 20px 14px !important;
    border-width: 1px !important;
    border-color: #343740 !important;
    border-radius: 16px !important;
    text-align: center !important;
    overflow: hidden !important;
}

body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 > [class*="brand-card"].is-selected,
body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 > [class*="brand-card"].is-selected {
    border-color: #f51b2b !important;
}

body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 > [class*="brand-card"] img,
body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 > [class*="brand-card"] svg,
body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 > [class*="brand-card"] img,
body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 > [class*="brand-card"] svg {
    display: block !important;
    flex: 0 0 auto !important;
    width: 84px !important;
    max-width: 84px !important;
    height: 58px !important;
    object-fit: contain !important;
}

body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 > [class*="brand-card"] > span,
body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 > [class*="brand-card"] > span {
    display: grid !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
    text-align: center !important;
}

body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 > [class*="brand-card"] strong,
body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 > [class*="brand-card"] strong {
    max-width: 100% !important;
    font-size: 20px !important;
    line-height: 1.18 !important;
    overflow-wrap: anywhere !important;
}

.btpc-brands-more {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    width: fit-content;
    margin: 22px auto 0;
    padding: 11px 20px;
    border: 1px solid #f51b2b;
    border-radius: 10px;
    background: #f51b2b;
    color: #fff;
    font: 700 14px/1.2 inherit;
    cursor: pointer;
}

.btpc-brands-more:hover,
.btpc-brands-more:focus-visible { background: #bd1018; color: #fff; }
.btpc-brands-more[hidden],
#bt-mini-brand-step-v1 > [hidden],
#bt-bmw-brand-step-v1 > [hidden] { display: none !important; }

@media (max-width: 900px) {
    body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1,
    body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 640px) {
    body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1,
    body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 11px !important; }
    body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 > [class*="brand-card"],
    body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 > [class*="brand-card"] { min-height: 142px !important; padding: 15px 9px !important; }
    body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 > [class*="brand-card"] img,
    body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 > [class*="brand-card"] svg,
    body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 > [class*="brand-card"] img,
    body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 > [class*="brand-card"] svg { width: 68px !important; max-width: 68px !important; height: 48px !important; }
    body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 > [class*="brand-card"] strong,
    body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 > [class*="brand-card"] strong { font-size: 17px !important; }
}

.btpc-menu-check {
    margin: 18px 0 22px;
}

.btpc-menu-check-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    border: 1px solid #343740;
    border-radius: 12px;
    background: #15161b;
    color: #fff;
    cursor: pointer;
}

.btpc-menu-check-card:has(input:checked) {
    border-color: #f51b2b;
    background: #2a1115;
}

.btpc-menu-check-card input {
    width: 22px;
    height: 22px;
    margin: 2px 0 0;
    accent-color: #f51b2b;
    flex: 0 0 auto;
}

.btpc-menu-check-card > span,
.btpc-menu-check-card strong,
.btpc-menu-check-card small {
    display: block;
}

.btpc-menu-check-card strong {
    font-size: 16px;
    line-height: 1.45;
}

.btpc-menu-check-card small {
    margin-top: 7px;
    color: #b6b8c0;
    font-size: 13px;
    line-height: 1.45;
}

.btpc-menu-term {
    position: relative;
    display: inline-block;
    text-decoration: underline;
    text-decoration-color: #f51b2b;
    text-underline-offset: 3px;
    cursor: help;
}

.btpc-menu-popover {
    position: absolute;
    z-index: 10020;
    left: 50%;
    bottom: calc(100% + 12px);
    width: min(560px, calc(100vw - 48px));
    padding: 7px;
    border: 1px solid #f51b2b;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .48);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}

@media (min-width: 641px) {
    .btpc-menu-popover {
        left: auto;
        right: 0;
        transform: translate(0, 8px);
    }

    .btpc-menu-term:hover .btpc-menu-popover,
    .btpc-menu-term:focus .btpc-menu-popover,
    .btpc-menu-term:focus-within .btpc-menu-popover {
        transform: translate(0, 0);
    }
}

.btpc-menu-popover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.btpc-menu-term:hover .btpc-menu-popover,
.btpc-menu-term:focus .btpc-menu-popover,
.btpc-menu-term:focus-within .btpc-menu-popover {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

@media (max-width: 640px) {
    body.tax-product_cat.term-carplay-box { overflow-x: hidden; }
    body.tax-product_cat.term-carplay-box .btpc-root,
    body.tax-product_cat.term-carplay-box .btpc-product,
    body.tax-product_cat.term-carplay-box .btpc-product-grid,
    body.tax-product_cat.term-carplay-box .btpc-config { min-width: 0; max-width: 100%; }
    .btpc-menu-check-card { padding: 15px; }
    .btpc-menu-popover { left: 50%; right: auto; width: min(310px, calc(100vw - 32px)); transform: translate(-50%, 8px); }
    .btpc-menu-term:hover .btpc-menu-popover,
    .btpc-menu-term:focus .btpc-menu-popover,
    .btpc-menu-term:focus-within .btpc-menu-popover { transform: translate(-50%, 0); }
}

/* Keep overflow brands genuinely collapsed. This must follow the legacy
 * card display:flex !important rule above. */
body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 > .btpc-brand-overflow[hidden],
body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 > .btpc-brand-overflow[hidden] {
    display: none !important;
}

/* Compact, deterministic brand directory: eight logos per desktop row. */
@media (min-width: 1201px) {
    body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1,
    body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1,
    body.tax-product_cat.term-carplay-box .btpc-brand-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
    body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 > [class*="brand-card"],
    body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 > [class*="brand-card"],
    body.tax-product_cat.term-carplay-box .btpc-brand-card {
        min-height: 126px !important;
        padding: 11px 8px !important;
    }
    body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 > [class*="brand-card"] img,
    body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 > [class*="brand-card"] img,
    body.tax-product_cat.term-carplay-box .btpc-brand-card img {
        width: 58px !important;
        max-width: 58px !important;
        height: 42px !important;
    }
    body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1 > [class*="brand-card"] strong,
    body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1 > [class*="brand-card"] strong,
    body.tax-product_cat.term-carplay-box .btpc-brand-card strong {
        font-size: 15px !important;
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    body.tax-product_cat.term-carplay-box #bt-mini-brand-step-v1,
    body.tax-product_cat.term-carplay-box #bt-bmw-brand-step-v1,
    body.tax-product_cat.term-carplay-box .btpc-brand-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }
}

/* Prevent the two wide Volkswagen configurations from creating horizontal
 * page movement on phones, without changing their desktop composition. */
@media (max-width: 640px) {
    html:has(body.tax-product_cat.term-carplay-box),
    body.tax-product_cat.term-carplay-box {
        max-width: 100% !important;
        overflow-x: clip !important;
    }
    body.tax-product_cat.term-carplay-box .btpc-root,
    body.tax-product_cat.term-carplay-box .btpc-catalog,
    body.tax-product_cat.term-carplay-box .btpc-product,
    body.tax-product_cat.term-carplay-box .btpc-product-grid,
    body.tax-product_cat.term-carplay-box .btpc-gallery,
    body.tax-product_cat.term-carplay-box .btpc-config,
    body.tax-product_cat.term-carplay-box .btpc-fields,
    body.tax-product_cat.term-carplay-box .btpc-description,
    body.tax-product_cat.term-carplay-box .btpc-option-card,
    body.tax-product_cat.term-carplay-box .btpc-price,
    body.tax-product_cat.term-carplay-box .btpc-whatsapp {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    body.tax-product_cat.term-carplay-box .btpc-product-grid,
    body.tax-product_cat.term-carplay-box .btpc-products-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    body.tax-product_cat.term-carplay-box .btpc-main-image,
    body.tax-product_cat.term-carplay-box .btpc-main-image img {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
    }
    body.tax-product_cat.term-carplay-box .btpc-whatsapp {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}
