/**
 * Maxxis Tyre Size Filter — Frontend Styles
 * Version: 1.0.3
 * Matches reference screenshot — light card, tab underline style, grey column headers
 */

/* ===========================
   WIDGET WRAPPER
   =========================== */

div.maxxis-tsf-widget {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    color: #1a1a1a;
    box-sizing: border-box;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    overflow: hidden;
}

div.maxxis-tsf-widget *,
div.maxxis-tsf-widget *::before,
div.maxxis-tsf-widget *::after {
    box-sizing: border-box;
}

/* ===========================
   RIM SIZE TABS
   =========================== */

div.maxxis-tsf-widget .maxxis-tsf-rim-tabs {
    padding: 1.25rem 1.5rem 0;
    border-bottom: 2px solid #e8e8e8;
}

div.maxxis-tsf-widget .maxxis-tsf-tabs-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #999;
    margin-bottom: 0.75rem;
}

div.maxxis-tsf-widget .maxxis-tsf-tabs-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
}

div.maxxis-tsf-widget .maxxis-tsf-tab {
    flex: 1 1 0;
    min-width: 60px;
    text-align: center;
    padding: 0.65rem 0.75rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.2;
    display: block;
    text-decoration: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    bottom: -2px;
}

div.maxxis-tsf-widget .maxxis-tsf-tab:hover {
    color: #FF5400;
    background: transparent;
}

div.maxxis-tsf-widget .maxxis-tsf-tab.active {
    color: #FF5400 !important;
    font-weight: 700;
    border-bottom: 3px solid #FF5400;
    background: transparent;
}

/* ===========================
   BODY AREA
   =========================== */

div.maxxis-tsf-widget .maxxis-tsf-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

/* Rim label + count row */
div.maxxis-tsf-widget .maxxis-tsf-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

div.maxxis-tsf-widget .results-rim-label {
    font-size: 1.6rem;
    font-weight: 900;
    color: #FF5400;
    line-height: 1;
    letter-spacing: -0.02em;
}

div.maxxis-tsf-widget .results-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ===========================
   TABLE
   =========================== */

div.maxxis-tsf-widget .maxxis-tsf-table-wrap {
    overflow-x: auto;
    background: #fff;
}

div.maxxis-tsf-widget table.maxxis-tsf-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 0.9rem;
    background: #fff;
    margin: 0;
    padding: 0;
}

/* Fixed column widths */
div.maxxis-tsf-widget table.maxxis-tsf-table col.col-img    { width: 90px;  }
div.maxxis-tsf-widget table.maxxis-tsf-table col.col-series { width: 160px; }
div.maxxis-tsf-widget table.maxxis-tsf-table col.col-part   { width: 185px; }
div.maxxis-tsf-widget table.maxxis-tsf-table col.col-size   { width: 160px; }
div.maxxis-tsf-widget table.maxxis-tsf-table col.col-ply    { width: 90px;  }
div.maxxis-tsf-widget table.maxxis-tsf-table col.col-type   { width: 110px; }
div.maxxis-tsf-widget table.maxxis-tsf-table col.col-price  { width: 120px; }

/* Column headers — grey, small caps, no background */
div.maxxis-tsf-widget table.maxxis-tsf-table thead tr {
    background: transparent !important;
    border-bottom: 1px solid #e8e8e8;
}

div.maxxis-tsf-widget table.maxxis-tsf-table thead th {
    padding: 0.5rem 1rem;
    color: #aaa !important;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: left;
    white-space: nowrap;
    border: none;
    background: transparent !important;
    line-height: 1.2;
}

div.maxxis-tsf-widget table.maxxis-tsf-table thead th.col-price {
    text-align: right;
}

div.maxxis-tsf-widget table.maxxis-tsf-table thead th.col-img {
    text-align: center;
}

/* Body rows */
div.maxxis-tsf-widget table.maxxis-tsf-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s ease;
    background: #fff;
}

div.maxxis-tsf-widget table.maxxis-tsf-table tbody tr:last-child {
    border-bottom: none;
}

div.maxxis-tsf-widget table.maxxis-tsf-table tbody tr:hover {
    background: #fffaf8 !important;
}

div.maxxis-tsf-widget table.maxxis-tsf-table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    color: #222;
    border: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===========================
   COLUMN STYLES
   =========================== */

div.maxxis-tsf-widget table.maxxis-tsf-table td.col-img {
    text-align: center;
    padding: 0.5rem;
}

div.maxxis-tsf-widget table.maxxis-tsf-table td.col-img img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Series — bold */
div.maxxis-tsf-widget table.maxxis-tsf-table td.col-series {
    font-weight: 700;
    color: #111;
}

/* Part # — plain text, monospace feel */
div.maxxis-tsf-widget table.maxxis-tsf-table td.col-part {
    white-space: nowrap;
}

div.maxxis-tsf-widget .maxxis-tsf-part {
    font-size: 0.88rem;
    font-weight: 400;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Size */
div.maxxis-tsf-widget table.maxxis-tsf-table td.col-size {
    color: #333;
}

/* Ply */
div.maxxis-tsf-widget table.maxxis-tsf-table td.col-ply {
    white-space: nowrap;
    color: #333;
}

/* Type badges — outlined pill */
div.maxxis-tsf-widget table.maxxis-tsf-table td.col-type {
    white-space: nowrap;
}

div.maxxis-tsf-widget .maxxis-tsf-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

div.maxxis-tsf-widget .maxxis-tsf-badge.badge-RADIAL {
    background: transparent;
    color: #CC4400;
    border: 1.5px solid #FF7733;
}

div.maxxis-tsf-widget .maxxis-tsf-badge.badge-BIAS {
    background: transparent;
    color: #555;
    border: 1.5px solid #bbb;
}

/* Price — black bold, right-aligned */
div.maxxis-tsf-widget table.maxxis-tsf-table td.col-price {
    text-align: right;
    white-space: nowrap;
}

div.maxxis-tsf-widget .maxxis-tsf-price {
    font-size: 1rem;
    font-weight: 700;
    color: #111 !important;
}

/* ===========================
   LOADING STATE
   =========================== */

div.maxxis-tsf-widget .maxxis-tsf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1rem;
    color: #aaa;
    font-size: 0.9rem;
}

div.maxxis-tsf-widget .maxxis-tsf-spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid #eee;
    border-top-color: #FF5400;
    border-radius: 50%;
    animation: maxxis-tsf-spin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes maxxis-tsf-spin {
    to { transform: rotate(360deg); }
}

/* ===========================
   EMPTY / NOTICE
   =========================== */

div.maxxis-tsf-widget .maxxis-tsf-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
}

div.maxxis-tsf-widget .maxxis-tsf-notice {
    margin: 1.5rem;
    background: #fff8e1;
    border: 1px solid #ffd600;
    border-left: 4px solid #ffa000;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    color: #555;
}

div.maxxis-tsf-widget .maxxis-tsf-notice code {
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 3px;
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 900px) {
    div.maxxis-tsf-widget table.maxxis-tsf-table {
        font-size: 0.85rem;
    }
    div.maxxis-tsf-widget table.maxxis-tsf-table td,
    div.maxxis-tsf-widget table.maxxis-tsf-table th {
        padding: 0.6rem 0.6rem;
    }
}

@media (max-width: 640px) {
    div.maxxis-tsf-widget table.maxxis-tsf-table td.col-ply,
    div.maxxis-tsf-widget table.maxxis-tsf-table th.col-ply,
    div.maxxis-tsf-widget table.maxxis-tsf-table td.col-type,
    div.maxxis-tsf-widget table.maxxis-tsf-table th.col-type {
        display: none;
    }
}
