/* ============================================================
   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
   ============================================================ */

#sfSearchOverlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

#sfSearchOverlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Backdrop */
.sf-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

/* Card */
.sf-search-card {
  position: relative;
  width: min(640px, calc(100vw - 32px));
  background: linear-gradient(160deg, #0f2207 0%, #111 100%);
  border: 1px solid rgba(153, 238, 45, .14);
  border-radius: 12px;
  padding: 55px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, .7),
    0 0 0 1px rgba(255, 255, 255, .04),
    inset 0 1px 0 rgba(255, 255, 255, .06);
  transform: translateY(-8px);
  transition: transform .22s ease;
}

#sfSearchOverlay.is-open .sf-search-card {
  transform: translateY(0);
}

/* Close button */
.sf-search-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  color: rgba(255, 255, 255, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.sf-search-close:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  border-color: rgba(255, 255, 255, .2);
}

/* Input area */
.sf-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s;
  margin-top: 6px;
}

.sf-search-input-wrap:focus-within {
  border-color: rgba(153, 238, 45, .45);
  background: rgba(255, 255, 255, .07);
  box-shadow: 0 0 0 3px rgba(153, 238, 45, .08);
}

.sf-search-icon {
  flex-shrink: 0;
  margin-left: 16px;
  color: rgba(255, 255, 255, .3);
  pointer-events: none;
}

.sf-search-input {
  flex: 1;
  height: 56px;
  padding: 0 12px;
  background: transparent;
  border: none;
  color: var(--c-white);
  font-family: var(--font-body);
  font-size: 17px;
  outline: none;
}

.sf-search-input::placeholder { color: rgba(255, 255, 255, .28); }
.sf-search-input::-webkit-search-cancel-button { display: none; }

.sf-search-submit {
  flex-shrink: 0;
  width: 52px;
  height: 56px;
  background: var(--c-green, #99ee2d);
  border: none;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: filter .18s;
}

.sf-search-submit:hover {
  filter: brightness(1.1) drop-shadow(0 0 8px rgba(153, 238, 45, .4));
}

/* Results container */
.sf-search-results {
  margin-top: 16px;
  min-height: 0;
}

/* Status states */
.sf-sr-loading,
.sf-sr-error {
  padding: 20px 0 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, .38);
  text-align: center;
}

.sf-sr-empty {
  padding: 28px 0 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, .38);
  text-align: center;
  line-height: 1.5;
}

.sf-sr-empty em { color: rgba(153, 238, 45, .7); font-style: normal; }

/* Result list */
.sf-sr-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sf-sr-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: background .14s;
}

.sf-sr-item:hover { background: rgba(255, 255, 255, .06); }

.sf-sr-img {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .05);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sf-sr-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sf-sr-img-ph {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f2207, #1a2e0a);
  display: block;
}

.sf-sr-info { flex: 1; min-width: 0; }

.sf-sr-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  margin-bottom: 4px;
}

.sf-sr-price {
  display: block;
  font-size: 13px;
  color: var(--c-green, #99ee2d);
  font-weight: 600;
}

.sf-sr-arrow {
  flex-shrink: 0;
  color: rgba(255, 255, 255, .25);
  transition: color .14s, transform .14s;
}

.sf-sr-item:hover .sf-sr-arrow {
  color: var(--c-green, #99ee2d);
  transform: translateX(3px);
}

.sf-sr-see-all {
  display: block;
  margin-top: 8px;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: rgba(153, 238, 45, .8);
  text-decoration: none;
  border-top: 1px solid rgba(255, 255, 255, .06);
  transition: color .14s;
}

.sf-sr-see-all:hover { color: #99ee2d; }
.sf-sr-see-all em { font-style: normal; }

/* Mobile: fake search bar in mobile nav */
.header__mobile-search-fake {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 0 14px 0 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  color: rgba(255, 255, 255, .38);
  font-family: var(--font-body);
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s, color .15s;
}

.header__mobile-search-fake:hover,
.header__mobile-search-fake:focus-visible {
  border-color: rgba(153, 238, 45, .35);
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .55);
  outline: none;
}

/* Override parent-theme svg rule that uses position:absolute */
.header__mobile-search-wrap .header__mobile-search-fake svg {
  position: static;
  right: auto;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: currentColor;
  pointer-events: none;
}

.header__mobile-search-fake span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Mobile: full-screen overlay ── */
@media (max-width: 640px) {
  #sfSearchOverlay { align-items: flex-start; }

  .sf-search-card {
    width: 100%;
    min-height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 56px 16px 20px;
    transform: none !important;
  }

  .sf-search-close { top: 14px; right: 14px; }

  .sf-search-input { height: 52px; font-size: 16px; }
  .sf-search-submit { height: 52px; width: 48px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  #sfSearchOverlay,
  .sf-search-card { transition: none !important; }
}
