/* ==========================================================================
   Smart instant search (resources/views/frontend/partials/smart_search.blade.php)
   Desktop: dropdown under the header search pill. Mobile: full-screen overlay.
   ========================================================================== */
:root { --gjs-ink: var(--brand-ink, #1F1A17); --gjs-muted: var(--brand-muted, #6F655C); --gjs-line: var(--brand-border, #E9E2D8);
        --gjs-wine: var(--brand-primary, #6E2433); --gjs-tint: var(--brand-primary-soft, #F6ECEE); --gjs-ivory: var(--brand-ivory, #FAF6F0); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html.gjs-lock, html.gjs-lock body { overflow: hidden !important; }

/* ---------- shared result list ---------- */
.gjs-results { color: var(--gjs-ink); font-size: 14px; }
.gjs-sec { padding: 10px 16px 4px; }
.gjs-sec + .gjs-sec { border-top: 1px solid var(--gjs-line); }
.gjs-sec-head { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
                text-transform: uppercase; color: var(--gjs-muted); margin-bottom: 8px; }
.gjs-link { border: 0; background: none; color: var(--gjs-wine); font-size: 12px; font-weight: 600; padding: 6px 4px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.gjs-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 8px; }
.gjs-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--gjs-line); border-radius: 999px;
            background: #fff; color: var(--gjs-ink) !important; font-size: 13.5px; text-decoration: none !important; }
.gjs-chip-cat { background: var(--gjs-ivory); }
.gjs-chip:hover, .gjs-chip.is-active { border-color: var(--gjs-wine); color: var(--gjs-wine) !important; background: var(--gjs-tint); }
.gjs-count { font-size: 11.5px; color: var(--gjs-muted); font-weight: 600; }

.gjs-dym { display: block; width: 100%; text-align: left; min-height: 48px; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--gjs-line);
           background: var(--gjs-tint); color: var(--gjs-ink); font-size: 14.5px; cursor: pointer; }
.gjs-dym strong { color: var(--gjs-wine); }
.gjs-dym.is-active, .gjs-dym:hover { background: #EEDCE0; }
.gjs-empty { padding: 14px 16px 2px; margin: 0; color: var(--gjs-muted); }

.gjs-sec-products { padding-left: 0; padding-right: 0; }
.gjs-sec-products .gjs-sec-head { padding: 0 16px; }
.gjs-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 16px; color: var(--gjs-ink) !important; text-decoration: none !important; }
.gjs-row:hover, .gjs-row.is-active { background: var(--gjs-ivory); }
.gjs-thumb { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--gjs-ivory); border: 1px solid var(--gjs-line); }
.gjs-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gjs-row-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.gjs-row-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gjs-row-price { font-size: 13px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.gjs-price { font-weight: 700; }
.gjs-mrp { color: var(--gjs-muted); }
.gjs-off { color: #B42318; background: #FDECEA; border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 700; }

.gjs-all { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 12px 16px; border-top: 1px solid var(--gjs-line);
           color: var(--gjs-wine) !important; font-weight: 600; text-decoration: none !important; }
.gjs-all:hover, .gjs-all.is-active { background: var(--gjs-tint); }

/* skeleton */
.gjs-skel .gjs-thumb { animation: gjsPulse 1.2s ease-in-out infinite; }
.gjs-skel-lines { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.gjs-skel-lines i { display: block; height: 10px; border-radius: 5px; background: #EFE9E1; animation: gjsPulse 1.2s ease-in-out infinite; }
.gjs-skel-lines i:first-child { width: 70%; } .gjs-skel-lines i:last-child { width: 35%; }
@keyframes gjsPulse { 50% { opacity: .5; } }

/* ---------- desktop dropdown ---------- */
.gentora-header-search-form { position: relative; }
.gjs-dropdown { position: absolute; top: calc(100% + 8px); right: 0; width: min(440px, 90vw); max-height: min(70vh, 560px); overflow-y: auto;
                background: #fff; border: 1px solid var(--gjs-line); border-radius: 12px; box-shadow: 0 12px 32px rgba(31, 26, 23, .12); z-index: 1060; padding-bottom: 4px; }
.gjs-dropdown[hidden] { display: none; }
.gjs-dropdown:empty { display: none; }

/* ---------- mobile overlay ---------- */
.gjs-overlay { position: fixed; inset: 0; z-index: 100050; background: #fff; display: flex; flex-direction: column; opacity: 0; transform: translateY(8px);
               transition: opacity .18s ease, transform .18s ease; }
.gjs-overlay.is-open { opacity: 1; transform: none; }
.gjs-overlay[hidden] { display: none; }
.gjs-overlay-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); border-bottom: 1px solid var(--gjs-line); margin: 0; }
.gjs-icon-btn { flex: 0 0 44px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--gjs-ink); border-radius: 50%; }
.gjs-icon-btn:focus-visible, .gjs-clear:focus-visible { outline: 2px solid var(--gjs-wine); outline-offset: 2px; }
.gjs-field { flex: 1; position: relative; display: flex; align-items: center; }
.gjs-field-ico { position: absolute; left: 12px; color: var(--gjs-muted); pointer-events: none; }
.gjs-input { width: 100%; height: 46px; border: 1px solid var(--gjs-line); border-radius: 999px; padding: 0 44px 0 40px; font-size: 16px; color: var(--gjs-ink);
             background: var(--gjs-ivory); -webkit-appearance: none; appearance: none; }
.gjs-input::-webkit-search-cancel-button { display: none; }
.gjs-input:focus { outline: none; border-color: var(--gjs-wine); background: #fff; }
.gjs-clear { position: absolute; right: 4px; width: 40px; height: 40px; border: 0; background: none; color: var(--gjs-muted); display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.gjs-clear[hidden] { display: none; }
.gjs-overlay-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom); }
.gjs-overlay .gjs-row { min-height: 68px; }

@media (min-width: 768px) {
    .gjs-overlay { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    .gjs-overlay { transition: none; transform: none; }
    .gjs-skel .gjs-thumb, .gjs-skel-lines i { animation: none; }
}

/* ---------- results page: "Showing results for X · Search instead for Y" ---------- */
.gj-search-fixed { margin: 6px 0 0; font-size: 14px; color: var(--gjs-muted); }
.gj-search-fixed strong { color: var(--gjs-ink); }
.gj-search-fixed a { color: var(--gjs-wine); text-decoration: underline; }
