/* ============================================
   BC Search — Styles v1.0.8
   ============================================ */

.rm-search-wrap {
    position: relative;
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* ---- Search bar ---- */
.rm-search-bar {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #d1d5db;
    border-radius: 999px;
    padding: 14px 22px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rm-search-bar:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.rm-search-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    color: #9ca3af;
    margin-right: 12px;
    transition: color 0.2s ease;
}

.rm-search-bar:focus-within .rm-search-icon { color: #6b7280; }

.rm-search-input {
    flex: 1; min-width: 0;
    border: none; outline: none;
    background: transparent;
    font-size: 16px;
    color: #1f2937;
    line-height: 1.4;
}

.rm-search-input::placeholder { color: #9ca3af; font-weight: 400; }

/* ---- Filter checkboxes ---- */
.rm-search-filters {
    display: flex;
    gap: 16px;
    padding: 8px 6px 2px;
    justify-content: center;
}

.rm-search-filter-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.rm-search-filter-label input[type="checkbox"] {
    width: 15px; height: 15px;
    accent-color: #3b82f6;
    cursor: pointer;
    margin: 0;
}

/* Spinner */
.rm-search-spinner {
    display: none;
    width: 24px; height: 24px;
    flex-shrink: 0;
    margin-left: 10px;
    border: 2.5px solid #e5e7eb;
    border-top-color: #ea682f;
    border-radius: 50%;
    animation: bc-spin 0.6s linear infinite;
}

.rm-search-spinner.is-active { display: block; }
@keyframes bc-spin { to { transform: rotate(360deg); } }

/* ---- Results dropdown ---- */
.rm-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    max-height: 440px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    z-index: 9999;
    display: none;
    padding: 6px;
}

.rm-search-results.is-open { display: block; }

/* Section heading (shown when both types checked) */
.rm-search-section-heading {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    padding: 10px 14px 4px;
}

/* Item */
.rm-search-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: #1f2937;
    transition: background-color 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
}

.rm-search-item:hover,
.rm-search-item:focus,
.rm-search-item.is-active { background-color: #f3f4f6 !important; text-decoration: none !important; color: #1f2937 !important; }
.rm-search-item:active { background-color: #e5e7eb !important; }

/* Thumbnails */
.rm-search-thumb {
    width: 52px; height: 52px;
    flex-shrink: 0;
    border-radius: 10px;
    object-fit: cover;
    background-color: #f3f4f6;
}

.rm-search-thumb-placeholder {
    width: 52px; height: 52px;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 100%);
    display: flex; align-items: center; justify-content: center;
}

.rm-search-thumb-placeholder--band {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
}

.rm-search-thumb-placeholder svg { width: 22px; height: 22px; color: #93a3b8; }
.rm-search-thumb-placeholder--band svg { color: #db2777; }

/* Info column */
.rm-search-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.rm-search-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #1f2937;
}

/* Tags */
.rm-search-tags { display: flex; flex-wrap: wrap; gap: 4px; }

.rm-search-tag {
    display: inline-block !important;
    font-size: 11px !important; font-weight: 500 !important;
    color: #4b5563 !important;
    background: #f3f4f6 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 999px !important;
    padding: 1px 8px !important;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s;
    line-height: 1.6 !important;
    min-height: 24px;
}

.rm-search-tag:hover { background: #e5e7eb !important; color: #111827 !important; text-decoration: none !important; border-color: #d1d5db !important; }

/* Price */
.rm-search-price {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.rm-search-price ins { text-decoration: none; }
.rm-search-price del { color: #9ca3af; font-weight: 400; margin-right: 4px; }

/* Band meta */
.rm-search-band-meta {
    font-size: 12px;
    color: #9ca3af;
}

.rm-search-band-arrow {
    font-size: 16px;
    color: #d1d5db;
    flex-shrink: 0;
    margin-left: auto;
}

/* Empty */
.rm-search-empty {
    padding: 24px 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* Scroll loader */
.rm-search-scroll-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 12px 0;
}

.rm-search-scroll-loader span {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #d1d5db;
    animation: bc-bounce 0.8s ease-in-out infinite;
}

.rm-search-scroll-loader span:nth-child(2) { animation-delay: 0.15s; }
.rm-search-scroll-loader span:nth-child(3) { animation-delay: 0.30s; }

@keyframes bc-bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%            { transform: scale(1);   opacity: 1; }
}

/* Scrollbar */
.rm-search-results::-webkit-scrollbar { width: 6px; }
.rm-search-results::-webkit-scrollbar-track { background: transparent; }
.rm-search-results::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ---- Mobile ---- */
@media (max-width: 600px) {
    .rm-search-results {
        position: fixed;
        left: 10px; right: 10px;
        top: auto;
        max-height: 55vh;
        border-radius: 14px;
    }

    .rm-search-bar { padding: 12px 18px; }
    .rm-search-input { font-size: 16px; }

    .rm-search-thumb,
    .rm-search-thumb-placeholder { width: 44px; height: 44px; }

    .rm-search-item { padding: 10px 12px; min-height: 52px; }

    .rm-search-filters { gap: 14px; }
    .rm-search-filter-label { font-size: 14px; }
    .rm-search-filter-label input[type="checkbox"] { width: 18px; height: 18px; }
}
