/* Shifter Smart Search - native Parskala overlay.
   Theme CSS does the heavy lifting; this file only splits desktop/mobile chrome,
   styles the added smart-search box, and provides skeletons/toast/chips in theme colors. */

.sss-scope { font-family: inherit; }

/* ---------- desktop / mobile chrome split ---------- */
.sss-head-mobile { display: none !important; }
.sss-sides-desktop { display: block !important; }
@media (max-width: 1024px) {
  .sss-head-desktop { display: none !important; }
  .sss-head-mobile { display: block !important; }
  .sss-sides-desktop { display: none !important; }
}

/* the added smart box spans full width above the archive columns */
.sss-smart-box {
  background: #fff;
  border: 1px solid #ececf1;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 4px 18px -8px rgba(11, 44, 110, .12);
}

/* main search bar - native form_search colors */
.sss-main-search { position: relative; margin: 0 0 12px; }
.sss-main-search .prk_input_serach {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  border: 1.5px solid #d7dbe4;
  border-radius: 12px;
  /* dir=rtl: text starts at the right edge, both actions dock at the left end */
  padding: 11px 14px 11px 94px;
  font-size: 14px;
  font-family: inherit;
  background: #f8fafc;
  outline: none;
  transition: border-color .2s, background-color .2s;
}
.sss-main-search .prk_input_serach:focus { border-color: #0b2c6e; background: #fff; }

/* one dock for the two field actions: camera (picture search) + submit */
.sss-search-actions {
  position: absolute;
  left: 5px; top: 50%;
  transform: translateY(-50%);
  display: flex; align-items: center;
  direction: ltr;
}
.sss-search-actions .sss-search-btn {
  position: static; transform: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  color: #0b2c6e; cursor: pointer; font-size: 18px;
}
.sss-search-actions .sss-search-btn:hover { background: #e8eefb; }

/* picture search lives in the field itself - on phones the sidebar drawer is unreachable */
.sss-photo-slot { position: relative; display: inline-flex; }
.sss-photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sss-photo-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; border: 0; background: transparent;
  border-radius: 10px; color: #0b2c6e; cursor: pointer;
  font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.sss-photo-btn:hover { background: #e8eefb; }
.sss-photo-btn:active { background: #dbe6fb; }
.sss-photo-btn:focus-visible { outline: 2px solid #0b2c6e; outline-offset: 2px; }
.sss-photo-ico { font-size: 21px; line-height: 1; }
.sss-photo-thumb, .sss-photo-x { display: none; }
.sss-photo-slot.is-busy .sss-photo-ico, .sss-photo-slot.is-active .sss-photo-ico { display: none; }
.sss-photo-slot.is-busy .sss-photo-thumb, .sss-photo-slot.is-active .sss-photo-thumb {
  display: block; width: 32px; height: 32px; border-radius: 8px;
  object-fit: cover; background: #e2e8f0;
}
.sss-photo-slot.is-busy { animation: sss-photo-pulse 1.05s ease-in-out infinite; }
.sss-photo-slot.is-active .sss-photo-x {
  display: flex; align-items: center; justify-content: center;
  position: absolute; right: 2px; top: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: #f30a49; color: #fff; font-size: 12px; font-style: normal;
  box-shadow: 0 0 0 2px #fff;
}
@keyframes sss-photo-pulse { 50% { opacity: .4; } }
/* no usable preview (unreadable upload or image-less match): keep the glyph, the badge still marks the search */
.sss-photo-slot.no-photo .sss-photo-thumb { display: none; }
.sss-photo-slot.no-photo .sss-photo-ico { display: inline; }
@media (prefers-reduced-motion: reduce) { .sss-photo-slot.is-busy { animation: none; } }
@media (max-width: 768px) {
  .sss-main-search .prk_input_serach { min-height: 48px; font-size: 15px; padding-left: 102px; }
  /* 44px hit areas once the field is finger-sized */
  .sss-search-actions .sss-search-btn, .sss-photo-btn { width: 44px; height: 44px; }
  .sss-photo-ico { font-size: 22px; }
  .sss-photo-slot.is-busy .sss-photo-thumb, .sss-photo-slot.is-active .sss-photo-thumb {
    width: 34px; height: 34px;
  }
}

@media (max-width: 560px) {
  /* typing already searches live and the keyboard has its own search key -
     on a narrow field the magnifier is 44px of dead weight next to the camera */
  .sss-search-actions .sss-search-btn { display: none; }
  .sss-main-search .prk_input_serach { padding-left: 56px; }
}

/* ---------- embeddable box: [shifter_search_panel style="box"] ---------- */
.sss-box {
  background: #fff; border: 1px solid #ececf1; border-radius: 14px; padding: 14px;
  box-shadow: 0 4px 18px -8px rgba(11, 44, 110, .12);
}
.sss-box .sss-main-search { margin: 0; }
.sss-box-more {
  display: inline-block; margin-top: 9px; color: #0b2c6e;
  font-size: 12px; font-weight: 700; text-decoration: none;
}
.sss-box-more:hover { text-decoration: underline; }

/* quick-SKU chips */
.sss-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 12px; }
.sss-chips-title { color: #64748b; font-weight: 600; }
.sss-chip {
  background: #f1f5f9; border: 1px solid #e2e8f0; color: #334155;
  border-radius: 8px; padding: 3px 9px; font-size: 11px; text-decoration: none;
  direction: ltr; font-family: monospace; transition: all .15s;
}
.sss-chip:hover { background: #e8eefb; border-color: #0b2c6e; color: #0b2c6e; }
.sss-reset-all { margin-inline-start: auto; color: #f30a49; font-weight: 700; text-decoration: none; font-size: 12px; }
.sss-reset-all:hover { text-decoration: underline; }

/* bike selector grid */
.sss-bike-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 1024px) { .sss-bike-grid { grid-template-columns: repeat(2, 1fr); } }
.sss-bike-field label { display: block; font-size: 11px; font-weight: 700; color: #0b2c6e; margin-bottom: 4px; }
.sss-select, .sss-sku-input {
  width: 100%; border: 1.5px solid #d7dbe4; border-radius: 10px;
  background: #f8fafc; padding: 8px 10px; font-size: 12px; font-family: inherit;
  color: #1e293b; outline: none;
}
.sss-select:focus { border-color: #0b2c6e; background: #fff; }
.sss-sku-input { direction: ltr; font-family: monospace; text-transform: uppercase; }

/* ---------- grid / cards ---------- */
.sss-grid { min-height: 200px; }
@media (max-width: 768px) {
  .sss-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
}

.sss-no-img {
  width: 100%; padding-top: 100%; position: relative; color: #cbd5e1; font-size: 10px;
}
.sss-no-img::after { content: 'بدون تصویر'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* added feature chips inside native cards */
.sss-card-chips { display: flex; flex-direction: column; gap: 3px; margin: 5px 0; }
.sss-card-sku {
  font-family: monospace; direction: ltr; text-align: right;
  background: #f1f5f9; color: #0b2c6e; font-weight: 700;
  border-radius: 6px; padding: 2px 7px; font-size: 10.5px;
}
.sss-card-compat { background: #ecfdf3; color: #067647; border-radius: 6px; padding: 2px 7px; font-size: 10.5px; font-weight: 600; }
.sss-card-match { background: #fef2f2; color: #f30a49; border-radius: 6px; padding: 2px 7px; font-size: 10.5px; font-weight: 700; }
.sss-card-match.sss-match-suggestion { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.sss-card-chips.sss-visual-result { gap: 0; }
.sss-card-chips.sss-visual-result .sss-visual-match-chip { background: transparent; color: #64748b; border: 0; border-radius: 0; padding: 0; font-size: 10.5px; font-weight: 700; }

/* Visual results show one compact score only; keep gate prose and evidence out of cards. */
.sss-scope.sss-visual-results-active .sss-vision-gate,
.sss-scope.sss-visual-results-active .sss-google-check,
.sss-scope.sss-visual-results-active .sss-card-gate-evidence,
.sss-scope.sss-visual-results-active .sss-match-gate-verified,
.sss-scope.sss-visual-results-active .sss-match-gate-unverified,
.sss-scope.sss-visual-results-active .sss-card-chips > :not(.sss-visual-match-chip),
.sss-scope.sss-visual-results-active .sss-card-match:not(.sss-visual-match-chip),
.sss-scope.sss-visual-results-active .sss-card-sku,
.sss-scope.sss-visual-results-active .sss-card-compat {
  display: none !important;
}
.sss-scope.sss-visual-results-active .sss-vision-gate[hidden],
.sss-scope.sss-visual-results-active .sss-google-check[hidden] { display: none !important; }

/* Keep gate and reverse-search diagnostics internal; only the score belongs on result cards. */
.sss-vision-gate,
.sss-google-check,
.sss-card-gate-evidence,
.sss-match-gate-verified,
.sss-match-gate-unverified {
  display: none !important;
}

/* Image-search cards stay clean: no floating cart icon or quick-add drawer. */
.sss-scope.sss-visual-results-active .quick_add2cart,
.sss-scope.sss-visual-results-active .variable-cart-product {
  display: none !important;
}

/* ---------- active filter terms (native wc-layered-nav look) ---------- */
.sss-term.active { color: #0b2c6e !important; font-weight: 800; }
.sss-term.active::before { content: '✓ '; color: #08c96f; font-weight: 900; }
.wc-layered-nav-term .sss-term.active + .count { color: #0b2c6e; }

/* ---------- price widget (native wrapper, our input) ---------- */
.sss-price-wrap { padding: 4px 2px; }
.sss-price-input {
  width: 100%; border: 1.5px solid #d7dbe4; border-radius: 9px; padding: 7px 10px;
  font-size: 12px; font-family: inherit; margin-bottom: 8px; outline: none; background: #f8fafc;
}
.sss-price-apply { font-family: inherit; }
.sss-price-hint { display: block; font-size: 10.5px; color: #94a3b8; margin-top: 6px; }

/* ---------- visual search widget ---------- */
.sss-visual-widget .sss-dropzone {
  border: 2px dashed #f3a9bb; border-radius: 12px; background: #fff;
  text-align: center; padding: 18px 10px; margin: 10px 0; cursor: pointer; transition: all .2s;
}
.sss-visual-widget .sss-dropzone:hover, .sss-dropzone.sss-drop-hot { border-color: #f30a49; background: #fff5f7; }
.sss-dropzone input[type="file"] { display: none; }
.sss-dropzone i { font-size: 26px; color: #f30a49; display: block; margin-bottom: 6px; }
.sss-drop-title { font-size: 12px; font-weight: 800; color: #1e293b; margin: 0 0 3px; }
.sss-drop-sub { font-size: 10.5px; color: #94a3b8; margin: 0; }
.sss-scan-status {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid #dbeafe; background: #f8fafc; border-radius: 12px; padding: 8px; margin-bottom: 8px;
}
.sss-scanned-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1.5px solid #0b2c6e; flex-shrink: 0; }
.sss-scan-text { flex: 1; min-width: 0; }
.sss-scan-badge { display: inline-block; background: #08c96f; color: #fff; font-size: 10px; font-weight: 800; border-radius: 6px; padding: 2px 8px; margin-bottom: 3px; }
.sss-scan-label { font-size: 11px; color: #334155; font-weight: 700; margin: 0; }
.sss-scan-label:empty { display: none; }
.sss-scan-status.is-visual-suggestion { border-color: #fed7aa; background: #fffaf0; }
.sss-scan-status.is-visual-suggestion .sss-scan-badge { background: #b45309; }
.sss-google-check { border: 1px solid #dbeafe; background: #f8fafc; border-radius: 10px; padding: 10px; margin: 0 0 10px; font-size: 11px; color: #334155; }
.sss-google-check[hidden] { display: none; }
.sss-google-check > strong { display: block; font-size: 11px; margin-bottom: 5px; color: #0b2c6e; }
.sss-google-check-text { margin: 0 0 6px; line-height: 1.8; }
.sss-google-check-sources { display: flex; flex-wrap: wrap; gap: 4px 12px; list-style: none; margin: 0 0 6px; padding: 0; }
.sss-google-check-sources a { color: #1558a6; text-decoration: underline; }
.sss-google-search-suggestions { width: 100%; height: 100px; border: 0; background: #fff; }
.sss-vision-gate { border: 1px solid #fed7aa; background: #fffaf0; color: #7c2d12; border-radius: 10px; padding: 10px; margin: 0 0 10px; font-size: 11px; }
.sss-vision-gate[hidden] { display: none; }
.sss-vision-gate > strong { display: block; font-size: 11px; margin-bottom: 5px; }
.sss-vision-gate-text { margin: 0; line-height: 1.8; }
.sss-vision-gate[data-status="confirmed"] { border-color: #a7f3d0; background: #f0fdf4; color: #166534; }
.sss-vision-gate[data-status="ambiguous"] { border-color: #fcd34d; background: #fffbeb; color: #854d0e; }
.sss-vision-gate[data-status="rejected"] { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.sss-card-match.sss-match-gate-verified { background: #f0fdf4; color: #166534; border: 1px solid #a7f3d0; }
.sss-card-match.sss-match-gate-unverified { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.sss-card-gate-evidence { color: #475569; font-size: 10px; line-height: 1.7; padding: 1px 3px; }
.sss-scan-clear { background: #fff; border: 1px solid #e2e8f0; color: #64748b; border-radius: 8px; padding: 5px 10px; font-size: 11px; cursor: pointer; font-family: inherit; }
.sss-scan-clear:hover { color: #f30a49; border-color: #f30a49; }

/* ---------- load more / skeleton / empty ---------- */
.sss-loadmore-wrap { text-align: center; padding: 18px 0 6px; }
.sss-loadmore-btn { font-family: inherit; padding: 9px 26px !important; border-radius: 10px !important; font-weight: 700; }
.sss-loadmore-info { font-size: 11px; color: #94a3b8; margin-top: 6px; }

.sss-skel { list-style: none; }
.sss-skel .product-box-inner { background: #fff; border: 1px solid #ececf1; border-radius: 14px; padding: 10px; }
.sss-skel-img { width: 100%; padding-top: 100%; border-radius: 10px; }
.sss-skel-img, .sss-skel-line { background: linear-gradient(90deg, #f1f5f9 25%, #e7edf5 37%, #f1f5f9 63%); background-size: 400% 100%; animation: sss-shimmer 1.3s ease infinite; }
.sss-skel-line { height: 12px; border-radius: 6px; margin-top: 9px; }
.sss-skel-line.w80 { width: 80%; } .sss-skel-line.w60 { width: 60%; } .sss-skel-line.w40 { width: 40%; }
@keyframes sss-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.sss-empty { margin-top: 20px; }
.sss-empty .sss-empty-reset { display: inline-block; margin-top: 10px; color: #0b2c6e; font-weight: 800; }

/* ---------- toast ---------- */
.sss-toast {
  position: fixed; bottom: 86px; right: 50%; transform: translateX(50%) translateY(16px);
  background: #0b2c6e; color: #fff; font-size: 12.5px; font-weight: 700;
  border-radius: 12px; padding: 11px 18px; z-index: 99997;
  box-shadow: 0 12px 30px -8px rgba(11, 44, 110, .5);
  opacity: 0; transition: all .3s; max-width: 88vw; text-align: center;
}
.sss-toast-in { opacity: 1; transform: translateX(50%) translateY(0); }

/* drawer copies: keep widget list scrollable inside remodal body */
.sss-sides-drawer { padding: 10px; }
.sss-sides-drawer .widget { list-style: none; }
