/* Public equipment search on the facet index (IndexSearch.cshtml). Builds on beta-search.css, which the
   public layout already loads (hero, sticky bar, result rows, SEO band, FAQ); this adds the sidebar. */

.idx-page { --idx-accent: #1b4f6b; --idx-muted: #5d6b73; --idx-rule: #dde3e7; --idx-on: #1b4f6b; }

.idx-page.is-loading .idx-results,
.idx-page.is-loading .idx-sidebar { opacity: .55; transition: opacity .15s; pointer-events: none; }

.idx-chips { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 8px; }
.idx-chip { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 4px;
            background: #eef3f6; color: var(--idx-accent); font-size: .85rem; text-decoration: none; }
.idx-chip:hover { background: #dfe9ef; }
.idx-clear-all { margin-left: auto; font-size: .9rem; }

.idx-main { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 24px; margin-top: 16px; align-items: start; }
.idx-filters-toggle { display: none; }

.idx-sidebar { display: grid; gap: 18px; font-size: .9rem; }
.idx-facet-title { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; font-size: .78rem; font-weight: 600;
                   text-transform: uppercase; letter-spacing: .06em; color: var(--idx-muted); }
.idx-clear { margin-left: auto; font-size: .8rem; text-transform: none; letter-spacing: 0; font-weight: 500; }
.idx-values { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.idx-values .idx-values { padding-left: 22px; }

.idx-value { display: flex; align-items: baseline; gap: 8px; padding: 3px 4px; border-radius: 4px; color: inherit; text-decoration: none; }
.idx-value:hover { background: #f1f5f7; }
.idx-value:focus-visible { outline: 2px solid var(--idx-accent); outline-offset: 1px; }
.idx-value.is-empty { color: var(--idx-muted); }
.idx-label { min-width: 0; overflow-wrap: anywhere; }
.idx-count { margin-left: auto; color: var(--idx-muted); font-variant-numeric: tabular-nums; }

.idx-check { flex: none; width: 14px; height: 14px; border: 1.5px solid #8a989f; border-radius: 3px; transform: translateY(2px); }
.idx-value.is-single .idx-check { border-radius: 50%; }
.idx-value.is-on .idx-check { background: var(--idx-on); border-color: var(--idx-on);
                              box-shadow: inset 0 0 0 2px #fff; }
.idx-value.is-on { font-weight: 600; }

.idx-heading > details > summary { list-style: none; cursor: pointer; display: flex; }
.idx-heading > details > summary::-webkit-details-marker { display: none; }
.idx-heading > details > summary > .idx-value { flex: 1; }
.idx-heading > details > summary::after { content: "\25B8"; padding: 3px 4px; color: var(--idx-muted); }
.idx-heading > details[open] > summary::after { content: "\25BE"; }

.idx-more > summary { cursor: pointer; color: var(--idx-accent); font-size: .85rem; padding: 3px 4px; }

.idx-range { display: flex; align-items: center; gap: 6px; }
.idx-range-input { width: 6.5em; padding: 3px 6px; border: 1px solid var(--idx-rule); border-radius: 4px; }
.idx-unit { color: var(--idx-muted); }
.idx-range-note { margin: 4px 0 0; color: var(--idx-muted); font-size: .8rem; }

.idx-results-header { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.idx-results-title { margin: 0; font-size: 1.25rem; }
.idx-results-note { color: var(--idx-muted); font-size: .9rem; }
.idx-empty { color: var(--idx-muted); }
.idx-units { margin-left: auto; display: inline-flex; border: 1px solid var(--idx-rule); border-radius: 4px; overflow: hidden; }
.idx-units-option { border: 0; background: #fff; padding: 3px 10px; font-size: .85rem; color: var(--idx-muted); }
.idx-units-option.is-on { background: var(--idx-accent); color: #fff; }
.idx-units-option:focus-visible { outline: 2px solid var(--idx-accent); outline-offset: -2px; }
.idx-more-wrap { display: flex; justify-content: center; margin: 16px 0; }
.js-idx-more.is-loading { opacity: .6; pointer-events: none; }

/* The filter sheet's own parts (phones only) and the facet title button, plain text on wide screens. */
.idx-dock, .idx-sheet-head, .idx-sheet-foot, .idx-sheet-only, .idx-facet-summary { display: none; }
.idx-facet-toggle { display: contents; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }

/* Phones: one floating Filters button; the sidebar becomes a full-screen sheet with the type switch and sort
   on top, every facet folded to its title and current choice, and a footer that returns to the results. */
@media (max-width: 767px) {
    .idx-main { grid-template-columns: minmax(0, 1fr); margin-top: 10px; }
    .idx-clear-all { margin-left: 0; }

    /* The top bar scrolls away (the floating button is the way back to the filters); its quote button
       repeats the header's Quote link; inputs at 16px so iOS does not zoom on focus. */
    #beta-search-root.beta-search-page.idx-page .idx-bar { position: relative; top: auto; }
    #beta-search-root.beta-search-page.idx-page .idx-bar .js-beta-search-request-quote { display: none; }
    #beta-search-root.beta-search-page.idx-page .beta-search-input,
    .idx-range-input { font-size: 16px; }
    #beta-search-root.beta-search-page.idx-page .beta-search-hero-copy h1 { font-size: 1.6rem; line-height: 1.12; letter-spacing: -.02em; }
    #beta-search-root.beta-search-page.idx-page .beta-search-hero-description { font-size: .92rem; }
    #beta-search-root.beta-search-page.idx-page .beta-search-shell { padding-bottom: 76px; }

    .idx-dock { display: flex; justify-content: center; position: fixed; left: 0; right: 0; z-index: 1040; pointer-events: none;
                bottom: max(14px, env(safe-area-inset-bottom)); }
    .idx-filters-toggle { pointer-events: auto; display: inline-flex; gap: 8px; align-items: center; min-height: 46px; padding: 0 22px;
                          border: 0; border-radius: 999px; background: var(--idx-accent); color: #fff; font-weight: 600; font-size: 1rem;
                          box-shadow: 0 6px 20px rgba(15, 23, 42, .28); }
    .idx-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
                 background: #fff; color: var(--idx-accent); font-size: .8rem; font-weight: 700; }

    .idx-sidebar-wrap { position: fixed; inset: 0; z-index: 1050; display: flex; flex-direction: column; background: #fff;
                        transform: translateY(100%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
    .idx-page.is-filters-open .idx-sidebar-wrap { transform: none; visibility: visible; transition: transform .22s ease; }
    .idx-page.is-filters-open .idx-dock { display: none; }
    html.idx-sheet-open, html.idx-sheet-open body { overflow: hidden; }

    .idx-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 16px;
                      border-bottom: 1px solid var(--idx-rule); }
    .idx-sheet-title { margin: 0; font-size: 1.1rem; font-weight: 700; }
    .idx-sheet-close { width: 44px; height: 44px; border: 0; background: none; font-size: 1.25rem; color: var(--idx-muted); }
    .idx-sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 16px; }
    .idx-sheet-foot { display: flex; align-items: center; gap: 12px; padding: 10px 16px max(10px, env(safe-area-inset-bottom));
                      border-top: 1px solid var(--idx-rule); }
    .idx-sheet-clear { padding: 10px 4px; }
    .idx-sheet-done { flex: 1; min-height: 46px; border: 0; border-radius: 6px; background: var(--idx-accent); color: #fff; font-weight: 600; font-size: 1rem; }
    .idx-page.is-loading .idx-sheet-done { opacity: .6; }

    .idx-sheet-only { display: block; }
    .idx-sidebar { gap: 0; font-size: 1rem; }
    .idx-facet { border-bottom: 1px solid var(--idx-rule); }
    /* The whole title row opens the facet (the script), with a chevron at the far right, after "Clear". */
    .idx-facet-title { margin: 0; align-items: center; gap: 0; font-size: .82rem; cursor: pointer; }
    .idx-facet-title::after { content: ""; order: 3; flex: none; width: 8px; height: 8px; margin: 0 4px 4px 14px;
                              border-right: 2px solid var(--idx-muted); border-bottom: 2px solid var(--idx-muted);
                              transform: rotate(45deg); transition: transform .15s; }
    .idx-facet.is-open > .idx-facet-title::after { transform: translateY(4px) rotate(-135deg); }
    .idx-facet-toggle { display: flex; flex: 1; min-width: 0; gap: 10px; min-height: 48px; padding: 0; border: 0;
                        background: none; text-align: left; align-items: center; cursor: pointer; }
    .idx-clear { order: 2; }
    .idx-facet-summary { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
                         color: var(--idx-on); text-transform: none; letter-spacing: 0; font-weight: 600; font-size: .9rem; }
    .idx-facet.is-open .idx-facet-summary { display: none; }
    .idx-clear { margin-left: 4px; padding: 12px 0 12px 8px; }
    .idx-facet:not(.is-open) > :not(.idx-facet-title) { display: none; }
    .idx-facet.is-open { padding-bottom: 12px; }

    .idx-value { padding: 9px 4px; align-items: center; }
    .idx-check { width: 18px; height: 18px; transform: none; }
    .idx-heading > details > summary::after { padding: 9px 6px; }
    .idx-more > summary { padding: 10px 4px; }
    .idx-range-input { flex: 1; min-width: 0; padding: 8px; }
}
