/* ======================================================================
   Turbosmart tab — turbosmart.tab.cfm
   Same responsive flex grid as the other brand tabs (4->3->2->1 columns),
   namespaced under .tsm- so it can't clash with the vehicle page chrome or
   another brand tab. Turbosmart's primary brand colour is #007dba (blue);
   their logo artwork is WHITE, so any logo panel needs a dark backing
   (hence .tsm-logo-wrap).
   ====================================================================== */

.tsm-intro {
    text-align: center;
    margin: 8px auto 0;
}
/* The supplied Turbosmart logo is white artwork - it vanishes on white, so
   it sits on a black plate rather than directly on the page. */
.tsm-logo-wrap {
    display: inline-block;
    background: #000;
    padding: 14px 26px;
    border-radius: 8px;
    margin: 30px auto;
}
.tsm-logo {
    display: block;
    max-height: 54px;
    width: auto;
    max-width: 100%;
}
.tsm-intro p {
    color: #555;
    font-size: 1rem;
    margin: 0 auto 8px;
    max-width: 760px;
}

/* ---- Vehicle selector (brand page) --------------------------------- */
.tsm-selector {
    padding: 1.25rem;
    background-color: #11171f;
    box-sizing: border-box;
}
.tsm-selector-title {
    color: #fff;
    font-size: 1.5rem;
    margin: 0 0 1rem;
}
.tsm-selector-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}
.tsm-field {
    display: flex;
    flex-direction: column;
    flex: 1 1 180px;
    min-width: 150px;
}
.tsm-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #cdd6e4;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tsm-field select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 0.4rem;
    border: 1px solid #cbd5e1;
    font-size: 1rem;      /* 16px: matches the site input scale and stops iOS zooming */
    line-height: 1.4;
    background: #fff;
    box-sizing: border-box;
}
.tsm-field select:disabled {
    background-color: #e5e7eb;
    border-color: #d1d5db;
    color: #6b7280;
}
.tsm-field--button { flex: 0 0 auto; }
.tsm-field--button button {
    padding: 0.65rem 1.6rem;
    font-size: 1rem;
    font-weight: 700;
    border: 0;
    border-radius: 0.4rem;
    background: #007dba;
    color: #fff;
    cursor: pointer;
}
.tsm-field--button button:disabled {
    background: #6b7280;
    cursor: not-allowed;
}
.tsm-status {
    display: none;
    margin-top: 0.75rem;
    color: #cdd6e4;
    font-size: 0.9375rem;
}
.tsm-status--error { color: #ffb4a8; }

.tsm-loading, .tsm-error {
    text-align: center;
    padding: 30px 0;
    font-size: 1rem;
    color: #555;
}

/* ---- Vehicle result heading (brand-page selector results) ----------- */
.tsm-vehhead {
    text-align: center;
    margin: 28px auto 4px;
}
.tsm-vehhead h2 {
    margin: 0 auto 2px;
    color: #11171f;
    font-size: 1.8rem;
    line-height: 1.15;
}
.tsm-vehspec {
    color: #007dba;
    font-weight: 700;
    font-size: 1rem;
    margin: 0 auto 6px;
}
/* the master file's per-vehicle caveats ("not for cars built after ...") */
.tsm-excl {
    max-width: 760px;
    margin: 10px auto 0;
    padding: 10px 14px;
    background: #fff6e5;
    border: 1px solid #f0d9a8;
    border-radius: 6px;
    font-size: 0.9375rem;
    color: #6b4e12;
}

/* Vehicle results are a single flat grid (no category sections), so the
   category and the master file's product-type label sit on the card. */
.tsm-ptype {
    display: inline-block;
    background: #eef4f8;
    color: #11171f;
    border: 1px solid #cfe0ec;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: .02em;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ---- Grid ---------------------------------------------------------- */
.tsm-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;   /* centre lone / partial-row cards */
    gap: 20px;
    margin: 32px 24px;
}
.tsm-card {
    flex: 1 0 calc(25% - 20px);
    max-width: calc((100% - 60px) / 4);   /* cap at one column so a lone card doesn't span full width */
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease;
}
.tsm-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}
.tsm-card > a {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 14px;
    text-decoration: none;
    color: inherit;
}

/* ---- Image ---------------------------------------------------------
   Fixed-height flex box rather than plain text-align:center. A product
   image, the shared placeholder and a small/odd-sized image all get the
   same 190px band, so cards line up across a row instead of the text
   starting at a different height per card. Centring is done by the flex
   box, so it holds even for an image far narrower than the card.       */
.tsm-image {
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.tsm-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ---- Category badge ------------------------------------------------ */
.tsm-badge-row {
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;   /* centred in the card, not hugging the left edge */
    gap: 6px;
}
.tsm-badge {
    display: inline-block;
    background: #007dba;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 4px;
}

/* ---- Titles -------------------------------------------------------- */
.tsm-titles {
    margin-bottom: 8px;
}
.tsm-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: #11171f;
}
.tsm-partnumber {
    font-size: 0.9375rem;
    color: #666;
    margin-top: 3px;
}

/* ---- Description snippet ------------------------------------------- */
.tsm-desc {
    font-size: 0.9375rem;
    line-height: 1.4;
    color: #555;
    margin-bottom: 10px;
}

/* ---- Stock --------------------------------------------------------- */
.tsm-stock {
    font-size: 0.9375rem;
    margin: 0 0 10px;
}

/* push the price block to the bottom so cards of differing text length
   still line their prices up across a row */
.tsm-card .price-container {
    margin-top: auto;
}

/* ---- Responsive ---------------------------------------------------- */
@media (max-width: 1200px) {
    .tsm-card {
        flex-basis: calc(33.333% - 20px);
        max-width: calc((100% - 40px) / 3);
    }
}
@media (max-width: 900px) {
    .tsm-card {
        flex-basis: calc(50% - 20px);
        max-width: calc((100% - 20px) / 2);
    }
}
@media (max-width: 600px) {
    .tsm-grid {
        margin: 24px 12px;
    }
    .tsm-card {
        flex-basis: 100%;
        max-width: 100%;
    }
}

/* ---- Hero (moved from inline <style> in turbosmart.cfm) ---- */
    /* Hero: the Turbosmart banner photo sits BEHIND, darkened by an overlay so
       the white logo artwork stays legible on top. Layer order in the shorthand
       is front-to-back, so the gradients are listed before the image:
         1. brand-blue glow   2. dark scrim   3. the banner photo */
    .tsm-hero {
        background-color: #11171f;
        background-image:
            radial-gradient(circle at center, rgba(0,125,186,0.35) 0%, rgba(0,0,0,0) 65%),
            linear-gradient(rgba(10,14,20,0.72), rgba(10,14,20,0.82)),
            url('../images/suppliers/Turbosmart/Turbocharger-Website-Banner.webp');
        background-size: auto, auto, cover;
        background-position: center, center, center;
        background-repeat: no-repeat;
        text-align: center;
        padding: 9vh 24px;
        margin-top: 24px;
    }
    .tsm-hero-logo {
        width: 100%;
        max-width: 460px;
        height: auto;
        margin: 0 auto;
        display: block;
    }
    .tsm-hero h1 {
        color: #fff;
        font-size: 1.75rem;
        margin: 0;
    }
    .tsm-hero p {
        color: #cdd6e4;
        max-width: 720px;
        margin: 14px auto 0;
        font-size: 1rem;
    }
    .tsm-browse-head {
        margin: 48px 0 0;
        padding-top: 28px;
        border-top: 1px solid #e2e2e2;
    }

    /* ---- Range tiles (turbosmart.cfm, Octane_Product_Ranges) ----------
       Same card as whiteline.cfm / tein.cfm with the brand's blue rule and
       the optional range photo as the card header. */
    .tsm-ranges-head { margin: 40px 0 16px; }
    .tsm-ranges-head h2 { margin: 0 0 6px; font-size: 1.75rem; }
    .tsm-ranges-head p { margin: 0; color: #555; font-size: 1rem; }
    .tsm-tiles {
        display: flex;
        flex-wrap: wrap;
        gap: 14px;
        justify-content: center;
    }
    .tsm-tile {
        flex: 1 1 260px;
        max-width: 360px;
        background: #fff;
        border: 1px solid #e3e3e3;
        border-left: 6px solid #007dba;
        border-radius: 8px;
        padding: 14px 16px;
        text-decoration: none;
        color: inherit;
        display: flex;
        flex-direction: column;
        transition: box-shadow .15s ease, transform .15s ease;
    }
    .tsm-tile:hover {
        box-shadow: 0 6px 16px rgba(0,0,0,0.12);
        transform: translateY(-2px);
    }
    .tsm-tile-img {
        display: block;
        aspect-ratio: 4 / 3;
        margin: -14px -16px 12px -16px;
        background: #fff;
        border-bottom: 1px solid #e3e3e3;
        border-radius: 0 8px 0 0;
        overflow: hidden;
    }
    .tsm-tile-img img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 10px;
        box-sizing: border-box;
    }
    .tsm-tile-name {
        font-weight: 800;
        font-size: 1.125rem;
        color: #11171f;
        margin-bottom: 6px;
    }
    .tsm-tile-blurb {
        font-size: 0.9375rem;
        color: #555;
        line-height: 1.4;
        flex: 1 1 auto;
    }
    .tsm-tile-count {
        margin-top: 10px;
        font-size: 0.875rem;
        color: #666;
    }
