/* TORO247 - the day lists' filter bar and filter modal in the torotips form (TORO-SHAPES.md).
   js/toro-filters.js: the bar over football's match lists (#S1#, #S1_TD#, _T3, _D1 ...) in place of
   the market tabs (#pre-mkt-tabs, kept in the DOM, hidden here), and its <dialog>. The shapes are
   torotips.com's .filters (a leaning card panel, radius 15px), its select-like fields and teal
   FILTERS button, and its filter modal (the leaning "Filter by" group, chips, Reset / Submit, Close). */

/* ---- The bar --------------------------------------------------------------------------------- */
html.toro #page-sport-detail .tf-bar ~ #pre-mkt-tabs { display: none; }
html.toro .tf-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0 0 18px;
    padding: 16px 20px;
    background: var(--t-card);
    border-radius: 15px;
    transform: var(--t-lean);
}
html.toro .tf-bar[hidden] { display: none; }
html.toro .tf-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 460px;
    height: 44px;
    padding: 0 16px;
    background: var(--t-raised);
    border: 0;
    border-radius: 5px;
    color: var(--t-text);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
html.toro .tf-k { flex: none; color: var(--t-muted); font-weight: 600; }
html.toro .tf-k::after { content: ':'; }
html.toro .tf-v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.toro .tf-field svg { flex: none; margin-left: 14px; color: var(--t-text-2); }
html.toro .tf-field:hover { box-shadow: var(--t-ring); }
html.toro .tf-go {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    height: 44px;
    margin-left: auto;
    padding: 0 18px;
    background: var(--t-teal);
    border: 0;
    border-radius: 5px;
    color: var(--t-on-teal);
    font: inherit;
    font-size: 15px;
    font-style: italic;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
}
html.toro .tf-go:hover { background: var(--t-teal-neon); }
html.toro :is(.tf-field, .tf-go, .tf-chip, .tf-close, .tf-dlg .t-btn):focus-visible { outline: 2px solid var(--t-teal-neon); outline-offset: 2px; }

/* ---- The modal --------------------------------------------------------------------------------- */
html.toro .tf-dlg {
    width: 460px;
    max-width: calc(100% - 32px);
    margin: auto;   /* style.css's reset zeroes the dialog's own centring */
    padding: 0;
    background: var(--t-card);
    border: 0;
    border-radius: 12px;
    color: var(--t-text);
    font-family: var(--t-font);
}
html.toro .tf-dlg::backdrop { background: rgba(var(--bg-deep-rgb), .8); }
html.toro .tf-in { display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 36px 40px 22px; }
/* "Filter by [Tips]": the leaning darker group, the title teal, the one group's name the teal tab. */
html.toro .tf-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    width: 100%;
    padding: 8px 16px;
    background: var(--t-bg);
    border-radius: 10px;
    transform: var(--t-lean);
}
html.toro .tf-head .t-h { color: var(--t-teal); font-size: 18px; }
html.toro .tf-head .t-tab { cursor: default; }
html.toro .tf-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
html.toro .tf-chip { display: inline-flex; align-items: center; min-height: 44px; background: transparent; font-family: var(--t-font); cursor: pointer; }
html.toro .tf-chip:hover { background: rgba(var(--t-teal-rgb), .12); }
html.toro .tf-chip[aria-pressed="true"] { background: var(--t-teal); color: var(--t-on-teal); }
html.toro .tf-acts { display: flex; justify-content: center; gap: 18px; }
html.toro .tf-dlg .t-btn { min-width: 120px; height: 44px; font-size: 15px; }
html.toro .tf-reset { background: transparent; border: 1px solid var(--t-teal); color: var(--t-teal); }
html.toro .tf-reset:hover { color: var(--t-teal-neon); border-color: var(--t-teal-neon); }
html.toro .tf-close {
    min-height: 44px;
    padding: 0 16px;
    background: none;
    border: 0;
    color: var(--t-text-2);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
html.toro .tf-close:hover { color: var(--t-text); }

/* ---- Phone: the bar's own pieces, the modal a bottom sheet -------------------------------------- */
@media (max-width: 980px) {
    html.toro .tf-bar { gap: 10px; padding: 10px 15px; margin-bottom: 14px; }
    html.toro .tf-field { flex: 1 1 auto; max-width: none; padding: 0 12px; font-size: 14px; }
    html.toro .tf-field svg { margin-left: auto; }
    html.toro .tf-go { padding: 0 14px; font-size: 14px; }
    html.toro .tf-dlg {
        width: 100%;
        max-width: none;
        max-height: 85dvh;
        margin: auto 0 0;
        border-radius: 12px 12px 0 0;
    }
    html.toro .tf-in { gap: 22px; padding: 26px 18px calc(12px + env(safe-area-inset-bottom)); }
    html.toro .tf-chips { gap: 8px; }
    html.toro .tf-acts { width: 100%; }
    html.toro .tf-dlg .t-btn { flex: 1 1 0; }
}
