/* ============================================================
   SEARCH RESULTS PAGE — search.css
   ============================================================ */


/* ── Search Hero ─────────────────────────────────────────── */
.search-hero {
  padding-top: calc(var(--header-h) + clamp(32px, 4vw, 52px));
  padding-bottom: clamp(28px, 3.5vw, 44px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  margin-bottom: clamp(28px, 3.5vw, 44px);
}

/* Big search bar */
.search-bar {
  position: relative;
  margin-bottom: clamp(22px, 2.8vw, 32px);
}

.search-bar__input {
  width: 100%;
  height: clamp(52px, 6vw, 64px);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--c-white);
  font-family: var(--font-body);
  font-size: clamp(15px, 1.6vw, 17px);
  padding: 0 clamp(48px, 6vw, 64px) 0 clamp(20px, 2.5vw, 28px);
  outline: none;
  transition: border-color .2s, background .2s;
}

.search-bar__input::placeholder { color: rgba(255, 255, 255, .28); }

.search-bar__input:focus {
  border-color: rgba(153, 238, 45, .4);
  background: rgba(255, 255, 255, .07);
}

.search-bar__btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: clamp(48px, 6vw, 64px);
  background: var(--c-green);
  border: none;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: filter .2s;
}

.search-bar__btn:hover {
  filter: brightness(1.08) drop-shadow(0 0 12px rgba(153, 238, 45, .4));
}

.search-bar__btn svg { width: 20px; height: 20px; }

/* Results meta row */
.search-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.search-meta__heading {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 34px);
  color: var(--c-white);
  line-height: 1.1;
}

.search-meta__heading em {
  color: var(--c-green);
  font-style: normal;
}

.search-meta__count {
  font-size: 13px;
  color: rgba(255, 255, 255, .35);
  white-space: nowrap;
}


/* ── Toolbar (sort) ──────────────────────────────────────── */
.search-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: clamp(20px, 2.5vw, 32px);
}

.search-toolbar__label {
  font-size: 13px;
  color: rgba(255, 255, 255, .38);
  white-space: nowrap;
}


/* ── Product grid (reuses .shop-grid from shop.css) ──────── */
.search-grid-wrap { margin-bottom: var(--section-gap); }

/* Override grid columns for search layout (no sidebar) */
.search-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}


/* ── Empty state ─────────────────────────────────────────── */
.search-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  margin-bottom: var(--section-gap);
}

.search-empty.is-visible { display: flex; }

.search-empty__icon {
  color: rgba(255, 255, 255, .1);
  margin-bottom: 24px;
}

.search-empty__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  color: var(--c-white);
  margin-bottom: 12px;
}

.search-empty__text {
  font-size: 15px;
  color: rgba(255, 255, 255, .4);
  margin-bottom: 28px;
  line-height: 1.55;
}


/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .search-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .search-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .search-toolbar { justify-content: space-between; }
}

@media (max-width: 420px) {
  .search-grid { gap: 8px; }
}


/* ============================================================
   SEARCH OVERLAY — command palette (desktop) / full-screen (mobile)
   Front-page cyber style. Tokens: --cs-* (layout.css, global).
   ============================================================ */
:root {
  --sov-red:   var(--cs-red, #F5222D);
  --sov-orange: var(--cs-orange, #FF6B00);
  --sov-card:  var(--cs-bg-card, #0D1018);
  --sov-bg0:   var(--cs-bg-0, #080A0E);
  --sov-txt:   var(--cs-txt, #F0F2F8);
  --sov-txt2:  var(--cs-txt2, #8B8F9A);
  --sov-txt3:  var(--cs-txt3, #4A4E5A);
  --sov-bdr:   var(--cs-bdr, rgba(255, 255, 255, 0.07));
  --sov-bdr2:  var(--cs-bdr2, rgba(255, 255, 255, 0.13));
}

body.search-ov-lock { overflow: hidden; }

.search-ov {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(70px, 12vh, 140px) 20px 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.search-ov[hidden] { display: none; }
.search-ov.is-open { opacity: 1; }

/* dimmed + blurred backdrop */
.search-ov__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 8, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}
/* film-grain noise over the backdrop */
.search-ov__backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.4;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

/* the command palette panel */
.search-ov__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - clamp(90px, 14vh, 160px));
  display: flex;
  flex-direction: column;
  background: var(--sov-card);
  border: 1px solid var(--sov-bdr2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 34, 45, 0.06);
  overflow: hidden;
  transform: translateY(-14px) scale(0.985);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.28s ease;
}
.search-ov.is-open .search-ov__panel { transform: translateY(0) scale(1); opacity: 1; }

/* red top accent + glow */
.search-ov__panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 4;
  background: linear-gradient(90deg, transparent, var(--sov-red), var(--sov-orange), transparent);
}
.search-ov__glow {
  position: absolute;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 480px; height: 240px;
  background: radial-gradient(ellipse at top, rgba(245, 34, 45, 0.16) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

/* ── search bar ── */
.search-ov__bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px;
  border-bottom: 1px solid var(--sov-bdr);
  background: rgba(255, 255, 255, 0.015);
}
.search-ov__bar-icon {
  display: flex;
  flex-shrink: 0;
  color: var(--sov-red);
}
.search-ov__bar-icon svg { width: 22px; height: 22px; }

.search-ov__input {
  flex: 1;
  min-width: 0;
  height: 44px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--sov-txt);
  font-family: 'Barlow Condensed', 'Rajdhani', sans-serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.search-ov__input::placeholder { color: var(--sov-txt3); font-weight: 500; }
.search-ov__input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search-ov__submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  height: 44px;
  padding: 0 22px;
  background: linear-gradient(135deg, var(--sov-red), var(--sov-orange));
  border: none;
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(9px 0%, 100% 0%, calc(100% - 9px) 100%, 0% 100%);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.15s ease;
}
.search-ov__submit svg { width: 15px; height: 15px; }
.search-ov__submit::after {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}
.search-ov__submit:hover { box-shadow: 0 6px 28px rgba(245, 34, 45, 0.45); transform: translateY(-1px); }
.search-ov__submit:hover::after { left: 130%; }

.search-ov__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sov-bdr2);
  color: var(--sov-txt2);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.search-ov__close svg { width: 18px; height: 18px; }
.search-ov__close:hover { border-color: var(--sov-red); color: var(--sov-red); background: rgba(245, 34, 45, 0.08); }

/* ── body / results ── */
.search-ov__body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 34, 45, 0.4) transparent;
}
.search-ov__body::-webkit-scrollbar { width: 8px; }
.search-ov__body::-webkit-scrollbar-thumb { background: rgba(245, 34, 45, 0.35); }
.search-ov__body::-webkit-scrollbar-track { background: transparent; }

.search-ov__status {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  color: var(--sov-txt2);
  margin-bottom: 14px;
  min-height: 18px;
}
.search-ov__status a { color: var(--sov-red); text-decoration: none; font-weight: 600; }
.search-ov__hint { color: var(--sov-txt3); }
.search-ov__count {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sov-txt);
}
.search-ov__empty strong { color: var(--sov-txt); }

.search-ov__loading { display: inline-flex; align-items: center; gap: 9px; color: var(--sov-txt2); }
.search-ov__spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(245, 34, 45, 0.25);
  border-top-color: var(--sov-red);
  border-radius: 50%;
  animation: sovSpin 0.7s linear infinite;
}
@keyframes sovSpin { to { transform: rotate(360deg); } }

/* results grid — reuses site .prod-card styling */
.search-ov__results.search-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.search-ov__results.is-loading { opacity: 0.5; pointer-events: none; }
.search-ov__results:empty { display: none; }

/* prod-card cards inside the search overlay (compact sizing) */
.search-ov__results .prod-card { min-width: 0; }
.search-ov__results .prod-img { height: 140px; }
.search-ov__results .prod-body { padding: 10px 12px 14px; }
.search-ov__results .prod-skin-name { font-size: 14px; }
.search-ov__results .prod-weapon-type { font-size: 11px; }
.search-ov__results .prod-price { font-size: 16px; }
.search-ov__results .btn-prod-buy { font-size: 10px; padding: 7px 11px; }

/* footer — view all */
.search-ov__foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--sov-bdr);
  display: flex;
  justify-content: center;
}
.search-ov__foot[hidden] { display: none; }
.search-ov__viewall {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 28px;
  background: transparent;
  border: 1px solid var(--sov-bdr2);
  color: var(--sov-txt2);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  clip-path: polygon(9px 0%, 100% 0%, calc(100% - 9px) 100%, 0% 100%);
  transition: border-color 0.25s, color 0.25s, background 0.25s, gap 0.25s;
}
.search-ov__viewall svg { width: 15px; height: 15px; }
.search-ov__viewall:hover {
  border-color: var(--sov-red);
  color: var(--sov-red);
  background: rgba(245, 34, 45, 0.06);
  gap: 13px;
}

/* keyboard hints */
.search-ov__kbd {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 18px;
  padding: 11px 18px;
  border-top: 1px solid var(--sov-bdr);
  background: rgba(0, 0, 0, 0.25);
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  color: var(--sov-txt3);
}
.search-ov__kbd kbd {
  display: inline-block;
  padding: 2px 7px;
  margin-right: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--sov-bdr2);
  border-radius: 3px;
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  color: var(--sov-txt2);
}

/* ── tablet / mobile ── */
@media (max-width: 880px) {
  .search-ov__results.search-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
  /* full-screen overlay on mobile */
  .search-ov { padding: 0; align-items: stretch; }
  .search-ov__panel {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border: none;
  }
  .search-ov__bar {
    padding: 14px 12px;
    padding-top: max(14px, env(safe-area-inset-top));
    gap: 8px;
  }
  .search-ov__input { font-size: 21px; height: 42px; }
  .search-ov__submit { padding: 0 14px; }
  .search-ov__submit-text { display: none; }
  .search-ov__submit { width: 46px; justify-content: center; }
  .search-ov__close { width: 46px; height: 46px; }
  .search-ov__results.search-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .search-ov__kbd { display: none; }
}

@media (max-width: 380px) {
  .search-ov__results.search-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}
