/* ================================================================
   shop-search.css
   Add to your shop CSS bundle or inside <style> in _ShopLayout.cshtml
   ================================================================ */

/* ── Wrapper ────────────────────────────────────────────────── */
.shop-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

/* ── Input row ──────────────────────────────────────────────── */
.shop-search-input-row {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 50px;
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s;
}

.shop-search-wrapper.focused .shop-search-input-row,
.shop-search-input-row:focus-within {
    border-color: #e53935;
    box-shadow: 0 0 0 3px rgba(229,57,53,.12);
}

.shop-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 18px;
    font-size: .95rem;
    background: transparent;
    color: #222;
    min-width: 0;
}

.shop-search-input::placeholder { color: #aaa; }

.shop-search-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e53935;
    border: none;
    cursor: pointer;
    border-radius: 0 50px 50px 0;
    color: #fff;
    transition: background .15s;
}

.shop-search-btn:hover  { background: #c62828; }
.shop-search-btn svg    { width: 18px; height: 18px; display: block; }

/* ── Dropdown ────────────────────────────────────────────────── */
.shop-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 14px;
    box-shadow: 0 10px 36px rgba(0,0,0,.14);
    z-index: 1100;
    overflow: hidden;
    animation: shopDropdownIn .13s ease;
}

@keyframes shopDropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ── Results ────────────────────────────────────────────────── */
.shop-search-results { padding: 6px 0; }

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f4f4f4;
    transition: background .1s;
}

.search-suggestion-item:last-child { border-bottom: none; }

.search-suggestion-item:hover,
.search-suggestion-item:focus,
.search-suggestion-item.keyboard-active {
    background: #fef9f9;
    outline: none;
}

/* ── Thumbnail ──────────────────────────────────────────────── */
.search-suggestion-thumb {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    background: #f5f5f5;
    border: 1px solid #ececec;
}

.search-suggestion-thumb-placeholder {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: #f5f5f5;
    border: 1px solid #ececec;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

/* ── Info ───────────────────────────────────────────────────── */
.search-suggestion-info {
    flex: 1;
    min-width: 0;
}

.search-suggestion-name {
    font-size: .875rem;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggestion-category {
    font-size: .75rem;
    color: #999;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Price ──────────────────────────────────────────────────── */
.search-suggestion-price {
    flex-shrink: 0;
    text-align: right;
    font-size: .85rem;
    font-weight: 700;
    color: #e53935;
    white-space: nowrap;
    line-height: 1.3;
}

.search-suggestion-price del {
    display: block;
    font-size: .72rem;
    color: #bbb;
    font-weight: 400;
}

/* ── Empty ──────────────────────────────────────────────────── */
.shop-search-empty {
    padding: 16px;
    font-size: .875rem;
    color: #999;
    text-align: center;
}

/* ── Loader (3 bouncing dots) ───────────────────────────────── */
.shop-search-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 16px;
}

.loader-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e53935;
    animation: shopDotBlink 1.1s infinite ease-in-out;
}
.loader-dot:nth-child(1) { animation-delay: 0s;   }
.loader-dot:nth-child(2) { animation-delay: .18s; }
.loader-dot:nth-child(3) { animation-delay: .36s; }

@keyframes shopDotBlink {
    0%, 80%, 100% { opacity: .2; transform: scale(.75); }
    40%            { opacity: 1;  transform: scale(1);   }
}

/* ── Highlight matched text ─────────────────────────────────── */
mark.search-highlight {
    background: #fff3cd;
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .shop-search-wrapper { max-width: 100%; }
    .shop-search-input   { font-size: .875rem; padding: 9px 14px; }
    .shop-search-btn     { width: 40px; height: 40px; }
}
