/* Point S TBR Tyre Finder | Responsive page styling
   Save beside PageTyreFinder.razor to use Blazor CSS isolation.
   Replace older Tyre Finder CSS rules if they use the same .tbr-* selectors.
*/

.tbr-layout,
.tbr-layout * {
    box-sizing: border-box;
}

.tbr-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: start;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 14px;
    font-family: inherit;
}

/* Filters */
.tbr-filter-sidebar,
.tbr-results-area {
    min-width: 0;
    width: 100%;
}

.tbr-filter-panel {
    background: #f5f8fc;
    border: 1px solid #dce6f3;
    border-radius: 13px;
    padding: 16px;
}

.tbr-filter-panel-title {
    color: #0b3a83;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid #dbe5f2;
}

.tbr-filter {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 6px;
    margin-bottom: 14px;
}

    .tbr-filter label {
        color: #263c59;
        font-size: 12px;
        font-weight: 700;
    }

    /* Reach Telerik controls rendered within KPSDropdown/MultiSelect. */
    .tbr-filter ::deep .k-input,
    .tbr-filter ::deep .k-picker,
    .tbr-filter ::deep .k-multiselect,
    .tbr-filter ::deep .k-dropdownlist,
    .tbr-filter ::deep .k-combobox {
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
    }

.tbr-filter-actions {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.tbr-search-button,
.tbr-clear-button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    min-height: 39px;
    width: 100%;
    border-radius: 7px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.tbr-search-button {
    color: #fff;
    background: #1053cf;
    border: 1px solid #1053cf;
}

    .tbr-search-button:hover {
        background: #083ea5;
    }

.tbr-clear-button {
    color: #304564;
    background: #fff;
    border: 1px solid #ccd9e8;
}

    .tbr-clear-button:hover {
        background: #edf3fb;
    }

.tbr-mobile-filter-toggle {
    display: none;
}

/* Branding + result count */
.tbr-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 19px;
}

.tbr-heading-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    gap: 8px;
}

/* Navy background is important: the supplied logo has white text on transparency. */
.tbr-logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(120deg, #06275d, #104786);
    border-radius: 12px;
    padding: 8px 15px;
    max-width: 100%;
}

.tbr-header-logo {
    display: block;
    width: 240px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.tbr-heading-content p {
    margin: 0;
    color: #66758a;
    font-size: 13px;
    line-height: 1.4;
}

.tbr-found-count {
    color: #0b438c;
    background: #edf4fe;
    border-radius: 999px;
    padding: 8px 13px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

/* Tier sections */
.tbr-results {
    display: grid;
    gap: 21px;
    min-width: 0;
}

.tbr-tier-section {
    --tbr-tier-start: #225ca8;
    --tbr-tier-end: #438ac7;
    min-width: 0;
    background: linear-gradient(120deg, var(--tbr-tier-start), var(--tbr-tier-end));
    padding: 16px;
    border-radius: 14px;
    box-shadow: 0 5px 18px rgba(14, 57, 111, 0.09);
}

.tbr-tier-1 {
    --tbr-tier-start: #0e4c9a;
    --tbr-tier-end: #226fce;
}

.tbr-tier-2 {
    --tbr-tier-start: #337fb7;
    --tbr-tier-end: #5aa5d9;
}

.tbr-tier-3 {
    --tbr-tier-start: #167d76;
    --tbr-tier-end: #49a89a;
}

.tbr-tier-4 {
    --tbr-tier-start: #65758f;
    --tbr-tier-end: #8b9bb0;
}

.tbr-tier-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 11px;
    margin-bottom: 13px;
}

    /* Explicit white prevents Tier 1 text from blending into its blue background. */
    .tbr-tier-title,
    .tbr-tier-heading .tbr-tier-title {
        margin: 0;
        color: #fff !important;
        font-size: 20px;
        font-weight: 800;
        line-height: 1.2;
        letter-spacing: 0.1px;
    }

.tbr-tier-count {
    flex: 0 0 auto;
    color: #fff;
    background: rgba(255, 255, 255, 0.20);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

/* Product cards */
.tbr-result-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
    min-width: 0;
}

.tbr-result-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    padding: 13px;
    background: #fff;
    border: 1px solid #e4eaf1;
    border-radius: 11px;
    box-shadow: 0 2px 7px rgba(2, 24, 56, .06);
}

.tbr-card-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-height: 23px;
}

.tbr-brand {
    min-width: 0;
    color: #1f344f;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.tbr-card-pattern {
    max-width: 48%;
    color: #66778b;
    font-size: 11px;
    font-weight: 600;
    overflow-wrap: anywhere;
    text-align: right;
}

.tbr-card-body {
    display: flex;
    flex-direction: column;
    gap: 11px;
    flex: 1;
    min-width: 0;
}

.tbr-tyre-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 148px;
    min-width: 0;
    width: 100%;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 8px;
    background: #f8fafc;
}

.tbr-tyre-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.tbr-tyre-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #8d99a9;
    font-size: 11px;
    text-align: center;
}

    .tbr-tyre-image-placeholder ::deep .k-icon {
        font-size: 24px;
    }

.tbr-card-info {
    flex: 1;
    min-width: 0;
}

.tbr-product-description {
    color: #263347;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
    margin-bottom: 10px;
}

.tbr-spec-list {
    display: grid;
    gap: 6px;
}

.tbr-spec-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    font-size: 11.5px;
    line-height: 1.3;
}

    .tbr-spec-row span {
        flex: 0 0 auto;
        color: #798698;
    }

    .tbr-spec-row strong {
        color: #33445c;
        font-weight: 700;
        overflow-wrap: anywhere;
        text-align: right;
    }

.tbr-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid #e8edf4;
    margin-top: 13px;
    padding-top: 10px;
    font-size: 10.5px;
    font-weight: 700;
    color: #7c899a;
}

.tbr-retread-stars {
    display: flex;
    align-items: center;
    gap: 1px;
    line-height: 1;
    font-size: 17px;
}

.retread-star.full {
    color: #f3ad14;
}

.retread-star.empty {
    color: #d1d7df;
}

.retread-star.half {
    background: linear-gradient(90deg, #f3ad14 50%, #d1d7df 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tbr-no-results,
.tbr-start-message {
    padding: 20px;
    border: 1px dashed #ccd9e8;
    border-radius: 11px;
    background: #f8fafd;
    color: #5a6e86;
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 1450px) and (min-width: 1061px) {
    .tbr-result-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1060px) and (min-width: 901px) {
    .tbr-layout {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 14px;
    }

    .tbr-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Tablet and mobile: filters move above results and default closed. */
@media (max-width: 900px) {
    .tbr-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 13px;
        padding: 10px;
    }

    .tbr-mobile-filter-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        min-height: 45px;
        padding: 10px 15px;
        border: 1px solid #cfdcee;
        border-radius: 9px;
        background: #f2f7ff;
        color: #0e438d;
        font: inherit;
        font-weight: 800;
        font-size: 13px;
        cursor: pointer;
    }

    .tbr-filter-toggle-copy {
        display: inline-flex;
        align-items: center;
        gap: 9px;
    }

        .tbr-filter-toggle-copy > span {
            font-size: 20px;
            line-height: 1;
        }

    .tbr-filter-toggle-chevron {
        font-size: 20px;
        font-weight: 400;
        line-height: 1;
    }

    .tbr-filter-panel {
        display: none;
        margin-top: 7px;
        padding: 14px;
    }

        .tbr-filter-panel.tbr-filter-panel-open {
            display: block;
        }

    .tbr-results-header {
        margin-bottom: 13px;
    }

    .tbr-header-logo {
        width: 200px;
    }

    .tbr-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Phone: compact, horizontal product cards so tyres are easy to scan. */
@media (max-width: 600px) {
    .tbr-layout {
        padding: 8px;
        gap: 12px;
    }

    .tbr-logo-container {
        padding: 7px 11px;
        border-radius: 10px;
    }

    .tbr-header-logo {
        width: 174px;
    }

    .tbr-heading-content {
        gap: 7px;
    }

        .tbr-heading-content p {
            font-size: 12px;
        }

    .tbr-found-count {
        font-size: 11px;
        padding: 6px 11px;
    }

    .tbr-results {
        gap: 14px;
    }

    .tbr-tier-section {
        padding: 11px;
        border-radius: 11px;
    }

    .tbr-tier-heading {
        margin-bottom: 11px;
        padding-bottom: 10px;
    }

        .tbr-tier-title,
        .tbr-tier-heading .tbr-tier-title {
            font-size: 17px;
        }

    .tbr-tier-count {
        font-size: 10px;
        padding: 5px 8px;
    }

    .tbr-result-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .tbr-result-card {
        padding: 11px;
        border-radius: 9px;
    }

    .tbr-card-heading {
        margin-bottom: 6px;
    }

    .tbr-brand {
        font-size: 14px;
    }

    .tbr-card-pattern {
        font-size: 10px;
    }

    .tbr-card-body {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 10px;
        align-items: start;
    }

    .tbr-tyre-image-wrapper {
        height: 112px;
        margin: 0;
    }

    .tbr-tyre-image-placeholder {
        font-size: 9px;
        gap: 5px;
    }

        .tbr-tyre-image-placeholder ::deep .k-icon {
            font-size: 20px;
        }

    .tbr-product-description {
        font-size: 11px;
        line-height: 1.32;
        margin: 0 0 8px;
    }

    .tbr-spec-list {
        gap: 5px;
    }

    .tbr-spec-row {
        font-size: 10.5px;
        gap: 4px;
    }

    .tbr-card-footer {
        margin-top: 9px;
        padding-top: 8px;
    }

    .tbr-retread-stars {
        font-size: 16px;
    }
}

/* Very narrow devices: preserve readable specifications. */
@media (max-width: 350px) {
    .tbr-card-body {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 8px;
    }

    .tbr-tyre-image-wrapper {
        height: 100px;
    }

    .tbr-spec-row {
        flex-wrap: wrap;
        gap: 1px 5px;
    }

        .tbr-spec-row strong {
            text-align: left;
        }
}




/* =========================================
   TYRE FINDER SELECTION POPUP
   ========================================= */

.kps-tyre-finder-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 24px;
    padding: 25px 15px;
}

.kps-tyre-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 190px;
    padding: 22px;
    background: #f7faff;
    border: 2px solid #d9e6f5;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .kps-tyre-choice:hover {
        background: #eef6ff;
        border-color: #1675d1;
        box-shadow: 0 8px 24px rgba(0, 65, 150, 0.15);
        transform: translateY(-3px);
    }

    .kps-tyre-choice:focus-visible {
        outline: 3px solid #1675d1;
        outline-offset: 3px;
    }

    .kps-tyre-choice img {
        display: block;
        width: 100%;
        max-width: 320px;
        height: auto;
        object-fit: contain;
    }

/* MOBILE */

@media (max-width: 600px) {
    .kps-tyre-finder-choices {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px 5px;
    }

    .kps-tyre-choice {
        min-height: 140px;
    }
}





/* =========================================
   MODERN TYRE FINDER POPUP
   ========================================= */

.kps-modern-tyre-popup.k-window {
    border-radius: 20px !important;
    overflow: hidden;
    border: 1px solid #e3eaf2;
    box-shadow: 0 22px 65px rgba(0, 28, 75, 0.25);
}

/* Hide Telerik title bar */

.kps-modern-tyre-popup .k-window-titlebar {
    display: none !important;
}

.kps-modern-tyre-popup .k-window-content {
    padding: 0 !important;
    overflow: hidden;
    background: white;
}

.kps-tyre-popup-body {
    position: relative;
    padding: 40px 28px 28px;
    background: #ffffff;
}

/* Close button */

.kps-tyre-popup-close {
    position: absolute;
    top: 8px;
    right: 14px;
    z-index: 5;
    border: none;
    background: transparent;
    color: #8292a6;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

    .kps-tyre-popup-close:hover {
        color: #003c91;
    }

/* Cards */

.kps-tyre-selection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.kps-tyre-selection-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 245px;
    padding: 28px 20px 48px;
    border: 1px solid #dae5f2;
    border-radius: 16px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

/* TBR — Light green background */
.kps-tbr-card {
    background: linear-gradient( 145deg, #1675d1, #e5f4eb );
}

/* PCR — Light blue background */
.kps-pcr-card {
    background: linear-gradient( 145deg, #1675d1, #e5effb );
}


/* Hover effect */

.kps-tyre-selection-card:hover {
    transform: translateY(-6px) scale(1.015);
    border-color: #3385cf;
    box-shadow: 0 16px 30px rgba(0, 55, 130, 0.16);
}

.kps-tyre-selection-card:focus-visible {
    outline: 3px solid #1683e0;
    outline-offset: 3px;
}

/* Logo */

.kps-tyre-selection-logo {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    max-width: 340px;
    height: auto;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.kps-tyre-selection-card:hover
.kps-tyre-selection-logo {
    transform: scale(1.035);
}

/* =========================================
   TRANSPARENT VEHICLE ANIMATION
   ========================================= */


.kps-vehicle-animation {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 75px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    pointer-events: none;
}

    .kps-vehicle-animation img {
        position: static;
        width: 210px;
        height: 75px;
        object-fit: contain;
    }

/* TBR drives LEFT */

.kps-tbr-card .kps-vehicle-animation img {
    animation: truckDriveLeft 5s linear infinite;
}

/* PCR drives RIGHT */

.kps-pcr-card .kps-vehicle-animation img {
    animation: carDriveRight 5s linear infinite;
}

@keyframes truckDriveLeft {
    0% {
        transform: translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    85% {
        transform: translateX(-115px);
        opacity: 1;
    }

    100% {
        transform: translateX(-115px);
        opacity: 0;
    }
}

@keyframes carDriveRight {
    0% {
        transform: translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    85% {
        transform: translateX(115px);
        opacity: 1;
    }

    100% {
        transform: translateX(115px);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kps-vehicle-animation img {
        animation: none !important;
        opacity: 1;
    }
}

/* =========================================
   TYRE FINDER RESULT CARDS — PCR + TBR
   Large tyre photo, details on the right.
   Comparison window styles remain unchanged.
   ========================================= */

.tbr-tier-section .tbr-result-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, max(490px, 48%)), 1fr));
    gap: 14px;
    align-items: stretch;
}

.tbr-result-grid .tbr-result-card {
    padding: 16px;
    border-radius: 13px;
    container-type: inline-size;
    container-name: tyre-result;
}

.tbr-result-card .tbr-card-body {
    display: grid;
    grid-template-columns: minmax(0, 45%) minmax(0, 1fr);
    align-items: stretch;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.tbr-result-tyre-image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-width: 0;
    min-height: 290px;
    background: #fff;
}

    .tbr-result-tyre-image .tbr-result-tyre-photo {
        display: block;
        width: 100%;
        max-width: 340px;
        height: 320px;
        max-height: none;
        object-fit: contain;
    }

    .tbr-result-tyre-image .tbr-result-tyre-logo {
        display: block;
        max-width: 90%;
        max-height: 110px;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .tbr-result-tyre-image .tbr-compare-brand {
        text-align: center;
        overflow-wrap: anywhere;
    }

.tbr-result-card .tbr-card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    min-width: 0;
}

.tbr-result-card .tbr-card-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 5px;
    min-height: 0;
    margin: 0;
}

.tbr-result-card .tbr-brand-logo-container {
    width: 100%;
    min-height: 0;
}

.tbr-result-card .tbr-brand-logo {
    max-width: min(100%, 230px);
    max-height: 52px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.tbr-result-card .tbr-brand {
    color: #0d4e99;
    font-size: 20px;
    font-weight: 800;
}

.tbr-result-card .tbr-card-pattern {
    max-width: 100%;
    text-align: left;
    color: #0d4e99;
    font-size: clamp(19px, 2vw, 27px);
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.tbr-result-card .tbr-product-description {
    color: #233b58;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.tbr-result-card .tbr-spec-list {
    gap: 7px;
    border-top: 1px solid #e6edf5;
    padding-top: 10px;
}

.tbr-result-card .tbr-spec-row {
    font-size: 12px;
    line-height: 1.4;
    gap: 8px;
    flex-wrap: wrap;
}

    .tbr-result-card .tbr-spec-row span {
        flex: 0 1 auto;
    }

    .tbr-result-card .tbr-spec-row strong {
        min-width: 0;
        margin-left: auto;
        text-align: right;
    }

.tbr-result-card .tbr-card-footer {
    flex-wrap: wrap;
    margin: 0;
    padding-top: 9px;
    font-size: 12px;
}

.tbr-result-card .tbr-compare-select-row {
    margin-top: auto;
    padding: 5px 0 0;
    justify-content: flex-end;
}

.tbr-result-card .tbr-compare-select {
    max-width: 100%;
    white-space: normal;
}

/* Use the card's actual available width, not the screen width. */
@container tyre-result (max-width: 350px) {
    .tbr-result-card .tbr-card-body {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .tbr-result-tyre-image {
        min-height: 0;
    }

        .tbr-result-tyre-image .tbr-result-tyre-photo {
            height: 270px;
        }

    .tbr-result-card .tbr-card-info {
        gap: 9px;
    }
}
