/* Search: a centred card that opens under the header, with a rounded field and product rows with thumbnails.
   js/search.js sets --search-top to the bottom edge of the header (the announcement bar may sit above it). */
.search { position: fixed; inset: 0; z-index: 95; visibility: hidden; transition: visibility 0s 0.3s; }
.search.is-open { visibility: visible; transition-delay: 0s; }
.search-overlay { position: absolute; inset: 0; background: rgba(9, 9, 11, 0.45); opacity: 0; transition: opacity 0.3s var(--ease); }
.search.is-open .search-overlay { opacity: 1; }
.search-panel { position: absolute; top: calc(var(--search-top, var(--header-h)) + 14px); left: 50%; width: min(680px, calc(100% - 2 * var(--gutter))); max-height: calc(100svh - var(--search-top, var(--header-h)) - 32px); overflow-y: auto; background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 70px rgba(9, 9, 11, 0.28); transform: translate(-50%, -8px); opacity: 0; transition: transform 0.35s var(--ease), opacity 0.25s var(--ease); }
.search.is-open .search-panel { transform: translate(-50%, 0); opacity: 1; }
.search-inner { padding: 14px; }

.search-field { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 6px 0 18px; background: #f4f5f8; border: 1px solid transparent; border-radius: 12px; transition: border-color var(--dur-fast), background var(--dur-fast); }
.search-field:focus-within { background: var(--white); border-color: var(--ink); }
.search-field svg { flex: none; color: var(--muted); }
.search-input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; font-size: 16.5px; font-weight: 500; letter-spacing: -0.01em; }
.search-input:focus-visible { outline: none; }
.search-input::placeholder { color: #8e8e94; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-close { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--muted); transition: color var(--dur-fast), background var(--dur-fast); }
.search-close:hover { color: var(--ink); background: rgba(9, 9, 11, 0.06); }

.search-hint { margin: 18px 6px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.search-empty { margin: 18px 6px 10px; font-size: 14.5px; color: var(--muted); }
.search-results { margin-top: 8px; display: grid; gap: 2px; }
.search-item { display: flex; align-items: center; gap: 16px; padding: 10px; border-radius: 12px; transition: background var(--dur-fast); }
.search-item:hover, .search-item.is-active { background: #f4f5f8; }
.search-item:focus-visible { outline: none; background: #f4f5f8; box-shadow: inset 0 0 0 1px var(--ink); }
.search-thumb { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: 8px; background: var(--soft); }
.search-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.search-meta { margin-top: 2px; font-size: 13px; color: var(--muted); }
.search-price { margin-left: auto; font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.search-item mark { background: none; color: inherit; box-shadow: inset 0 -2px 0 var(--accent); }

@media (max-width: 600px) {
  .search-panel { top: calc(var(--search-top, var(--header-h)) + 8px); width: calc(100% - 24px); border-radius: 14px; }
  .search-inner { padding: 10px; }
  .search-field { height: 52px; }
  .search-thumb { width: 48px; height: 48px; }
  .search-item { gap: 12px; padding: 8px; }
}

/* Pill-shaped search field: the placeholder text comes from the "search.ph" translation key, the magnifier sits at the right,
   the close button only appears once something has been typed. */
.search-field { padding: 0 20px 0 24px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); height: 58px; }
.search-field:focus-within { border-color: var(--ink); }
.search-input { font-size: 17px; font-weight: 500; color: var(--ink); }
.search-input::placeholder { color: #6f6f75; font-weight: 500; }
.search-mag { flex: none; display: grid; place-items: center; color: var(--ink); }
.search-input:placeholder-shown ~ .search-close { display: none; }
