/* TRIKON Search — search bar + layer (Doofinder-style card grid + facets)
 * Tokens follow DESIGN.md ("The Specialist's Counter"):
 * single Workshop Teal accent, tinted neutrals, flat-at-rest,
 * teal-tinted shadows, motion only on color/opacity/shadow.
 */

.trikonsearch {
    --ts-paper: #fafafa;
    --ts-ink: #14222a;
    --ts-muted: #6c7479;
    --ts-rule: #e6e9eb;
    --ts-accent: #04697e;
    --ts-accent-hover: #035566;
    --ts-tint: rgba(4, 105, 126, 0.08);
    --ts-focus-ring: rgba(4, 105, 126, 0.18);
    --ts-radius-sm: 4px;
    --ts-radius-lg: 8px;
    --ts-shadow-layer: 0 12px 32px rgba(10, 42, 51, 0.18);
    position: relative;
    width: 100%;
    max-width: 560px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Center the search field in the header (between logo and account block).
   .header-top is position:relative in the theme. */
@media (min-width: 768px) {
    .header-top .trikonsearch {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: clamp(340px, 46vw, 760px);
        max-width: none;
        /* above the dark category navbar, which has its own z-index
           inside the #header stacking context */
        z-index: 1000;
    }

    .trikonsearch__input {
        padding: 12px 14px;
        font-size: 15px;
    }
}

/* ---------- Input ---------- */

.trikonsearch__form {
    display: flex;
    align-items: center;
    background: var(--ts-paper);
    /* prominent 2px brand border so the search reads as the primary entry */
    border: 2px solid var(--ts-accent);
    border-radius: var(--ts-radius-sm);
    transition: box-shadow 0.15s ease-out;
}

.trikonsearch--open .trikonsearch__form,
.trikonsearch__form:focus-within {
    box-shadow: 0 0 0 3px var(--ts-focus-ring);
}

.trikonsearch__input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ts-ink);
}

.trikonsearch__input::placeholder {
    color: var(--ts-muted);
}

.trikonsearch__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

/* Teal magnifier button on the right edge of the field */
.trikonsearch__submit {
    border: 0;
    background: var(--ts-accent);
    color: var(--ts-paper);
    padding: 11px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    align-self: stretch;
    /* matches the form radius minus the 2px border */
    border-radius: 0 2px 2px 0;
    transition: background-color 0.15s ease-out;
}

.trikonsearch__submit:hover {
    background: var(--ts-accent-hover);
    color: var(--ts-paper);
}

.trikonsearch__submit:focus-visible {
    outline: 2px solid var(--ts-accent);
    outline-offset: 2px;
}

/* ---------- Layer: top panel over dimmed page (Doofinder-style) ---------- */

/* position:fixed breaks under a transformed ancestor, so the centering
   transform is dropped while the layer is open (the original field is
   hidden behind the overlay anyway) */
@media (min-width: 768px) {
    .header-top .trikonsearch--open {
        transform: none;
    }
}

.trikonsearch--open {
    z-index: 1060;
}

.trikonsearch--open .trikonsearch__form {
    position: fixed;
    top: 12px;
    left: 24px;
    right: 76px;
    width: auto;
    max-width: none;
    z-index: 1091;
    background: var(--ts-paper);
}

/* The layer itself is the dim backdrop; the panel carries the content */
.trikonsearch__layer {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 42, 51, 0.4);
    z-index: 1080;
    overflow-y: auto;
}

.trikonsearch__panel {
    background: var(--ts-paper);
    width: 100%;
    padding-top: 64px;
    box-shadow: 0 12px 32px rgba(10, 42, 51, 0.18);
}

.trikonsearch__layer-inner {
    position: relative;
    max-width: none;
    margin: 0;
    padding: 6px 24px 28px;
}

/* Two columns: facet sidebar left, results right (desktop) */
.trikonsearch__body {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.trikonsearch__aside {
    width: 250px;
    flex-shrink: 0;
}

.trikonsearch__main {
    flex: 1;
    min-width: 0;
}

.trikonsearch__facet-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ts-ink);
    margin: 16px 0 6px;
}

.trikonsearch__aside-section {
    margin-top: 8px;
}

.trikonsearch__aside-link {
    display: block;
    padding: 4px 0;
    font-size: 13px;
    color: var(--ts-ink);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trikonsearch__aside-link:hover {
    color: var(--ts-accent);
    text-decoration: none;
}

.trikonsearch__aside-clear {
    border: 0;
    background: transparent;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ts-accent);
    cursor: pointer;
}

.trikonsearch__aside-clear:hover {
    color: var(--ts-accent-hover);
}

/* ---------- Recent search chips (empty-query state) ---------- */

.trikonsearch__recent-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
}

.trikonsearch__recent-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ts-rule);
    background: var(--ts-paper);
    border-radius: 20px;
    overflow: hidden;
}

.trikonsearch__recent-term {
    border: 0;
    background: transparent;
    padding: 0.4rem 0.2rem 0.4rem 0.9rem;
    font-size: 12px;
    font-weight: 500;
    color: var(--ts-ink);
    cursor: pointer;
}

.trikonsearch__recent-term:hover {
    color: var(--ts-accent);
}

.trikonsearch__recent-remove {
    border: 0;
    background: transparent;
    padding: 0.3rem 0.7rem 0.3rem 0.3rem;
    font-size: 15px;
    line-height: 1;
    color: var(--ts-muted);
    cursor: pointer;
}

.trikonsearch__recent-remove:hover {
    color: var(--ts-accent);
}

.trikonsearch__recent-clear {
    border: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--ts-accent);
    cursor: pointer;
    padding: 6px 10px;
}

.trikonsearch__recent-clear:hover {
    color: var(--ts-accent-hover);
}

/* ---------- Popular searches (empty-query state) ---------- */

.trikonsearch__popular {
    margin-top: 14px;
    max-width: 420px;
}

.trikonsearch__popular .trikonsearch__section-title {
    margin-bottom: 4px;
}

.trikonsearch__popular-term.trikonsearch__recent-term {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 6px;
    font-size: 14px;
    font-weight: 400;
    color: var(--ts-ink);
    cursor: pointer;
    border-radius: var(--ts-radius-sm);
    transition: background-color 0.15s ease-out;
}

.trikonsearch__popular-term.trikonsearch__recent-term:hover {
    background: var(--ts-tint);
    color: var(--ts-ink);
}

.trikonsearch__popular-term svg {
    color: var(--ts-muted);
    flex-shrink: 0;
}

/* ---------- Shop logo in the open panel ---------- */

.trikonsearch__logo {
    display: none;
}

@media (min-width: 768px) {
    .trikonsearch--open .trikonsearch__logo {
        display: block;
        position: fixed;
        top: 14px;
        left: 24px;
        height: 40px;
        width: auto;
        z-index: 1091;
    }

    .trikonsearch--haslogo.trikonsearch--open .trikonsearch__form {
        left: 210px;
    }
}

.trikonsearch__close {
    display: block;
    position: fixed;
    top: 14px;
    right: 16px;
    border: 0;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    color: var(--ts-muted);
    cursor: pointer;
    z-index: 1092;
    padding: 6px 10px;
    transition: color 0.15s ease-out;
}

.trikonsearch__close:hover {
    color: var(--ts-ink);
}

.trikonsearch__close:focus-visible {
    outline: 2px solid var(--ts-accent);
    outline-offset: 2px;
}

.trikonsearch__section-title {
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ts-muted);
    margin-bottom: 6px;
}

/* ---------- Recent searches ---------- */

.trikonsearch__recents {
    margin-bottom: 10px;
}

.trikonsearch__recent {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 9px 8px;
    border-radius: var(--ts-radius-sm);
    font-size: 14px;
    color: var(--ts-ink);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease-out;
}

.trikonsearch__recent:hover {
    background: var(--ts-tint);
}

.trikonsearch__recent:focus-visible {
    outline: 2px solid var(--ts-accent);
    outline-offset: -2px;
}

.trikonsearch__recent svg {
    color: var(--ts-muted);
    flex-shrink: 0;
}

.trikonsearch__recent span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Suggestions / correction ---------- */

.trikonsearch__suggestions {
    margin-bottom: 10px;
}

.trikonsearch__suggestion {
    display: inline-block;
    border: 1px solid var(--ts-rule);
    background: var(--ts-paper);
    border-radius: 20px;
    padding: 0.4rem 0.9rem;
    margin: 2px 4px 2px 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ts-muted);
    cursor: pointer;
    transition: background-color 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
}

.trikonsearch__suggestion:hover {
    background: var(--ts-tint);
    border-color: var(--ts-accent);
    color: var(--ts-accent);
}

.trikonsearch__suggestion:focus-visible {
    outline: 2px solid var(--ts-accent);
    outline-offset: 2px;
}

.trikonsearch__correction {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ts-muted);
}

.trikonsearch__correction a {
    color: var(--ts-accent);
    font-weight: 600;
}

.trikonsearch__correction a:hover {
    color: var(--ts-accent-hover);
}

/* ---------- Brand pills ---------- */

.trikonsearch__brands {
    margin-bottom: 12px;
}

.trikonsearch__brand-pill {
    display: inline-block;
    border: 1px solid var(--ts-rule);
    background: var(--ts-paper);
    border-radius: 20px;
    padding: 0.45rem 1rem;
    margin: 2px 6px 2px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ts-ink);
    cursor: pointer;
    transition: background-color 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
}

.trikonsearch__brand-pill:hover {
    background: var(--ts-tint);
    border-color: var(--ts-accent);
    color: var(--ts-accent);
}

.trikonsearch__brand-pill--active {
    background: var(--ts-accent);
    border-color: var(--ts-accent);
    color: var(--ts-paper);
}

.trikonsearch__brand-pill--active:hover {
    background: var(--ts-accent-hover);
    color: var(--ts-paper);
}

.trikonsearch__brand-pill:focus-visible {
    outline: 2px solid var(--ts-accent);
    outline-offset: 2px;
}

/* ---------- Results head ---------- */

.trikonsearch__results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.trikonsearch__count {
    font-size: 14px;
    font-weight: 600;
    color: var(--ts-ink);
}

.trikonsearch__head-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trikonsearch__sort {
    font-size: 12px;
    font-weight: 500;
    color: var(--ts-muted);
    margin: 0;
}

.trikonsearch__sort-select {
    border: 0;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: var(--ts-ink);
    cursor: pointer;
    padding: 4px 2px;
}

.trikonsearch__sort-select:focus-visible {
    outline: 2px solid var(--ts-accent);
    outline-offset: 2px;
}

.trikonsearch__showall {
    font-size: 13px;
    font-weight: 600;
    color: var(--ts-accent);
    text-decoration: none;
    white-space: nowrap;
}

.trikonsearch__showall:hover {
    color: var(--ts-accent-hover);
    text-decoration: none;
}

/* ---------- Product card grid ---------- */

.trikonsearch__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 768px) {
    .trikonsearch__grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }
}

.trikonsearch__card {
    position: relative;
    border: 1px solid var(--ts-rule);
    border-radius: var(--ts-radius-lg);
    background: var(--ts-paper);
    padding: 8px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease-out, border-color 0.15s ease-out;
}

.trikonsearch__card:hover {
    border-color: var(--ts-accent);
    box-shadow: 0 2px 12px rgba(4, 105, 126, 0.08);
}

.trikonsearch__badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--ts-accent);
    color: var(--ts-paper);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 4px 7px;
    border-radius: var(--ts-radius-sm);
    z-index: 1;
}

.trikonsearch__card-link {
    display: block;
    text-decoration: none;
    color: var(--ts-ink);
    flex: 1;
    border-radius: var(--ts-radius-sm);
}

.trikonsearch__card-link:hover {
    text-decoration: none;
    color: var(--ts-ink);
}

.trikonsearch__card-link:focus-visible,
.trikonsearch__item--active.trikonsearch__card-link {
    outline: 2px solid var(--ts-accent);
    outline-offset: 2px;
}

.trikonsearch__card-img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    /* no frame: product photos sit directly on the card.
       NOTE: no mix-blend-mode here — it breaks compositing inside the
       fixed-position panel (images render invisible in Chrome) */
    background: transparent;
    border-radius: 0;
}

.trikonsearch__card-img--empty {
    display: block;
    background: #f2f4f5;
    border-radius: var(--ts-radius-sm);
}

.trikonsearch__card-name {
    display: block;
    font-size: 13px;
    line-height: 1.35;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.7em;
}

.trikonsearch__card-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    margin-top: 8px;
}

.trikonsearch__card-prices {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.trikonsearch__card-prices del {
    color: var(--ts-muted);
    font-size: 12px;
    font-weight: 400;
}

/* Final price carries the brand color (Workshop Teal price emphasis) */
.trikonsearch__card-prices strong {
    color: var(--ts-accent);
    font-size: 16px;
    font-weight: 700;
}

.trikonsearch__cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: var(--ts-accent);
    color: var(--ts-paper);
    border-radius: var(--ts-radius-sm);
    text-decoration: none;
    transition: background-color 0.15s ease-out;
}

.trikonsearch__cart-btn:hover {
    background: var(--ts-accent-hover);
    color: var(--ts-paper);
}

.trikonsearch__cart-btn:focus-visible {
    outline: 2px solid var(--ts-accent);
    outline-offset: 2px;
}

/* ---------- Category / page chips ---------- */

.trikonsearch__chips {
    margin-top: 12px;
}

.trikonsearch__chip {
    display: inline-block;
    border: 1px solid var(--ts-rule);
    background: var(--ts-paper);
    border-radius: 20px;
    padding: 0.4rem 0.9rem;
    margin: 2px 4px 2px 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--ts-muted);
    text-decoration: none;
    transition: background-color 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
}

.trikonsearch__chip:hover {
    background: var(--ts-tint);
    border-color: var(--ts-accent);
    color: var(--ts-accent);
    text-decoration: none;
}

/* ---------- Empty / error / highlight ---------- */

.trikonsearch__empty {
    margin: 8px 0;
    color: var(--ts-muted);
    font-size: 14px;
    line-height: 1.5;
}

.trikonsearch mark {
    background: rgba(4, 105, 126, 0.12);
    color: inherit;
    font-weight: 600;
    padding: 0 1px;
    border-radius: 2px;
}

/* ---------- Filter button ---------- */

.trikonsearch__filter-btn {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: var(--ts-accent);
    color: var(--ts-paper);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(10, 42, 51, 0.25);
    z-index: 1091;
    transition: background-color 0.15s ease-out;
}

.trikonsearch__filter-btn:hover {
    background: var(--ts-accent-hover);
}

.trikonsearch__filter-btn:focus-visible {
    outline: 2px solid var(--ts-accent);
    outline-offset: 2px;
}

.trikonsearch__filter-count {
    background: var(--ts-paper);
    color: var(--ts-accent);
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 4px;
}

/* ---------- Filter sheet ---------- */

.trikonsearch__sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 42, 51, 0.4);
    /* above the filter FAB (1091) */
    z-index: 1094;
}

.trikonsearch__sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 auto;
    max-width: 560px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    background: var(--ts-paper);
    border-radius: 12px 12px 0 0;
    z-index: 1095;
    box-shadow: 0 -8px 30px rgba(10, 42, 51, 0.25);
}

.trikonsearch__sheet-handle {
    width: 56px;
    height: 4px;
    border-radius: 2px;
    background: var(--ts-rule);
    margin: 10px auto 0;
}

.trikonsearch__sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ts-muted);
}

.trikonsearch__sheet-close {
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: var(--ts-ink);
    cursor: pointer;
    padding: 6px 10px;
}

.trikonsearch__sheet-close:focus-visible {
    outline: 2px solid var(--ts-accent);
    outline-offset: 2px;
}

.trikonsearch__sheet-body {
    overflow-y: auto;
    padding: 4px 16px 16px;
}

.trikonsearch__sheet-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ts-ink);
    margin: 14px 0 8px;
}

.trikonsearch__facet {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    margin: 0;
    font-weight: 400;
    cursor: pointer;
}

.trikonsearch__facet input {
    width: 20px;
    height: 20px;
    accent-color: var(--ts-accent);
    flex-shrink: 0;
}

.trikonsearch__facet-name {
    flex: 1;
    font-size: 14px;
    color: var(--ts-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* theme label styles right-align text inside labels */
    text-align: left;
}

.trikonsearch__facet-count {
    font-size: 13px;
    color: var(--ts-muted);
}

.trikonsearch__see-more {
    display: block;
    margin: 4px auto 0;
    border: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--ts-ink);
    cursor: pointer;
    padding: 8px 12px;
}

.trikonsearch__see-more:hover {
    color: var(--ts-accent);
}

/* ---------- Price range slider ---------- */

.trikonsearch__range {
    padding: 4px 8px 0;
}

.trikonsearch__range-chips {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.trikonsearch__range-chip {
    background: var(--ts-accent);
    color: var(--ts-paper);
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--ts-radius-sm);
}

.trikonsearch__range-track {
    position: relative;
    height: 28px;
}

.trikonsearch__range-track::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 2px;
    background: var(--ts-rule);
}

.trikonsearch__range-fill {
    position: absolute;
    top: 12px;
    height: 4px;
    border-radius: 2px;
    background: var(--ts-accent);
}

.trikonsearch__range-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 28px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
}

.trikonsearch__range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ts-paper);
    border: 2px solid var(--ts-accent);
    cursor: pointer;
    margin-top: 2px;
}

.trikonsearch__range-input::-moz-range-thumb {
    pointer-events: auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ts-paper);
    border: 2px solid var(--ts-accent);
    cursor: pointer;
}

.trikonsearch__range-input:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px var(--ts-focus-ring);
}

.trikonsearch__range-input:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 3px var(--ts-focus-ring);
}

.trikonsearch__range-scale {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--ts-muted);
    margin-top: 4px;
}

/* ---------- Sheet footer ---------- */

.trikonsearch__sheet-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--ts-rule);
}

.trikonsearch__sheet-clear {
    border: 0;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--ts-accent);
    cursor: pointer;
    padding: 11px 12px;
}

.trikonsearch__sheet-clear:hover {
    color: var(--ts-accent-hover);
}

.trikonsearch__sheet-clear:focus-visible {
    outline: 2px solid var(--ts-accent);
    outline-offset: 2px;
}

.trikonsearch__sheet-apply {
    border: 0;
    background: var(--ts-accent);
    color: var(--ts-paper);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: var(--ts-radius-sm);
    cursor: pointer;
    transition: background-color 0.15s ease-out;
}

.trikonsearch__sheet-apply:hover {
    background: var(--ts-accent-hover);
}

.trikonsearch__sheet-apply:focus-visible {
    outline: 2px solid var(--ts-accent);
    outline-offset: 2px;
}

/* ---------- Viewport visibility rules ---------- */

@media (min-width: 768px) {
    /* Desktop uses the sidebar instead of FAB/sheet, pills and chips */
    .trikonsearch__filter-btn,
    .trikonsearch__brands,
    .trikonsearch__main .trikonsearch__chips {
        display: none;
    }
}

/* ---------- Mobile: fullscreen layer ---------- */

@media (max-width: 767px) {
    .trikonsearch__aside {
        display: none;
    }

    .trikonsearch__layer {
        background: var(--ts-paper);
    }

    .trikonsearch__panel {
        min-height: 100%;
        box-shadow: none;
        padding-top: 64px;
    }

    .header-top .trikonsearch {
        float: none;
        clear: both;
        width: auto;
        max-width: none;
        margin: 6px 10px 8px;
    }

    .trikonsearch__input {
        /* 16px minimum prevents iOS zoom-on-focus */
        font-size: 16px;
        padding: 12px 14px;
    }

    .trikonsearch__submit {
        padding: 12px 16px;
    }

    .trikonsearch--open .trikonsearch__form {
        top: 8px;
        left: 8px;
        right: 64px; /* leave room for the close button */
        width: auto;
        margin-left: 0;
    }

    .trikonsearch__close {
        top: 10px;
        right: 8px;
        /* >=44px effective touch target */
        padding: 8px 12px;
    }

    .trikonsearch__recent {
        padding: 12px 8px; /* >=44px touch target */
    }

    .trikonsearch__results-head {
        align-items: flex-start;
    }

    .trikonsearch__head-actions {
        width: 100%;
        justify-content: space-between;
    }

    .trikonsearch__layer-inner {
        padding: 6px 12px 90px; /* room for the filter FAB */
    }

    .trikonsearch__recent-term,
    .trikonsearch__recent-remove {
        /* comfortable touch targets in the chips */
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
    }
}

body.trikonsearch-noscroll {
    overflow: hidden;
}

/* While the search is open, lift the header stacking context above
   external floating widgets (live chat bubble etc.) */
body.trikonsearch-noscroll #header {
    z-index: 2147483000;
    position: relative;
}

/* TRIKON chat (trikonchat module) disappears behind the open search */
body.trikonsearch-noscroll .trikon-chat-launcher,
body.trikonsearch-noscroll .trikon-chat-panel {
    visibility: hidden;
}

/* Floating filter button disappears while the sheet is expanded */
.trikonsearch__layer.trikonsearch--sheet-open .trikonsearch__filter-btn {
    display: none;
}

/* ---------- Results page ---------- */

.trikonsearch-results__count {
    color: #6c7479;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 6px;
}

.trikonsearch-results__correction {
    margin-bottom: 14px;
    color: #6c7479;
}

.trikonsearch-results__correction a {
    color: #04697e;
    font-weight: 600;
}

.trikonsearch-results__chips {
    margin-bottom: 10px;
}

.trikonsearch-results__chips:last-of-type {
    margin-bottom: 18px;
}

.trikonsearch-results__chips-title {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #6c7479;
    margin-right: 8px;
}

.trikonsearch-results__chip {
    display: inline-block;
    border: 1px solid #e6e9eb;
    background: #fafafa;
    border-radius: 20px;
    padding: 0.4rem 0.9rem;
    margin: 2px 4px 2px 0;
    font-size: 12px;
    font-weight: 500;
    color: #14222a;
    text-decoration: none;
    transition: background-color 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
}

.trikonsearch-results__chip:hover {
    background: rgba(4, 105, 126, 0.08);
    border-color: #04697e;
    color: #04697e;
    text-decoration: none;
}

.trikonsearch-results__chip:focus-visible {
    outline: 2px solid #04697e;
    outline-offset: 2px;
}

.trikonsearch-results__toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.trikonsearch-results__sortform select {
    background: #fafafa;
    border: 1px solid #e6e9eb;
    border-radius: 4px;
    padding: 8px 12px;
    color: #14222a;
    font-size: 14px;
}

.trikonsearch-results__sortform select:focus-visible {
    outline: 2px solid #04697e;
    outline-offset: 2px;
}

/* Theme miniatures come with col-xs-12 (full width) when rendered outside
   a listing context. The grid overrides that. */
.trikonsearch-results__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}

.trikonsearch-results__grid > * {
    width: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
    float: none !important;
}

.trikonsearch-results__grid img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 767px) {
    .trikonsearch-results__grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
}

.trikonsearch-results__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    margin: 32px 0;
}

.trikonsearch-results__pagelink {
    font-weight: 600;
    color: #04697e;
    padding: 11px 16px;
    border: 1px solid #e6e9eb;
    border-radius: 4px;
    background: #fafafa;
    text-decoration: none;
    transition: background-color 0.15s ease-out, border-color 0.15s ease-out;
}

.trikonsearch-results__pagelink:hover {
    background: rgba(4, 105, 126, 0.08);
    border-color: #04697e;
    color: #04697e;
    text-decoration: none;
}

.trikonsearch-results__pageinfo {
    color: #6c7479;
    font-size: 12px;
    font-weight: 500;
}

.trikonsearch-results__empty {
    margin: 22px 0;
    font-size: 14px;
    color: #6c7479;
}

/* ---------- Screen reader status / empty-state rails / sentinel ---------- */

.trikonsearch__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.trikonsearch__empty-cols {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.trikonsearch__empty-rails {
    flex: 1;
    min-width: 0;
}

.trikonsearch__empty-rails .trikonsearch__section-title {
    margin-top: 14px;
}

.trikonsearch__grid--rail {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.trikonsearch__sentinel {
    height: 1px;
}

@media (max-width: 767px) {
    .trikonsearch__empty-cols {
        flex-direction: column;
        gap: 12px;
    }

    .trikonsearch__popular {
        width: 100%;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .trikonsearch *,
    .trikonsearch-results__pagelink {
        transition: none !important;
    }
}
