/* ═══════════════════════════════════════════
   BW Smart Search v1.2 – CSS
═══════════════════════════════════════════ */

/* ── Wrapper ── */
.bws-search-wrap {
    position: relative;
    width: 100%;
    font-family: inherit;
    z-index: 9999;
}

/* ════════════════════════════════
   DARK THEME (default – header)
════════════════════════════════ */
.bws-theme-dark .bws-search-box {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 4px;
}

.bws-theme-dark .bws-search-box:focus-within {
    border-color: rgba(255, 255, 255, 0.9);
}

.bws-theme-dark .bws-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
    opacity: 1;
}

.bws-theme-dark .bws-btn svg {
    stroke: #ffffff;
}

.bws-theme-dark .bws-btn:hover svg {
    stroke: #f5a623;
}

/* ════════════════════════════════
   LIGHT THEME (for white areas)
════════════════════════════════ */
.bws-theme-light .bws-search-box {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
}

.bws-theme-light .bws-search-box:focus-within {
    border-color: #f5a623;
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

.bws-theme-light .bws-input {
    color: #1a1a1a !important;
}

.bws-theme-light .bws-input::placeholder {
    color: #aaa;
    opacity: 1;
}

.bws-theme-light .bws-btn svg {
    stroke: #555;
}

.bws-theme-light .bws-btn:hover svg {
    stroke: #f5a623;
}

/* ══════════════════════════════════════
   SEARCH BOX LAYOUT
   flex row – input grows, button fixed
══════════════════════════════════════ */
.bws-search-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    overflow: visible;
    transition: border-color .2s, box-shadow .2s;
}

/* ══════════════════════════════════════
   INPUT – matches old store search CSS
══════════════════════════════════════ */
.bws-input {
    flex: 1 1 auto;
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 16px !important;
    padding: 15px 20px !important;
    height: 100% !important;
    width: 100% !important;
    box-shadow: none !important;
    outline: none !important;
    min-width: 0;
    line-height: 1.4;
}

/* ══════════════════════════════════════
   SEARCH BUTTON – inline flex item
   icon-only, no background
══════════════════════════════════════ */
.bws-btn {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: opacity .15s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.bws-btn:hover {
    background: transparent !important;
    opacity: .7;
}

.bws-btn:focus {
    outline: none;
    box-shadow: none !important;
}

.bws-btn svg {
    display: block;
    flex-shrink: 0;
}

/* ── Dropdown container ── */
.bws-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
    max-height: 440px;
    overflow-y: auto;
    z-index: 99999;
    animation: bws-fade .14s ease;
}

.bws-theme-light .bws-dropdown {
    background: #fff;
    border-color: #e0e0e0;
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
}

.bws-dropdown.is-open { display: block; }

@keyframes bws-fade {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ── Section headings ── */
.bws-section-title {
    padding: 10px 16px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: rgba(255,255,255,.35);
    border-top: 1px solid rgba(255,255,255,.08);
}

.bws-theme-light .bws-section-title {
    color: #aaa;
    border-top-color: #f0f0f0;
}

.bws-section-title:first-child { border-top: none; }

/* ── Result items ── */
.bws-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    color: #f0f0f0;
    transition: background .12s;
}

.bws-theme-light .bws-item {
    color: #1a1a1a;
}

.bws-item:hover,
.bws-item.is-active {
    background: rgba(245,166,35,.1);
    color: inherit;
    text-decoration: none;
}

.bws-theme-light .bws-item:hover,
.bws-theme-light .bws-item.is-active {
    background: #fff8ee;
}

/* Thumbnail */
.bws-item-thumb {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 4px;
    object-fit: cover;
    background: #2a2a2a;
}

.bws-item-thumb-placeholder {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 4px;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bws-theme-light .bws-item-thumb-placeholder {
    background: #f0f0f0;
}

.bws-item-thumb-placeholder svg { stroke: #555; }
.bws-theme-light .bws-item-thumb-placeholder svg { stroke: #ccc; }

/* Text */
.bws-item-info { flex: 1; min-width: 0; }

.bws-item-label {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.bws-item-label em {
    font-style: normal;
    color: #f5a623;
    font-weight: 700;
}

.bws-item-meta {
    font-size: 12px;
    color: rgba(255,255,255,.45);
    margin-top: 2px;
}

.bws-theme-light .bws-item-meta {
    color: #888;
}

/* Motorcycle badge */
.bws-item-badge-moto {
    font-size: 10px;
    background: rgba(245,166,35,.2);
    color: #f5a623;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: .03em;
}

/* Category badge */
.bws-item-badge {
    font-size: 11px;
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.55);
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.bws-theme-light .bws-item-badge {
    background: #f0f0f0;
    color: #666;
}

/* ── Loading / no results ── */
.bws-loading,
.bws-no-results {
    padding: 20px 16px;
    text-align: center;
    font-size: 14px;
    color: rgba(255,255,255,.35);
}

.bws-theme-light .bws-loading,
.bws-theme-light .bws-no-results {
    color: #aaa;
}

.bws-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.15);
    border-top-color: #f5a623;
    border-radius: 50%;
    animation: bws-spin .7s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes bws-spin { to { transform: rotate(360deg); } }

/* ── Scrollbar ── */
.bws-dropdown::-webkit-scrollbar { width: 4px; }
.bws-dropdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.bws-theme-light .bws-dropdown::-webkit-scrollbar-thumb { background: #e0e0e0; }
