.search-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    max-width: 100%;
    transition: box-shadow 0.2s ease;
}

.search-wrapper.sticky {
    position: sticky;
    top: 50px;                 /* <-- matches collapsed sticky-element2 height */
    z-index: 1029;             /* below sticky-element2 */
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transition: top 0.3s ease;
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 500px;    /* ← requested maximum width */
}

.search-bar input {
    width: 100%;
    padding: 10px 36px 10px 36px; /* space for icons */
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 16px;
    outline: none;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    color: #777;
    display: none; /* Shown only when text exists */
}

.clear-btn:hover {
    color: #000;
}

.paging-buttons {
    display: flex;
    gap: 6px;
}

.page-btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #f8f8f8;
    cursor: pointer;
}

.page-btn:hover {
    background: #e9e9e9;
}

.keyword-highlight {
    background: yellow;
    padding: 0 2px;
    border-radius: 3px;
}

.keyword-highlight.flash {
  background-color: orange !important; /* flash color */
  transition: background-color 0.3s ease-in-out;
}

.match-scrollable {
    max-height: 100%;       /* ensures it doesn’t exceed grid-item height */
    overflow-y: auto;       /* allow vertical scroll within grid-item */
}
