/* =====================================================================
   Part Finder layout. Uses only the brand palette in gabriel.css
   (--gabriel-*) and the site's existing greys.
   ===================================================================== */

/* ---- Search panels (tabs) ---- */
.pf-tabs { border-bottom: 1px solid #dddddd; margin-bottom: 0; }
.pf-tabs .nav-link {
    color: #363636;
    font-weight: bold;
    border: 1px solid transparent;
    border-top: 3px solid transparent;
    border-radius: 0;
    padding: 10px 18px;
}
.pf-tabs .nav-link:hover { color: var(--gabriel-red); border-color: transparent; border-top-color: #dddddd; }
.pf-tabs .nav-link.active {
    color: var(--gabriel-red);
    background: #EBEAEA;
    border-color: #dddddd #dddddd #EBEAEA;
    border-top: 3px solid var(--gabriel-red);
}
.pf-panel {
    background: #EBEAEA;
    border: 1px solid #dddddd;
    border-top: 0;
    padding: 16px 20px 6px;
    margin-bottom: 25px;
}
.pf-panel label { font-weight: bold; margin-bottom: 4px; }
.pf-panel .input-group .form-control,
.pf-panel .input-group .form-select { margin-bottom: 0; }
.pf-panel .input-group { margin-bottom: 4px; }
.pf-panel .input-group .btn { padding-top: 0; padding-bottom: 0; }
.pf-xref-group .form-select { max-width: 45%; }
.pf-error { color: var(--gabriel-red); font-size: 13px; font-weight: bold; min-height: 20px; margin-bottom: 8px; }
.pf-start-again { display: inline-block; margin: 0 0 12px; font-size: 13px; text-decoration: underline; }

/* ---- Chosen vehicle summary ---- */
.pf-vehicle-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
    background: #000000; color: #fff; padding: 10px 12px; margin-bottom: 0; font-size: 14px;
}
/* Focus moves to the results header after loading (so screen readers announce it); no visible outline. */
.pf-vehicle-bar:focus, .pf-caption:focus { outline: none; }
.pf-vehicle-label { color: #cccccc; margin-right: 4px; }
.pf-sep { color: #999999; margin: 0 4px; }
.pf-vehicle-buttons { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Search caption ---- */
.pf-caption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 10px; }
.pf-search-image { display: inline-block; margin: 8px 0; }
.pf-note { font-size: 13px; color: #4d4d4d; margin: 10px 0; }
.pfResults h2.subMain { margin-top: 0; }

/* ---- Vehicle list: whole row is the link ---- */
tr.pf-row-link { position: relative; cursor: pointer; }
tr.pf-row-link:hover td, tr.pf-row-link:focus-within td { box-shadow: inset 0 -2px 0 var(--gabriel-red); }
tr.pf-row-link a.stretched-link { color: inherit; font-weight: bold; }
tr.pf-row-link:hover a.stretched-link { color: var(--gabriel-red); }
.pf-select-cell { text-align: right; }

/* ---- Applications ---- */
a.pf-part { color: #000000; font-weight: bold; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
a.pf-part:hover { color: var(--gabriel-red); }
.pf-stock-badge {
    background: #fff; color: var(--gabriel-red); border: 1px solid var(--gabriel-red);
    font-size: 11px; font-weight: bold; padding: 2px 5px; border-radius: 3px; margin-left: 4px; white-space: nowrap; vertical-align: middle;
}
table.productTable tr.locationGroup td {
    background: #fff;
    color: var(--gabriel-red);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-left: 4px solid var(--gabriel-red) !important;
    line-height: 1.4 !important;
}
/* Mounting-type symbols, drawn with the Gabriel mounting font (was a server-rendered PNG per icon) */
@font-face {
    font-family: "Gabriel Mounting Types";
    src: url("../fonts/GabrielMountingTypes.woff2") format("woff2"),
         url("../fonts/GabrielMountingTypes.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: block;
}
.pf-mount {
    font-family: "Gabriel Mounting Types";
    font-size: 23px;
    line-height: 1;
    color: #000000;
    display: inline-block;
    min-width: 40px;
    text-align: center;
    vertical-align: middle;
    cursor: help;
}

/* ---- Part-number search results: sized columns, no wrapped dates, compact rows ---- */
@media (min-width: 768px) {
    #search-result-table {
        table-layout: auto;
    }
        #search-result-table th.sr-mount, #gvSearchResult th.sr-dates, #gvSearchResult th.sr-location, #gvSearchResult th.sr-action {
            width: 1%;
            white-space: nowrap;
        }
        #search-result-table td {
            line-height: 1.5;
            vertical-align: middle;
            padding: 10px;
        }
            #search-result-table td[data-label="Mount"] {
                text-align: center;
            }
            #search-result-table td[data-label="Dates"], #gvSearchResult td[data-label="Location"] {
                white-space: nowrap;
            }
            #search-result-table td:last-child {
                white-space: nowrap;
                text-align: right;
            }
}

/* ---- Search results (part-number + competitor search): modern skin, same layout ---- */
#xRefSearchHint.pf-note {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-left: 4px solid var(--gabriel-red);
    border-radius: 6px;
    padding: 10px 14px;
    color: #555;
    line-height: 1.5;
}
.tableCaption.pf-caption {
    background: #111;
    border-radius: 8px 8px 0 0;
    padding: 12px 16px;
    font-size: 14px;
    letter-spacing: 0.2px;
}

@media (min-width: 768px) {
    table.productTable.search-result-table {
        border-collapse: separate;
        border-spacing: 0;
        border: 1px solid #e3e3e3;
        border-top: 0;
        border-radius: 0 0 8px 8px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }
    /* Clear the legacy #999 grid lines; rows are separated by soft dividers only */
    table.productTable.search-result-table tr td,
    table.productTable.search-result-table tr td:first-child,
    table.productTable.search-result-table tr.header.red,
    table.productTable.search-result-table tr.header.red th:first-child {
        border: 0;
    }
    table.productTable.search-result-table tr td,
    table.productTable.search-result-table tr td:first-child {
        border-bottom: 1px solid #efefef;
    }

    /* Part number + photo rows */
    table.productTable.search-result-table thead td {
        background: #fff;
        padding: 12px 16px;
        line-height: 1.4;
    }
    table.productTable.search-result-table thead tr:first-child td {
        font-size: 17px;
        font-weight: 700;
        color: #111;
        letter-spacing: 0.3px;
    }
    table.productTable.search-result-table tbody + thead tr:first-child td { border-top: 6px solid #f3f3f3; }
    table.productTable.search-result-table .pf-search-image img { transition: transform 0.2s ease; }
    table.productTable.search-result-table .pf-search-image:hover img { transform: scale(1.04); }

    /* Column header */
    table.productTable.search-result-table tr.header th {
        padding: 11px 16px;
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        line-height: 1.2;
    }

    /* Vehicle rows */
    table.productTable.search-result-table tbody tr td {
        padding: 14px 16px;
        line-height: 1.5;
        vertical-align: middle;
        color: #2b2b2b;
        transition: background-color 0.15s ease;
    }
    table.productTable.search-result-table tbody tr:last-child td,
    table.productTable.search-result-table tbody tr:last-child td:first-child { border-bottom: 0; }
    table.productTable.search-result-table tbody tr:nth-child(even) { background: #fafafa; }
    table.productTable.search-result-table tbody tr:hover td { background: #fff5f4; }
    table.productTable.search-result-table .notes { color: #6b6b6b; font-size: 13px; }

    /* "All parts for this vehicle" pill */
    table.productTable.search-result-table .badge-gabriel {
        display: inline-block;
        padding: 6px 12px;
        border-radius: 999px;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.2px;
        bottom: 0;
        box-shadow: 0 1px 2px rgba(237, 45, 35, 0.25);
        transition: background-color 0.15s ease, box-shadow 0.15s ease;
    }
    table.productTable.search-result-table a:hover .badge-gabriel,
    table.productTable.search-result-table a:focus-visible .badge-gabriel {
        background: var(--gabriel-red-hover);
        box-shadow: 0 2px 6px rgba(237, 45, 35, 0.35);
    }
}

/* ---- Mounting key, right under the results ---- */
.pf-mount-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 8px 0 25px; }
.pf-mount-key-title { font-weight: bold; font-size: 13px; margin-right: 4px; }

/* ---- Loading state ---- */
[data-pf-root] { position: relative; }
.pf-loading .pfResults { opacity: 0.45; transition: opacity 0.15s; }
.pf-loading::after {
    content: "";
    position: absolute; top: 60px; left: 50%;
    width: 34px; height: 34px; margin-left: -17px;
    border: 4px solid #dddddd; border-top-color: var(--gabriel-red); border-radius: 50%;
    animation: pf-spin 0.7s linear infinite;
    z-index: 20;
}
@keyframes pf-spin { to { transform: rotate(360deg); } }

/* ---- Phones: results as cards instead of wide tables ---- */
@media (max-width: 767.98px) {
    .pf-panel { padding: 12px 12px 4px; }
    .pf-tabs .nav-link { padding: 8px 10px; font-size: 13px; }
    .pf-xref-group { flex-wrap: wrap; }
    .pf-xref-group .form-control { flex: 1 1 100%; border-radius: 2px !important; margin-bottom: 6px !important; }
    .pf-xref-group .form-select { max-width: none; flex: 1 1 auto; border-radius: 2px 0 0 2px !important; }

    /* Keep "Change vehicle" in reach while scrolling the parts */
    .pf-vehicle-bar { position: sticky; top: 0; z-index: 30; }

    table.pf-cards, table.pf-cards tbody, table.pf-cards tr, table.pf-cards td { display: block; width: 100%; }
    table.pf-cards { border: 0; background: transparent; }
    table.pf-cards tr.header { display: none; }
    table.pf-cards tr { border: 1px solid #999999; margin: 0 0 10px; padding: 6px 0; }
    table.pf-cards tr td, table.pf-cards tr td:first-child { border: 0 !important; padding: 3px 12px !important; line-height: 1.5 !important; }
    table.pf-cards td[data-label]::before {
        content: attr(data-label);
        display: inline-block; min-width: 90px;
        font-weight: bold; color: #4d4d4d; font-size: 12px;
    }
    table.pf-cards td[data-label="Part no"] { font-size: 16px; }
    table.pf-cards td:empty { display: none; }
    table.pf-cards tr.pf-group { border: 0; padding: 0; margin: 14px 0 6px; }
    table.pf-cards tr.InstallationNotesHidden { display: none; }
    .pf-vehicles .pf-select-cell { display: none; }
    tr.pf-row-link:hover td, tr.pf-row-link:focus-within td { box-shadow: none; }
}

/* ---- Print: just the vehicle and its parts ---- */
@media print {
    #header, #footer, .headerDivide, .skip-link, .pf-tabs, .pf-panel, .pf-vehicle-buttons, .pf-steps, h1.main, .modal { display: none !important; }
    body { background: #fff; }
    .pageWrapper { max-width: none; }
    .pf-vehicle-bar, .tableCaption { position: static; color: #000; background: #fff; border: 2px solid #000; }
    .pf-vehicle-label, .pf-sep { color: #000; }
    table.productTable tr, table.productTable td, .pf-stock-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a.pf-part { text-decoration: none; }
    tr { break-inside: avoid; }
}
