/* =====================================================================
   PATCH for vp-clean.css: instant search (three small edits, nothing else changes)
   ===================================================================== */

/* EDIT 1 - base header rule: remove `flex: 1;`
     BEFORE: .search { flex: 1; display: flex; min-width: 0; ... }
     AFTER:  .search { display: flex; min-width: 0; ... }                                  */

/* EDIT 2 - inside @media (max-width: 960px): replace
     .search { order: 3; flex: 1 1 100%; }
   with
     .sbox { order: 3; flex: 1 1 100%; }                                                   */

/* EDIT 3 - paste this block anywhere above your responsive @media blocks */
/* =====================================================================
   6c. Instant search dropdown (Livewire SearchBox)
   ===================================================================== */
   .sbox { position: relative; flex: 1; min-width: 0; }
   .sbox .search { position: relative; }
   .sbox__spin { display: none; align-self: center; width: 16px; height: 16px; margin-right: 4px; flex: none; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
   @keyframes spin { to { transform: rotate(360deg); } }
   
   .sbox__panel {
     position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
     max-height: min(70vh, 560px); max-height: min(70dvh, 560px); overflow-y: auto; overscroll-behavior: contain;
     background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 48px rgba(0, 0, 0, .22);
   }
   .sbox__group + .sbox__group { border-top: 1px solid var(--line); }
   .sbox__title { margin: 0; padding: 12px 16px 6px; font-size: 13px; color: var(--muted); }
   .sbox__title b { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
   
   .sbox__row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; color: var(--ink); text-decoration: none; }
   .sbox__row:hover, .sbox__row.is-active { background: var(--sky); }
   .sbox__thumb { flex: none; width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius-sm); background: var(--soft); color: var(--muted); font-weight: 700; }
   .sbox__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
   .sbox__text { display: flex; flex-direction: column; min-width: 0; }
   .sbox__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
   .sbox__name mark { background: none; color: var(--blue); font-weight: 800; }
   .sbox__price { font-size: 13px; color: var(--muted); }
   
   .sbox__all { display: block; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--blue); font-weight: 600; text-decoration: none; }
   .sbox__all:hover { background: var(--sky); }
   .sbox__empty { margin: 0; padding: 18px 16px; color: var(--muted); }
   
.search input::-webkit-search-cancel-button { display: none; }   /* our own close button replaces the browser x */
.sbox__bar { display: contents; }                 /* desktop/tablet: the wrapper is invisible, search stays in the header row */
.sbox__toggle, .sbox__close { display: none; }
 
@media (max-width: 640px) {
  .sbox { flex: 0 0 auto; margin-left: auto; }
  .sbox__toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
  .sbox__toggle:hover { background: var(--soft); }
  .sbox__bar { display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 60; padding: 10px var(--gutter); background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .14); }
  .sbox__bar.is-open { display: block; }
  .sbox__close { display: block; }
  .sbox__panel { top: calc(100% + 4px); left: var(--gutter); right: var(--gutter); max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); }
}
 