/* =====================
   Header quick search — icon lives inside the pill and stays put;
   the whole thing (field + results) is ONE growing card, not two
   separate floating boxes.
   ===================== */
.thermo-qs-root {
    position: relative;
    top: -2px;
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

/* Idle: a 40x40 circle showing just the icon. Open: grows into a
   single rounded card that holds the input row AND the results
   below it — overflow:hidden clips the input/close during the width
   animation, height is simply auto so the card grows downward as
   results appear/disappear. */
.thermo-qs-bar {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    width: 36px;
    max-height: 36px;
    background: transparent;
    border-radius: 50px;
    overflow: hidden;
    z-index: 100000;
    transition: width 0.22s ease, max-height 0.22s ease, border-radius 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.thermo-qs-root.is-open .thermo-qs-bar {
    width: min(330px, calc(100vw - 40px));
    max-height: 2000px;
    background: #FAFAFA;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(21, 34, 49, 0.14);
}

.thermo-qs-input-row {
    display: flex;
    align-items: center;
    height: 40px;
    flex-shrink: 0;
}

.thermo-qs-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: #FFFFFF !important;
    box-shadow: none !important;
    border-radius: 50%;
    cursor: pointer;
    color: #152231;
    flex-shrink: 0;
    transition: color 0.18s ease, background 0.18s ease;
}

/* Active state: teal icon + same FAFAFA bg as the rest of the open bar. */
.thermo-qs-root.is-open .thermo-qs-icon-btn {
    color: #2FAA94;
    background: #FAFAFA !important;
}

.thermo-qs-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    font-family: 'ThermoFont', sans-serif;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: -0.12px;
    color: #152231;
}

.thermo-qs-root.is-open .thermo-qs-input {
    background: #FAFAFA;
}

.thermo-qs-input:focus,
.thermo-qs-input:focus-visible {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.thermo-qs-input::placeholder {
    color: rgba(21, 34, 49, 0.35);
}

.thermo-qs-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    margin-right: 4px;
    border: none;
    background: #FAFAFA !important;
    box-shadow: none !important;
    border-radius: 50%;
    color: #152231;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.thermo-qs-close:hover {
    opacity: 0.6;
}

/* =====================
   Results — same box as the input row now, just the part below it
   ===================== */
.thermo-qs-results {
    padding: 0 12px 12px;
    max-height: min(520px, calc(100vh - 170px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* .thermo-qs-results and .thermo-qs-viewall set their own `display`,
   which (being an author rule) silently overrides the browser's native
   [hidden]{display:none} UA rule at equal specificity. Force it back. */
.thermo-qs-results[hidden],
.thermo-qs-viewall[hidden],
.thermo-qs-empty[hidden] {
    display: none !important;
}

/* Categories and brands scroll independently, each capped so a long
   list can't push the "ნახе ycelə" button out of view. */
.thermo-qs-categories,
.thermo-qs-brands {
    position: relative;
    flex-shrink: 0;
    max-height: 156px;
    overflow-y: auto;
}

.thermo-qs-categories:empty,
.thermo-qs-brands:empty {
    max-height: 0;
}

/* Bottom fade for the categories/brands scroll areas — a sticky
   pseudo-element that rides along the bottom of the scroller without
   needing extra markup, same purpose as .thermo-qs-fade for products. */
.thermo-qs-brands::after {
    content: '';
    display: block;
    position: sticky;
    left: 0;
    right: 0;
    bottom: 0;
    height: 28px;
    margin-top: -28px;
    background: linear-gradient(180deg, rgba(250, 250, 250, 0) 0%, rgba(250, 250, 250, 0.85) 55%, #FAFAFA 90%);
    pointer-events: none;
}

/* Thin scrollbars — Firefox + WebKit/Chromium */
.thermo-qs-results,
.thermo-qs-categories,
.thermo-qs-brands,
.thermo-qs-products {
    scrollbar-width: thin;
    scrollbar-color: rgba(21, 34, 49, 0.18) transparent;
}

.thermo-qs-results::-webkit-scrollbar,
.thermo-qs-categories::-webkit-scrollbar,
.thermo-qs-brands::-webkit-scrollbar,
.thermo-qs-products::-webkit-scrollbar {
    width: 4px;
}

.thermo-qs-results::-webkit-scrollbar-track,
.thermo-qs-categories::-webkit-scrollbar-track,
.thermo-qs-brands::-webkit-scrollbar-track,
.thermo-qs-products::-webkit-scrollbar-track {
    background: transparent;
}

.thermo-qs-results::-webkit-scrollbar-thumb,
.thermo-qs-categories::-webkit-scrollbar-thumb,
.thermo-qs-brands::-webkit-scrollbar-thumb,
.thermo-qs-products::-webkit-scrollbar-thumb {
    background: rgba(21, 34, 49, 0.18);
    border-radius: 10px;
}

.thermo-qs-results::-webkit-scrollbar-thumb:hover,
.thermo-qs-categories::-webkit-scrollbar-thumb:hover,
.thermo-qs-brands::-webkit-scrollbar-thumb:hover,
.thermo-qs-products::-webkit-scrollbar-thumb:hover {
    background: rgba(21, 34, 49, 0.3);
}

.thermo-qs-label {
    font-family: 'ThermoFont', sans-serif;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: -0.12px;
    color: rgba(21, 34, 49, 0.5);
    margin: 14px 0 8px;
}

/* Categories / brands — pill rows */
.thermo-qs-cat-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 10px 20px;
    margin-bottom: 5px;
    background: #FAFAFA;
    border-radius: 50px;
    font-family: 'ThermoFont', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.12px;
    color: rgba(21, 34, 49, 0.8);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s ease;
}

.thermo-qs-cat-link:last-child {
    margin-bottom: 0;
}

.thermo-qs-cat-link:hover {
    background: #F2F2F2;
}

/* Products — takes the remaining flexible space so categories/brands
   above and the viewall button below never get pushed around; scrolls
   internally when the list is longer than the available room. */
.thermo-qs-products-wrap {
    position: relative;
    flex: 1;
    min-height: 90px;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.thermo-qs-products {
    display: flex;
    flex-direction: column;
    gap: 5px;
    height: 100%;
    max-height: 320px;
    overflow-y: auto;
}

.thermo-qs-fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40px;
    background: linear-gradient(180deg, rgba(250, 250, 250, 0) 0%, rgba(250, 250, 250, 0.85) 55%, #FAFAFA 85%);
    pointer-events: none;
}

.thermo-qs-product-row {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 76px;
    background: #fff;
    border-radius: 5px;
    text-decoration: none;
    padding-right: 8px;
}

.thermo-qs-thumb {
    position: relative;
    width: 66px;
    height: 76px;
    border-radius: 5px;
    background: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.thermo-qs-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.thermo-qs-badge {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 5px;
    background: #FF7B7B;
    border-radius: 5px;
    font-family: 'ThermoFont', sans-serif;
    font-weight: 700;
    font-size: 11px;
    line-height: 1;
    color: #fff;
    z-index: 1;
}

.thermo-qs-product-info {
    grid-column: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.thermo-qs-product-title {
    font-family: 'ThermoFont', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 21px;
    letter-spacing: -0.374px;
    color: #1D1D1F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thermo-qs-product-brand {
    font-family: 'ThermoFont', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 18px;
    letter-spacing: -0.374px;
    color: #1D1D1F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thermo-qs-product-price {
    grid-column: 3;
    align-self: end;
    max-width: 92px;
    text-align: right;
    white-space: normal;
    font-family: 'ThermoFont', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.224px;
    color: #1D1D1F;
}

.thermo-qs-product-price del {
    opacity: 0.5;
    text-decoration: line-through;
    margin-right: 6px;
    font-size: 12px;
}

.thermo-qs-product-price ins {
    text-decoration: none;
}

/* Empty state */
.thermo-qs-empty {
    text-align: center;
    padding: 24px 0;
    font-family: 'ThermoFont', sans-serif;
    font-size: 13px;
    color: rgba(21, 34, 49, 0.5);
}

/* View all */
.thermo-qs-viewall {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: max-content;
    margin: 4px auto 0;
    padding: 15px 25px;
    border-radius: 50px;
    font-family: 'ThermoFont', sans-serif;
    font-weight: 400;
    font-size: 16px;
    letter-spacing: -0.12px;
    color: #152231;
    text-decoration: none;
    flex-shrink: 0;
}

.thermo-qs-viewall svg {
    color: #152231;
}

/* =====================
   Mobile — the card becomes a fixed full-width panel near the top
   instead of growing from the icon (avoids overflowing off-screen
   when the icon sits close to the right edge of a narrow viewport).
   ===================== */
@media (max-width: 600px) {
    .thermo-qs-root.is-open .thermo-qs-bar {
        position: fixed;
        top: 64px;
        right: 8px;
        left: 8px;
        width: auto;
        max-height: calc(100vh - 90px);
    }
}

/* =====================
   Icon stroke weight — our icon SVGs use viewBox="0 0 24 24" but render
   smaller (19px/14px/etc), which scales stroke-width down with it,
   making them look thinner than the header's cart icon (whose viewBox
   matches its render size 1:1, so it never hits this). Pin the actual
   on-screen stroke to a constant 2px regardless of that scale.
   ===================== */
.thermo-qs-icon-btn svg *,
.thermo-qs-close svg *,
.thermo-qs-viewall svg * {
    vector-effect: non-scaling-stroke;
}