/**
 * Live search panel. Full-width from the top on a phone (the apps' sheet),
 * a centred panel on a desktop. Theme-independent: it paints its own surface
 * and colours so a theme change cannot leave it unreadable.
 */
.sariea-search {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
}
.sariea-search.is-open { display: block; }
html.sariea-search-open { overflow: hidden; }

.sariea-search__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.45);
}

.sariea-search__panel {
    position: relative;
    margin: 56px auto 0;
    width: 100%;
    max-width: 640px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(17, 17, 17, 0.22);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 96px);
    overflow: hidden;
    animation: sarieaSearchIn .18s ease-out;
}
@keyframes sarieaSearchIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .sariea-search__panel { animation: none; }
}

.sariea-search__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 10px;
}
.sariea-search__field {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0 16px;
    height: 52px;
    border: 1px solid #111111;
    border-radius: 26px;
    color: #6B7280;
    background: #fff;
}
.sariea-search__field input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 16px;          /* 16px: iOS zooms the page below that */
    color: #111111;
    height: 100%;
}
.sariea-search__field input::-webkit-search-cancel-button { display: none; }
.sariea-search__clear,
.sariea-search__close {
    flex: 0 0 auto;
    background: none;
    border: 0;
    font-size: 26px;
    line-height: 1;
    color: #6B7280;
    cursor: pointer;
    padding: 0 4px;
}
.sariea-search__close { font-size: 30px; }

.sariea-search__status {
    padding: 0 20px 6px;
    font-size: 12px;
    color: #9CA3AF;
    min-height: 18px;
}

/* Filter row: chips under the field, scrolling sideways rather than wrapping
   into a wall on a phone. */
.sariea-search__filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 20px 10px;
    scrollbar-width: none;
}
.sariea-search__filters::-webkit-scrollbar { display: none; }
.sariea-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid #E5E7EB;
    border-radius: 18px;
    background: #fff;
    color: #111111;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
.sariea-chip span { color: #9CA3AF; font-weight: 600; }
.sariea-chip:hover { background: #F9FAFB; }
.sariea-chip.is-on { background: #111111; border-color: #111111; color: #fff; }
.sariea-chip.is-on span { color: rgba(255,255,255,.65); }
.sariea-chip--reset { color: #6B7280; text-decoration: underline; border-color: transparent; }

.sariea-search__results {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
}

.sariea-search__grouphead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #9CA3AF;
}
.sariea-search__forget {
    background: none;
    border: 0;
    padding: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .4px;
    color: #6B7280;
    text-decoration: underline;
    cursor: pointer;
}

.sariea-search__row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    text-decoration: none;
    color: inherit;
}
.sariea-search__row:hover,
.sariea-search__row.is-active { background: #F9FAFB; }
.sariea-search__thumb {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    overflow: hidden;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sariea-search__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sariea-search__ph {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #D1D5DB;
}
.sariea-search__meta { flex: 1 1 auto; min-width: 0; }
.sariea-search__title {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    color: #111111;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sariea-search__sub {
    display: block;
    font-size: 12.5px;
    color: #6B7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sariea-search__price {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 800;
    color: #111111;
    white-space: nowrap;
}
.sariea-search__chev { flex: 0 0 auto; color: #9CA3AF; font-size: 18px; }

.sariea-search__all {
    display: block;
    margin: 10px 20px 4px;
    padding: 13px 16px;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    text-align: center;
    font-size: 13.5px;
    font-weight: 700;
    color: #111111;
    text-decoration: none;
}
.sariea-search__all:hover { background: #F9FAFB; color: #111111; }

.sariea-search__empty {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 28px 20px;
    text-align: center;
    color: #6B7280;
    font-size: 13.5px;
}
.sariea-search__empty strong { color: #111111; font-size: 15px; font-weight: 700; }
.sariea-search__empty .sariea-search__all { margin-top: 10px; }

/* Phones: the panel is the screen, like the apps' search sheet. */
@media (max-width: 767.98px) {
    .sariea-search__panel {
        margin: 0;
        max-width: none;
        height: 100%;
        max-height: none;
        border-radius: 0;
        animation: none;
    }
    .sariea-search__head { padding: 12px 12px 8px; }
    .sariea-search__field { height: 48px; }
    .sariea-search__row { padding: 10px 16px; }
    .sariea-search__filters { padding: 4px 16px 10px; }
    .sariea-search__grouphead { padding: 12px 16px 6px; }
    .sariea-search__all { margin: 10px 16px 4px; }
}

/* The header trigger. */
.sariea-search-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    background: none;
    color: #111111;
    cursor: pointer;
    padding: 0;
}
.sariea-search-trigger:hover { background: #f3f4f6; border-radius: 50%; }
