/* Header live search (replaces the wishlist heart). Scoped to .hs; uses logical properties so Arabic RTL needs no overrides. */
.hs { position: relative; display: inline-flex; align-items: center; }
.hs [hidden] { display: none !important; }

.hs-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 0; min-height: 32px; padding: 0; margin: 0;
    background: transparent; border: 0; cursor: pointer; line-height: 1; color: inherit;
}
.hs-toggle:focus-visible, .hs-close:focus-visible, .hs-input:focus-visible, .hs-item:focus-visible {
    outline: 3px solid rgba(74, 222, 128, .7); outline-offset: 2px;
}
.hs-toggle[aria-expanded="true"] { color: #4ade80; }

.hs-panel {
    position: absolute; top: calc(100% + 14px); inset-inline-end: -8px; z-index: 60;
    width: 380px; max-width: calc(100vw - 16px);
    background: #fff; color: #1f2937; border-radius: 14px; overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .12);
    border: 1px solid rgba(15, 23, 42, .08);
    text-align: start;
}

.hs-field { position: relative; display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 14px; border-bottom: 1px solid #eef0f3; }
html[dir="rtl"] .hs-field { padding: 12px 14px 12px 12px; }
.hs-field-icon { color: #9ca3af; font-size: 15px; flex: 0 0 auto; }
.hs-input {
    flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 10px;
    border: 0; background: transparent; color: #111827; font-size: 16px; /* 16px prevents iOS zoom-on-focus */
    font-family: inherit; box-shadow: none; -webkit-appearance: none; appearance: none;
}
.hs-input::-webkit-search-cancel-button, .hs-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.hs-input::placeholder { color: #9ca3af; }
.hs-input:focus { outline: none; }
.hs-input:focus-visible { outline: none; }
.hs-field:focus-within { box-shadow: inset 0 -2px 0 #22c55e; }
.hs-close {
    flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 999px; padding: 0;
    background: #f3f4f6; color: #4b5563; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.hs-close:hover { background: #e5e7eb; }

.hs-status { padding: 18px 16px; color: #6b7280; font-size: 14px; text-align: center; }
.hs-status.is-error { color: #b91c1c; }
.hs-status.is-loading::before {
    content: ""; display: inline-block; width: 14px; height: 14px; margin-inline-end: 8px; vertical-align: -2px;
    border: 2px solid #d1d5db; border-top-color: #22c55e; border-radius: 50%; animation: hs-spin .7s linear infinite;
}
@keyframes hs-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hs-status.is-loading::before { animation-duration: 2s; } }

.hs-results { list-style: none; margin: 0; padding: 4px 0; max-height: min(60vh, 440px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.hs-results li { margin: 0; padding: 0; }
.hs-results li + li { border-top: 1px solid #f1f3f5; }
.hs-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 64px;
    color: #111827; text-decoration: none; transition: background .12s;
}
.hs-item:hover, .hs-item:focus { background: #f0fdf4; color: #111827; text-decoration: none; }
.hs-thumb {
    flex: 0 0 52px; width: 52px; height: 52px; object-fit: cover; border-radius: 10px;
    background: #f3f4f6; border: 1px solid #eef0f3;
}
.hs-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hs-name { font-size: 14.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.hs-price { font-size: 13px; color: #15803d; font-weight: 600; }

/* Phones and narrow tablets: the panel spans the header width under the header bar instead of hanging off the icon. */
@media (max-width: 767px) {
    .hs { position: static; }
    .hs-panel { position: absolute; top: 100%; inset-inline: 8px; width: auto; max-width: none; border-radius: 0 0 14px 14px; margin-top: 0; }
    .hs-toggle { min-width: 40px; min-height: 40px; }
    .hs-item { min-height: 68px; padding: 10px 14px; }
    .hs-results { max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); }
}
