/* ============================================================
   search.css — /search results page. Built on the shared tokens from
   public-shell.css (--primary, --border, --radius-*, --shadow-*), so it
   matches the home / trainers / workshops pages. Class prefix: sx-
   (the live dropdown, prefix ss-, is in search-suggest.css).
   ============================================================ */

.sx-wrap { padding: 18px 0 40px; max-width: 1100px; margin: 0 auto; }

/* ---------- search box ---------- */
.sx-hero { margin-bottom: 14px; }
.sx-h1 { font-size: clamp(1.25rem, 3.6vw, 1.7rem); font-weight: 800; letter-spacing: -0.025em; margin-bottom: 12px; }

.ss-form { position: relative; }
.ss-box {
  display: flex; align-items: center; gap: 10px; background: #fff;
  border: 1.5px solid var(--border); border-radius: var(--radius-full);
  padding: 6px 6px 6px 18px; box-shadow: var(--shadow-subtle); transition: var(--transition);
}
.ss-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), var(--shadow-card); }
.ss-icon { font-size: 1.2rem; color: var(--text-subtle); flex: 0 0 auto; }
.ss-box input[type="search"] {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit;
  font-size: 16px; /* 16px: iOS never zooms the page on focus */ color: var(--text-main); padding: 10px 0;
  -webkit-appearance: none; appearance: none;
}
.ss-box input[type="search"]::-webkit-search-cancel-button,
.ss-box input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.ss-box input::placeholder { color: var(--text-subtle); }
.ss-clear { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text-subtle); font-size: 1.25rem; }
.ss-clear:hover { color: var(--text-main); background: #f1f5f9; }
.ss-go {
  flex: 0 0 auto; background: var(--primary); color: #fff; font-weight: 700; font-size: 0.88rem;
  padding: 11px 22px; border-radius: var(--radius-full); transition: var(--transition);
}
.ss-go:hover { background: var(--primary-hover); }
.ss-go:active { transform: scale(0.97); }
@media (max-width: 480px) { .ss-go { padding: 11px 16px; } .ss-box { padding-left: 14px; } }

/* ---------- tabs ---------- */
.sx-tabs-wrap { min-height: 0; }
.sx-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 0 6px; margin: 0 -2px; -webkit-overflow-scrolling: touch; }
.sx-tabs::-webkit-scrollbar { display: none; }
.sx-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: var(--radius-full);
  background: #fff; border: 1px solid var(--border); color: var(--text-muted); font-size: 0.85rem; font-weight: 700;
  white-space: nowrap; flex: 0 0 auto; transition: var(--transition);
}
.sx-tab i { font-size: 1rem; }
.sx-tab em { font-style: normal; font-size: 0.72rem; font-weight: 800; background: #f1f5f9; color: var(--text-muted); border-radius: 999px; padding: 1px 8px; }
.sx-tab:hover { border-color: #bfdbfe; color: var(--primary); }
.sx-tab { border-radius: 0; border-width: 0 0 3px; border-color: transparent; background: transparent; padding: 10px 12px; }
.sx-tab:hover { background: #f8fafc; border-color: transparent; color: var(--text-main); }
.sx-tab.active { background: transparent; border-color: var(--primary); color: var(--primary); box-shadow: none; }
.sx-tab.active em { background: var(--primary-light); color: var(--primary); }

/* ---------- results region ---------- */
.sx-results { display: flex; flex-direction: column; gap: 22px; margin-top: 12px; min-height: 240px; }
.sx-results[data-soft-dim] { opacity: 0.55; transition: opacity 0.15s ease; pointer-events: none; }

.sx-count { font-size: 0.85rem; color: var(--text-muted); }
.sx-count strong { color: var(--text-main); }
.sx-note {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm);
  background: #fffbeb; border: 1px solid #fde68a; color: #78350f; font-size: 0.86rem; line-height: 1.4;
}
.sx-note i { font-size: 1.05rem; margin-top: 1px; flex: 0 0 auto; }
.sx-note a { color: var(--primary); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.sx-note-info { background: var(--primary-50); border-color: #dbeafe; color: #1e3a8a; }

.sx-related { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sx-related-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-subtle); }

.sx-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sx-pills-center { justify-content: center; }
.sx-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: #fff;
  border: 1px solid var(--border); font-size: 0.82rem; font-weight: 600; color: var(--text-main); min-height: 36px; transition: var(--transition);
}
.sx-pill i { color: var(--text-muted); }
.sx-pill-skill i { color: var(--text-muted); }
.sx-pill:hover { border-color: #bfdbfe; background: var(--primary-light); color: var(--primary); }

/* ---------- sections ---------- */
.sx-section { display: flex; flex-direction: column; gap: 10px; }
.sx-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sx-h2 { font-size: 1.02rem; font-weight: 800; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.sx-h2 i { color: var(--text-muted); }
.sx-h2-top i { color: var(--text-muted); }
.sx-h3 { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-subtle); margin: 22px 0 10px; }
.sx-seeall { font-size: 0.84rem; font-weight: 700; color: var(--primary); display: inline-flex; align-items: center; gap: 4px; }
.sx-seeall:hover { text-decoration: underline; text-underline-offset: 3px; }

.sx-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 860px) { .sx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- result card ---------- */
.sx-card {
  position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 14px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle); transition: var(--transition); min-width: 0;
}
.sx-card:hover, .sx-card:focus-within { border-color: var(--border-strong, #cbd5e1); box-shadow: var(--shadow-subtle); }
.sx-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: 1; } /* whole card is one big tap target */
.sx-link:focus-visible { outline: none; }
.sx-card:has(.sx-link:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }

.sx-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sx-title { font-size: 1rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
.sx-sub { font-size: 0.82rem; color: var(--text-muted); line-height: 1.35; }
.sx-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sx-card mark { background: rgba(251, 191, 36, 0.32); color: inherit; border-radius: 3px; padding: 0 1px; }

.sx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.sx-chip { font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--primary-light); color: var(--primary); }
.sx-chip-soft { background: #f1f5f9; color: var(--text-muted); align-self: flex-start; }
.sx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; font-size: 0.76rem; color: var(--text-muted); font-weight: 600; }
.sx-meta i { margin-right: 3px; }
.sx-rate { color: var(--text-main); font-weight: 800; }
.sx-rate i { color: var(--accent-amber-text, #b45309); }
.sx-rate small { color: var(--text-subtle); font-weight: 600; font-size: 0.72rem; }
.sx-new { color: var(--accent-green-text, #047857); font-weight: 800; }
.sx-ok { color: var(--primary); }
.sx-price { color: var(--text-main); font-weight: 800; font-size: 0.86rem; }
.sx-price s { color: var(--text-subtle); font-weight: 600; font-size: 0.74rem; margin-left: 4px; }

.sx-go { display: none; align-self: center; flex: 0 0 auto; font-size: 0.78rem; font-weight: 700; color: var(--primary); white-space: nowrap; opacity: 0; transform: translateX(-4px); transition: var(--transition); }
@media (min-width: 1000px) { .sx-go { display: inline-flex; align-items: center; gap: 4px; } }
.sx-card:hover .sx-go, .sx-card:focus-within .sx-go { opacity: 1; transform: none; }

/* media */
.sx-avatar { position: relative; flex: 0 0 auto; width: 64px; height: 64px; }
.sx-avatar > img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: #f1f5f9; border: 1px solid var(--border-light); }
.sx-flag {
  position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08); overflow: hidden; z-index: 2;
}
.sx-flag img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.sx-thumb { position: relative; flex: 0 0 auto; width: 88px; height: 88px; border-radius: 12px; overflow: hidden; background: var(--primary-light); }
.sx-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sx-thumb-empty { display: grid; place-items: center; color: var(--primary); font-size: 1.8rem; }
.sx-thumb .sx-date {
  position: absolute; left: 6px; top: 6px; background: #fff; border-radius: 8px; padding: 3px 7px; text-align: center;
  font-size: 0.7rem; font-weight: 800; line-height: 1.1; color: var(--text-muted); text-transform: uppercase; box-shadow: var(--shadow-subtle);
}
.sx-thumb .sx-date b { display: block; font-size: 0.95rem; color: var(--text-main); }
.sx-cover { flex: 0 0 auto; width: 64px; height: 88px; border-radius: 8px; overflow: hidden; background: #f1f5f9; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.16); }
.sx-cover img { width: 100%; height: 100%; object-fit: cover; }
.sx-cover.sx-thumb-empty { font-size: 1.6rem; }

/* "Top result" */
.sx-top { border-color: #bfdbfe; background: #fff; box-shadow: var(--shadow-subtle); padding: 18px; }
.sx-top .sx-title { font-size: 1.12rem; }
.sx-top .sx-avatar { width: 76px; height: 76px; }

/* ---------- single-type toolbar / pager ---------- */
.sx-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.sx-field { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }
.sx-field select {
  font: inherit; font-size: 16px; font-weight: 600; color: var(--text-main); background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 30px 8px 12px; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.sx-field select:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.sx-check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.sx-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.sx-check i { color: var(--primary); }
@media (min-width: 860px) { .sx-grid-tab { grid-template-columns: 1fr; } }

.sx-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 0 0; }
.sx-pg { display: inline-flex; align-items: center; gap: 4px; padding: 9px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: 0.84rem; font-weight: 700; color: var(--text-main); }
.sx-pg:hover { border-color: #bfdbfe; color: var(--primary); }
.sx-pg.disabled { opacity: 0.4; pointer-events: none; }
.sx-pg-info { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

/* ---------- empty query ---------- */
.sx-block { display: flex; flex-direction: column; gap: 10px; }
.sx-linkbtn { font: inherit; font-size: 0.8rem; font-weight: 700; color: var(--primary); padding: 4px 8px; border-radius: 8px; }
.sx-linkbtn:hover { background: var(--primary-light); }
.sx-start { display: flex; flex-direction: column; gap: 24px; }
.sx-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sx-topic {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-md); font-size: 0.86rem; font-weight: 700; transition: var(--transition);
}
.sx-topic i { font-size: 1.2rem; color: var(--text-muted); }
.sx-topic:hover { border-color: var(--border-strong, #cbd5e1); background: #f8fafc; }
.sx-browse { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 860px) { .sx-browse { grid-template-columns: repeat(4, 1fr); } }
.sx-browse a { display: flex; flex-direction: column; gap: 2px; padding: 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); transition: var(--transition); }
.sx-browse a i { font-size: 1.4rem; color: var(--text-muted); margin-bottom: 4px; }
.sx-browse a b { font-size: 0.92rem; }
.sx-browse a span { font-size: 0.76rem; color: var(--text-muted); }
.sx-browse a:hover { border-color: var(--border-strong, #cbd5e1); background: #f8fafc; }
.sx-tip { font-size: 0.78rem; color: var(--text-subtle); display: none; }
@media (min-width: 860px) { .sx-tip { display: block; } }
.sx-tip kbd { font: inherit; font-weight: 800; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; background: #fff; color: var(--text-muted); }

/* ---------- nothing found ---------- */
.sx-empty { text-align: center; background: #fff; border: 1px dashed #cbd5e1; border-radius: var(--radius-lg); padding: 34px 20px; }
.sx-empty > i { font-size: 2.6rem; color: var(--text-subtle); }
.sx-empty h2, .sx-empty h3 { font-size: 1.2rem; font-weight: 800; margin: 8px 0 6px; letter-spacing: -0.01em; }
.sx-empty p { color: var(--text-muted); font-size: 0.9rem; max-width: 520px; margin: 0 auto; }
.sx-tips { list-style: none; text-align: left; max-width: 520px; margin: 16px auto 0; display: flex; flex-direction: column; gap: 8px; }
.sx-tips li { position: relative; padding-left: 26px; font-size: 0.86rem; color: var(--text-muted); line-height: 1.45; }
.sx-tips li::before { content: '\eb7b'; font-family: 'remixicon'; position: absolute; left: 0; top: 0; color: var(--accent-green-text, #047857); font-size: 1.05rem; }
.sx-tips em { color: var(--text-main); font-style: normal; font-weight: 700; }
.sx-empty-sm { padding: 26px 16px; }
.sx-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 11px 20px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-weight: 700; font-size: 0.86rem; }
.sx-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; margin-top: 0; white-space: nowrap; }
.sx-btn-primary:hover { background: var(--primary-hover); }
.sx-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; text-align: left;
  margin: 26px auto 0; max-width: 620px; padding: 16px 18px; border-radius: var(--radius-md);
  background: #f8fafc; border: 1px solid var(--border);
}
.sx-cta div { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 240px; }
.sx-cta strong { font-size: 0.95rem; }
.sx-cta span { font-size: 0.8rem; color: var(--text-muted); }

@media (max-width: 480px) {
  .sx-card { padding: 12px; gap: 12px; }
  .sx-thumb { width: 76px; height: 76px; }
  .sx-avatar { width: 56px; height: 56px; }
  .sx-top .sx-avatar { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) { .sx-card, .sx-tab, .sx-pill, .sx-topic, .sx-browse a { transition: none; transform: none !important; } }
