/* ============================================
   PRIMEJO SEARCH BAR
   ============================================ */

.primejo-search-bar {
    background: #fff;
    border-bottom: 2px solid #f0f0f0;
    padding: 10px 0;
    position: sticky;
    top: 109px;
    z-index: 998;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.search-bar-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    background: #f7f7f7;
    border: 2px solid #ebebeb;
    border-radius: 50px;
    padding: 0 18px;
    gap: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-input-wrap:focus-within {
    border-color: #c9a961;
    box-shadow: 0 0 0 4px rgba(201, 169, 97, 0.12);
    background: #fff;
}

.search-icon {
    font-size: 16px;
    opacity: 0.45;
    flex-shrink: 0;
}

#primejoSearchInput {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    padding: 11px 0;
    outline: none;
    font-family: var(--font-primary, sans-serif);
    color: var(--text-primary, #1a1a1a);
    direction: rtl;
    text-align: right;
}

#primejoSearchInput::placeholder {
    color: #bbb;
    font-size: 13px;
}

.search-clear {
    background: none;
    border: none;
    font-size: 13px;
    color: #bbb;
    cursor: pointer;
    padding: 4px 7px;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.search-clear:hover {
    background: #eee;
    color: #555;
}

/* ── Dropdown ── */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 20px;
    right: 20px;
    background: #fff;
    border: 1.5px solid #ebebeb;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    max-height: 420px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
}

.search-dropdown.visible {
    display: block;
    animation: searchDropIn 0.18s ease;
}

/* ── Search bar scroll show/hide ── */
.primejo-search-bar {
    transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}

.primejo-search-bar.search-hidden {
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
}

.primejo-search-bar.search-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
    text-decoration: none;
}

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

.search-result-item:hover {
    background: #faf7f0;
}

.search-result-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #ebebeb;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    text-align: right;
}

.search-result-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 3px;
    line-height: 1.4;
}

.search-result-name mark {
    background: rgba(201, 169, 97, 0.22);
    color: #b8943f;
    border-radius: 3px;
    padding: 0 2px;
    font-style: normal;
}

.search-result-price {
    font-size: 12px;
    color: #c9a961;
    font-weight: 700;
}

.search-view-all {
    display: block;
    text-align: center;
    padding: 13px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #c9a961;
    cursor: pointer;
    border-top: 2px solid #f5f5f5;
    transition: background 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-view-all:hover {
    background: #faf7f0;
}

.search-no-results {
    padding: 24px;
    text-align: center;
    color: #aaa;
    font-size: 13px;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .primejo-search-bar {
        top: 88px;
        padding: 8px 0;
    }

    #primejoSearchInput {
        font-size: 13px;
        padding: 10px 0;
    }

    .search-result-img {
        width: 42px;
        height: 42px;
    }
}