/* PriMo Nails – site search (js/search.js). Phones: full screen, keyboard-first. Desktop: a visible field in the header that opens a panel under it. */
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
kbd{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border:1px solid #dcdcdc;border-bottom-width:2px;border-radius:6px;background:#fff;font:600 10.5px/1 var(--fi);color:#777}

/* menu drawer: search is reachable from the menu too */
.d-search{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;margin:0 0 10px;padding:0 16px;border:0;border-radius:22px;background:#f3f3f3;font:500 14px var(--f);color:#6f6f6f;text-align:left}
.d-search svg{flex:none;width:18px;height:18px;stroke-width:2;color:#111}

/* ---------- shell ---------- */
.search{position:fixed;inset:0;z-index:50;display:flex;flex-direction:column;height:100dvh;background:#fff;animation:sx-in .2s var(--ease) both}
.search[hidden]{display:none}
@keyframes sx-in{from{opacity:0;transform:translateY(8px)}}
.sx-top{flex:none;display:flex;align-items:center;gap:6px;width:100%;max-width:600px;margin:0 auto;padding:10px 8px 10px 16px;padding-top:calc(10px + env(safe-area-inset-top,0px))}
.sx-field{position:relative;flex:1;min-width:0;display:flex;align-items:center;gap:8px;height:46px;padding:0 6px 0 15px;border-radius:23px;background:#f3f3f3;transition:background .15s,box-shadow .15s}
.sx-field:focus-within{background:#fff;box-shadow:0 0 0 1.5px #111}
.sx-field>svg{flex:none;width:19px;height:19px;stroke-width:2;color:#111}
.sx-field input{flex:1;min-width:0;height:100%;padding:0;border:0;outline:0;background:none;font:500 16px var(--f);color:#111;-webkit-appearance:none;appearance:none}
.sx-field input:focus-visible{outline:none;box-shadow:none}
.sx-field input::placeholder{color:#8b8b8b;opacity:1}
.sx-field input::-webkit-search-cancel-button,.sx-field input::-webkit-search-decoration{-webkit-appearance:none;display:none}
.sx-clear{flex:none;width:34px;height:34px;padding:0;border:0;border-radius:50%;background:none;display:grid;place-items:center;color:#111}
.sx-clear::before{content:"";position:absolute;width:22px;height:22px;border-radius:50%;background:#dedede;z-index:-1}
.sx-clear{position:relative;isolation:isolate}
.sx-clear svg{width:13px;height:13px;stroke-width:2.6}
.sx-clear[hidden]{display:none}
.sx-cancel{flex:none;min-width:44px;height:44px;padding:0 10px;border:0;background:none;font:600 14px var(--f);color:#111}
.sx-cancel kbd{margin-left:6px}
.sx-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;width:100%;max-width:600px;margin:0 auto;padding:4px 16px calc(28px + env(safe-area-inset-bottom,0px))}
.search.has-q .sx-body{padding-bottom:0}

/* ---------- sections ---------- */
.sx-cols{display:flex;flex-direction:column}
/* phones: one column, most useful first (recent → popular → colours → best sellers → categories) */
@media (max-width:1023.98px){
  .sx-col{display:contents}
  .sx-sec--recent{order:1}.sx-sec--popular{order:2}.sx-sec--sug{order:3}.sx-sec--colors{order:4}.sx-sec--prods{order:5}.sx-sec--top{order:6}.sx-sec--cats{order:7}
}
.sx-sec{padding:18px 0 2px}
.sx-sec{border-top:1px solid #f0f0f0;margin-top:12px}
.sx-cols>.sx-col:first-child>.sx-sec:first-child,.sx-sec--recent,.sx-cols:not(:has(.sx-sec--recent)) .sx-sec--popular,.sx-sec--sug,.sx-cols:not(:has(.sx-sec--sug)) .sx-sec--prods{border-top:0;margin-top:0}
.sx-h{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0 0 8px}
.sx-h h3{margin:0;font-size:11.5px;line-height:16px;font-weight:700;letter-spacing:1.6px;text-transform:uppercase;color:#7d7d7d}
.sx-link{min-height:32px;padding:0 2px;border:0;background:none;font:600 12.5px var(--fi);color:#111;text-decoration:underline;text-underline-offset:3px}
.sx-count{font:500 12.5px var(--fi);color:#7d7d7d}
.sx-list,.sx-recent{list-style:none;margin:0 -8px;padding:0}
.sx-recent li{display:flex;align-items:center}

/* a row: icon · text · type */
.sx-row{flex:1;min-width:0;display:flex;align-items:center;gap:12px;width:100%;min-height:48px;padding:0 8px;border:0;border-radius:12px;background:none;font:500 15px var(--f);color:#111;text-align:left;transition:background .12s}
.sx-ic{flex:none;width:30px;height:30px;display:grid;place-items:center;border-radius:50%;background:#f4f4f4;color:#555}
.sx-ic svg{width:15px;height:15px;stroke-width:2}
.sx-sw{width:30px;height:30px;border-radius:50%;object-fit:cover;object-position:50% 50%;box-shadow:0 0 0 1px rgba(0,0,0,.08)}
.sx-th{width:40px;height:40px;border-radius:10px;object-fit:cover}
.sx-row--2 .sx-ic{width:40px;height:40px;border-radius:10px;overflow:hidden}
.sx-t small{display:block;margin-top:1px;font:400 12px/16px var(--fi);color:#8a8a8a;overflow:hidden;text-overflow:ellipsis}
.sx-row--2{min-height:56px;padding-top:6px;padding-bottom:6px}
.sx-t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sx-row small{flex:none;font:500 12px var(--fi);color:#8a8a8a}
.sx-x{flex:none;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:none;display:grid;place-items:center;color:#9a9a9a}
.sx-x svg{width:16px;height:16px;stroke-width:2}
.sx-x:hover{color:#111;background:#f4f4f4}
mark{background:none;color:inherit;font-weight:800}
.sx-row .sx-t{font-weight:400}
.sx-row .sx-t mark{font-weight:700}

/* popular searches */
.sx-chips{display:flex;flex-wrap:wrap;gap:8px}
.sx-chip{display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:0 15px 0 13px;border:1px solid #e2e2e2;border-radius:20px;background:#fff;font:600 13px var(--f);color:#111;transition:border-color .12s,background .12s}
.sx-chip svg{width:14px;height:14px;stroke-width:2;color:#ff9000}

/* colours: a swipeable row on phones */
.sx-colors{display:flex;gap:6px;overflow-x:auto;margin:0 -16px;padding:4px 16px 8px;scroll-padding-inline:16px;scrollbar-width:none;scroll-snap-type:x proximity}
.sx-colors::-webkit-scrollbar{display:none}
.sx-color{flex:none;display:flex;flex-direction:column;align-items:center;gap:6px;width:58px;padding:6px 0 4px;border:0;border-radius:12px;background:none;scroll-snap-align:start;font:600 11px var(--f);color:#444;text-align:center;white-space:nowrap}
.sx-color img{width:26px;height:62px;object-fit:contain;transition:transform .15s}

/* products: rows on phones */
.sx-prods{display:flex;flex-direction:column;margin:0 -8px}
.sx-prod{display:flex;align-items:center;gap:14px;padding:7px 8px;border-radius:14px;color:#111;transition:background .12s}
.sx-img{position:relative;flex:none;width:64px;height:64px;border-radius:12px;background:#f5f5f5;overflow:hidden}
.sx-img img{width:100%;height:100%;object-fit:cover}
.sx-dot{position:absolute;right:5px;bottom:5px;width:15px;height:15px;border-radius:50%;background:var(--bg);box-shadow:0 0 0 2px #fff}
.sx-pt{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.sx-pt b{font-size:14px;line-height:18px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sx-pt small{font:400 12.5px/16px var(--fi);color:#777;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sx-pt small mark{color:#111;font-weight:600}
.sx-pt em{margin-top:3px;font-style:normal;font-size:14px;line-height:18px;font-weight:700}

/* "see all" stays reachable above the keyboard */
.sx-all{position:sticky;bottom:0;z-index:1;display:flex;align-items:center;justify-content:center;gap:8px;min-height:50px;margin:18px -16px 0;padding:0 20px calc(env(safe-area-inset-bottom,0px));
  background:#111;color:#fff;font-size:14px;font-weight:600;letter-spacing:.2px;text-align:center}
.sx-all svg{flex:none;width:17px;height:17px;stroke-width:2}

/* typo notice / nothing found */
.sx-note{margin:14px 0 0;padding:10px 14px;border-radius:12px;background:#fff6e8;font:400 13px/18px var(--fi);color:#5a4220}
.sx-none{padding:36px 0 24px;text-align:center;color:#666;font:400 14px/20px var(--fi)}
.sx-none>svg{width:40px;height:40px;stroke-width:1.5;color:#c4c4c4}
.sx-none-h{margin:10px 0 4px;font:700 17px/22px var(--f);color:#111;overflow-wrap:anywhere}
.sx-none>p{margin-left:auto;margin-right:auto;max-width:320px}
.sx-none .sx-sec{text-align:left;border-top:0}
.sx-help{margin-top:22px}
.sx-help a{color:#111;font-weight:600;text-decoration:underline;text-underline-offset:3px}

/* highlight: keyboard selection and hover share one look */
.sx-row.is-active,.sx-prod.is-active,.sx-chip.is-active,.sx-color.is-active{background:#f2f2f2}
.sx-row.is-active,.sx-prod.is-active{box-shadow:inset 0 0 0 2px #111}
.sx-all.is-active{background:#333}
.sx-chip.is-active{border-color:#111}
.sx-color.is-active span{text-decoration:underline;text-underline-offset:3px}
@media (hover:hover){
  .sx-row:hover,.sx-prod:hover{background:#f6f6f6}
  .sx-chip:hover{border-color:#111}
  .sx-color:hover img{transform:translateY(-3px)}
  .sx-all:hover{background:#333}
  .sx-link:hover{color:#555}
}

/* ---------- desktop ---------- */
@media (min-width:1024px){
  /* the header shows a real field, not just an icon */
  .tb-right .search-ib{width:252px;display:flex;justify-content:flex-start;gap:10px;margin-right:8px;padding:0 9px 0 15px;border-radius:22px;background:#f6f6f6;box-shadow:none;transition:background .15s,box-shadow .15s}
  .tb-right .search-ib svg{flex:none;width:17px;height:17px}
  .search-ib:hover{background:#fff;box-shadow:0 0 0 1px #111}
  .search-ph{flex:1;font:500 12px var(--f);color:#808080;text-align:left;white-space:nowrap}
  .search-ib kbd{flex:none}

  .search{inset:0 0 auto 0;height:auto;max-height:calc(100vh - 48px);border-radius:0 0 28px 28px;box-shadow:0 30px 70px rgba(0,0,0,.2);animation:sx-drop .22s var(--ease) both}
  @keyframes sx-drop{from{opacity:0;transform:translateY(-14px)}}
  .sx-top{max-width:976px;padding:20px 0 16px;gap:14px}
  .sx-field{height:52px;padding:0 10px 0 22px;border-radius:26px}
  .sx-field>svg{width:20px;height:20px}
  .sx-cancel{display:inline-flex;align-items:center;padding:0 4px 0 10px;font-size:13px;color:#555}
  .sx-cancel:hover{color:#111}
  .sx-body{max-width:976px;padding:0 0 30px}
  .search.has-q .sx-body{padding-bottom:30px}
  .sx-cols{display:grid;grid-template-columns:288px 1fr;gap:56px;border-top:1px solid #efefef}
  .sx-col{min-width:0}
  .sx-sec{padding:22px 0 0}
  .sx-sec{border-top:0;margin-top:0}
  .sx-col>.sx-sec+.sx-sec{margin-top:8px}
  .sx-colors{display:grid;grid-template-columns:repeat(7,1fr);gap:8px 4px;margin:0;padding:0;overflow:visible}
  .sx-color{width:auto}
  .sx-prods{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:0}
  .sx-prod{flex-direction:column;align-items:stretch;gap:10px;padding:8px}
  .sx-img{width:100%;height:auto;aspect-ratio:1;border-radius:14px}
  .sx-dot{width:18px;height:18px;right:9px;bottom:9px}
  .sx-pt b,.sx-pt small{white-space:normal}
  .sx-all{position:static;display:inline-flex;margin:22px 0 0 calc(288px + 56px);min-height:44px;padding:0 22px;border-radius:22px}
  .sx-note{margin-top:0;margin-bottom:12px}
  .sx-none{padding:30px 0 10px}
  .sx-none .sx-sec{max-width:420px;margin:0 auto}
  .sx-none .sx-h{justify-content:center}
  .sx-none .sx-chips{justify-content:center}
}
