/* =============================================================
   Site search: the header search button, the overlay
   (partials/search.php, js/search.js) and the /search page.

   The overlay drops in from the top as a dark frosted panel over a blurred
   page. Results stagger in: partners as preview cards (face, type, design
   count and a peek at three of their designs), merch as rows with a photo,
   partner and price. Partner pages tint the accent to their own colour.
   ============================================================= */

.srch, .srch-page {
  --srch-acc: #FF6B35;
  --srch-acc-soft: rgba(255, 107, 53, .16);
  --srch-bg: rgba(17, 17, 16, .9);
  --srch-line: rgba(255, 255, 255, .09);
  --srch-tx: #F0ECE0;
  --srch-tx2: #a8a49a;
  --srch-ease: cubic-bezier(.22, 1, .36, 1);
  --srch-spring: cubic-bezier(.34, 1.4, .64, 1);
}
body.cp-theme-miss-pookie .srch { --srch-acc: #FF4FA8; --srch-acc-soft: rgba(255, 79, 168, .18); --srch-bg: rgba(19, 13, 29, .92); }
body.cp-theme-desired-koma .srch { --srch-acc: #F87DFE; --srch-acc-soft: rgba(248, 125, 254, .16); --srch-bg: rgba(21, 15, 30, .92); }
body.cp-theme-lavenderstar .srch { --srch-acc: #948BEA; --srch-acc-soft: rgba(148, 139, 234, .2); --srch-bg: rgba(40, 34, 78, .92); }

/* ---------------- header buttons ---------------- */
.nav-search {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line2, #33332f); border-radius: 50%; background: transparent; color: var(--tx, #F0ECE0);
  cursor: pointer; transition: background-color .25s, border-color .25s, color .25s, transform .35s cubic-bezier(.34, 1.4, .64, 1);
}
.nav-search svg { width: 19px; height: 19px; fill: currentColor; }
.nav-search:hover { border-color: var(--acc, #FF6B35); color: var(--acc, #FF6B35); transform: scale(1.06) rotate(-8deg); }
.nav-search:focus-visible { outline: 2px solid var(--acc, #FF6B35); outline-offset: 3px; }
.cpnav-search { border: 0; padding: 0; cursor: pointer; transition: background-color .2s, color .2s, transform .35s cubic-bezier(.34, 1.4, .64, 1); }
.cpnav-search:hover { transform: rotate(-8deg); }

/* ---------------- overlay ---------------- */
html.srch-lock { overflow: hidden; }
.srch { position: fixed; inset: 0; z-index: 400; display: flex; justify-content: center; align-items: flex-start; padding: clamp(12px, 8vh, 90px) 16px 16px; }
.srch[hidden] { display: none; }
.srch-backdrop { position: absolute; inset: 0; background: rgba(6, 6, 6, .6); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); opacity: 0; transition: opacity .35s var(--srch-ease), backdrop-filter .35s var(--srch-ease), -webkit-backdrop-filter .35s var(--srch-ease); }
.srch.is-open .srch-backdrop { opacity: 1; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

.srch-panel {
  position: relative; display: flex; flex-direction: column; width: min(760px, 100%); max-height: min(720px, calc(100dvh - 32px));
  border-radius: 26px; background: var(--srch-bg); border: 1px solid var(--srch-line);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .03), 0 0 80px -40px var(--srch-acc);
  -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
  color: var(--srch-tx); font-family: 'Nunito', system-ui, sans-serif;
  opacity: 0; transform: translateY(-26px) scale(.97); transform-origin: 50% 0;
  transition: opacity .3s var(--srch-ease), transform .5s var(--srch-spring);
  overflow: hidden;
}
.srch.is-open .srch-panel { opacity: 1; transform: none; }

.srch-bar { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 20px; border-bottom: 1px solid var(--srch-line); }
.srch-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.srch-icon { flex: 0 0 auto; width: 24px; height: 24px; fill: var(--srch-acc); transition: transform .4s var(--srch-spring); }
.srch.is-open .srch-icon { animation: srch-icon-in .6s var(--srch-spring) .08s both; }
@keyframes srch-icon-in { from { transform: scale(.4) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.srch-input { flex: 1 1 auto; min-width: 0; padding: 8px 0; border: 0; outline: 0; background: transparent; color: var(--srch-tx); font: 700 clamp(18px, 2.4vw, 22px)/1.3 'Nunito', system-ui, sans-serif; caret-color: var(--srch-acc); }
.srch-input::placeholder { color: rgba(240, 236, 224, .38); }
.srch-input::-webkit-search-cancel-button { display: none; }
.srch-clear, .srch-esc { flex: 0 0 auto; border: 0; cursor: pointer; font-family: inherit; }
.srch-clear { width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .08); color: var(--srch-tx2); font-size: 13px; transition: background-color .2s, color .2s; }
.srch-clear:hover { background: rgba(255, 255, 255, .16); color: var(--srch-tx); }
.srch-esc { padding: 6px 10px; border-radius: 9px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--srch-line); color: var(--srch-tx2); font-size: 11px; font-weight: 800; letter-spacing: .06em; transition: background-color .2s, color .2s; }
.srch-esc:hover { background: var(--srch-acc-soft); color: var(--srch-tx); }
.srch-esc-x { display: none; font-size: 15px; }
.srch-clear:focus-visible, .srch-esc:focus-visible { outline: 2px solid var(--srch-acc); outline-offset: 2px; }
/* A thin light running along the bar while results load. */
.srch-loading { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; opacity: 0; transition: opacity .2s; }
.srch-loading::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--srch-acc), transparent); animation: srch-run 1s linear infinite; }
.srch.is-loading .srch-loading { opacity: 1; }
@keyframes srch-run { from { left: -40%; } to { left: 100%; } }

.srch-results { overflow-y: auto; overscroll-behavior: contain; padding: 6px 12px 16px; scrollbar-width: thin; }
.srch-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.srch-section { padding: 10px 6px 4px; }
.srch-heading { margin: 4px 4px 10px; font: 900 11px/1 'Nunito', system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--srch-tx2); }

/* Items glide in, one after another. */
[data-search-item] { animation: srch-item-in .5s var(--srch-ease) both; animation-delay: calc(min(var(--i, 0), 10) * 35ms); }
@keyframes srch-item-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.srch mark { background: none; color: var(--srch-acc); }

/* Partner previews */
.srch-partners { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.srch-partner { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px 12px 12px; border-radius: 18px; background: rgba(255, 255, 255, .035); border: 1px solid var(--srch-line); color: var(--srch-tx) !important; text-decoration: none; transition: background-color .25s, border-color .25s, transform .35s var(--srch-spring); }
.srch-partner:hover, .srch-partner.is-active { background: var(--srch-acc-soft); border-color: var(--srch-acc); transform: translateY(-2px); }
.srch-avatar { display: grid; place-items: center; width: 56px; height: 56px; overflow: hidden; border-radius: 50%; background: linear-gradient(135deg, var(--srch-acc), #8C5AFF); font: 400 20px/1 'Anton', Impact, sans-serif; color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .12); }
.srch-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; transition: transform .6s var(--srch-ease); }
.srch-partner:hover .srch-avatar img, .srch-partner.is-active .srch-avatar img { transform: scale(1.1); }
.srch-partner-body { display: grid; gap: 2px; min-width: 0; }
.srch-partner-name { overflow: hidden; padding-top: 2px; font: 400 19px/1.25 'Anton', Impact, sans-serif; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis; }
.srch-partner-type { overflow: hidden; font-size: 12.5px; font-weight: 800; color: var(--srch-tx2); white-space: nowrap; text-overflow: ellipsis; }
.srch-partner-meta { font-size: 11.5px; font-weight: 800; color: var(--srch-acc); }
.srch-thumbs { display: flex; align-items: center; }
.srch-thumbs img { width: 38px; height: 38px; object-fit: cover; border-radius: 10px; border: 2px solid #161615; background: #121211; box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .8); transition: transform .4s var(--srch-spring); }
.srch-thumbs img + img { margin-left: -14px; }
.srch-thumbs img:nth-child(1) { transform: rotate(-6deg); }
.srch-thumbs img:nth-child(3) { transform: rotate(6deg); }
.srch-partner:hover .srch-thumbs img, .srch-partner.is-active .srch-thumbs img { transform: rotate(0) translateY(-2px); }
.srch-partner:hover .srch-thumbs img + img, .srch-partner.is-active .srch-thumbs img + img { margin-left: -8px; }
.srch-go { display: none; }

/* Merch rows */
.srch-products { display: grid; gap: 4px; }
.srch-product { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 8px 12px 8px 8px; border-radius: 16px; color: var(--srch-tx) !important; text-decoration: none; transition: background-color .2s, transform .3s var(--srch-ease); }
.srch-product:hover, .srch-product.is-active { background: rgba(255, 255, 255, .06); transform: translateX(4px); }
.srch-product-img { width: 56px; height: 56px; overflow: hidden; border-radius: 12px; background: #121211; box-shadow: inset 0 0 0 1px var(--srch-line); }
.srch-product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--srch-ease); }
.srch-product:hover .srch-product-img img, .srch-product.is-active .srch-product-img img { transform: scale(1.12); }
.srch-product-body { display: grid; gap: 1px; min-width: 0; }
.srch-product-name { overflow: hidden; font-size: 16px; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
.srch-product-by { overflow: hidden; font: 600 14px/1.3 'Raleway', 'Nunito', system-ui, sans-serif; color: var(--srch-tx2); white-space: nowrap; text-overflow: ellipsis; }
.srch-price { font: 400 17px/1 'Anton', Impact, sans-serif; letter-spacing: .03em; color: var(--srch-tx); white-space: nowrap; }
.srch-price s { margin-right: 6px; font-size: 13px; color: var(--srch-tx2); }
.srch-product.is-active .srch-price { color: var(--srch-acc); }

.srch-all { display: block; margin: 10px 6px 0; padding: 13px 16px; border-radius: 14px; background: var(--srch-acc-soft); color: var(--srch-tx) !important; font-weight: 800; font-size: 14.5px; text-align: center; text-decoration: none; transition: background-color .25s, color .25s; }
.srch-all:hover, .srch-all.is-active { background: var(--srch-acc); color: #111 !important; }
.srch-empty { padding: 30px 16px 14px; text-align: center; animation: srch-item-in .45s var(--srch-ease) both; }
.srch-empty-title { font: 400 24px/1.1 'Anton', Impact, sans-serif; letter-spacing: .02em; text-transform: uppercase; }
.srch-note { margin-top: 8px; font-size: 14.5px; font-weight: 600; color: var(--srch-tx2); }
.srch-empty .srch-all { display: inline-block; margin-top: 16px; }

@media (max-width: 640px) {
  .srch { padding: 0; align-items: stretch; }
  .srch-panel { width: 100%; max-height: none; height: 100dvh; border-radius: 0; border: 0; transform: translateY(-14px); }
  .srch-bar { padding: 12px 12px 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
  .srch-esc { width: 38px; height: 38px; padding: 0; border-radius: 50%; }
  .srch-esc-key { display: none; }
  .srch-esc-x { display: inline; }
  .srch-partners { grid-template-columns: 1fr; }
  .srch-results { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .srch-product-by { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .srch-backdrop, .srch-panel, [data-search-item], .srch-empty, .srch-icon, .srch-loading::after { transition: none !important; animation: none !important; }
}
.perf-lite .srch-panel { -webkit-backdrop-filter: none; backdrop-filter: none; background: #141413; }
.perf-lite .srch.is-open .srch-backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(6, 6, 6, .82); }

/* ---------------- /search page ---------------- */
.srch-page-form { position: relative; display: flex; align-items: center; gap: 12px; max-width: 680px; margin: 0 0 30px; padding: 6px 6px 6px 18px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--srch-line); }
.srch-page-form svg { width: 20px; height: 20px; fill: var(--srch-acc); }
.srch-page-form input { flex: 1; min-width: 0; padding: 10px 0; border: 0; outline: 0; background: transparent; color: var(--srch-tx); font: 700 18px/1.3 'Nunito', system-ui, sans-serif; }
.srch-page-form .btn { flex: 0 0 auto; }
.srch-page-form:focus-within { border-color: var(--srch-acc); box-shadow: 0 0 0 4px var(--srch-acc-soft); }
.srch-page .srch-partners { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-bottom: 40px; }
.srch-page .srch-heading { margin: 0 0 14px; }

/* The bell: a signed-in shopper's notifications (App\Services\Notify). */
.nav-bell { position: relative; }
.nav-bell-count {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; box-sizing: border-box;
  display: grid; place-items: center; border-radius: 999px; background: var(--acc, #FF6B35); color: #0A0A0A;
  font: 900 10.5px/1 var(--body, sans-serif); pointer-events: none;
}
.nav-bell:hover .nav-bell-count { transform: rotate(8deg); }
