/* ===== Site search trigger button (replaces "Get A Quote") =====
   Premium industrial: compact 40×40 yellow square with white magnifier.
   On hover it smoothly expands to reveal a "SEARCH" label — no jump. */
.site-search-trigger {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  background: var(--yellow) !important;
  color: var(--black) !important;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  text-decoration: none !important;
  white-space: nowrap;
  transition: max-width 0.28s ease, width 0.28s ease, background 0.2s ease, padding 0.28s ease;
}
.site-search-trigger:hover {
  background: var(--yellow-dark) !important;
  max-width: 150px;
  padding: 0 14px !important;
}
.site-search-trigger:active { transform: translateY(1px); }
.site-search-trigger svg { display: inline-block; flex: 0 0 auto; }
.site-search-trigger .search-trigger-text {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: max-width 0.28s ease, opacity 0.22s ease, margin 0.28s ease;
}
.site-search-trigger:hover .search-trigger-text {
  max-width: 90px;
  opacity: 1;
  margin-left: 9px;
}

/* Mobile: stays icon-only, no expand */
@media (max-width: 640px) {
  .site-search-trigger { max-width: 40px !important; padding: 0 !important; }
  .site-search-trigger:hover { max-width: 40px !important; padding: 0 !important; }
  .site-search-trigger .search-trigger-text { display: none !important; }
}

/* ===== Search dialog ===== */
body.ss-lock-scroll { overflow: hidden; }
.site-search-root {
  position: fixed; inset: 0; z-index: 99999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
}
.site-search-root.open {
  display: flex;
  animation: ssRootIn 0.22s ease;
}
@keyframes ssRootIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.ss-backdrop {
  position: absolute; inset: 0;
  background: rgba(17, 17, 17, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.ss-modal {
  position: relative;
  width: min(820px, 100%);
  max-height: 84vh;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ssModalIn 0.24s cubic-bezier(.2, .7, .2, 1);
}
@keyframes ssModalIn {
  from { transform: translateY(18px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.ss-close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px;
  border: 0; background: transparent;
  color: var(--gray-700);
  cursor: pointer;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
  transition: background 0.15s ease, color 0.15s ease;
}
.ss-close:hover { background: var(--gray-100); color: var(--black); }
.ss-head {
  padding: 22px 28px 0 28px;
  background: #fff;
  border-bottom: 0;
}
.ss-title { display: flex; flex-direction: column; gap: 2px; }
.ss-title-zh {
  font-size: 20px; font-weight: 800; color: var(--black);
  position: relative; padding-bottom: 10px;
}
.ss-title-zh::after {
  content: ""; display: block; width: 40px; height: 3px;
  background: var(--yellow); margin-top: 8px;
}
.ss-title-en {
  font-size: 12px; color: var(--gray-500); margin-top: 2px;
}

.ss-input-wrap {
  position: relative;
  margin: 18px 28px 8px;
  display: flex; align-items: center;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 4px;
  padding: 0 14px;
  height: 52px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ss-input-wrap:focus-within {
  border-color: var(--yellow-dark);
  box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.25);
}
.ss-input-icon { color: var(--gray-700); flex: 0 0 auto; margin-right: 12px; }
#siteSearchInput {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 17px; color: var(--black);
  font-family: inherit;
  height: 100%;
}
#siteSearchInput::placeholder { color: var(--gray-500); }
.ss-clear {
  width: 32px; height: 32px; border: 0; background: transparent;
  color: var(--gray-700); cursor: pointer; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
}
.ss-clear:hover { background: var(--gray-100); color: var(--black); }
.ss-clear[style*="display: flex"] { display: flex !important; }

.ss-hot {
  padding: 0 28px 12px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 12.5px; color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  padding-bottom: 14px;
}
.ss-hot-label { color: var(--gray-500); font-weight: 600; }
.ss-hot-pill {
  background: var(--white); color: var(--black);
  border: 1px solid var(--gray-300);
  padding: 4px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  font-family: inherit;
}
.ss-hot-pill:hover { background: var(--yellow); border-color: var(--yellow); }

.ss-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 20px;
  background: #fafafa;
}
.ss-empty {
  text-align: center; color: var(--gray-500); padding: 50px 20px;
  font-size: 14px;
}
.ss-empty-q { color: var(--black); font-weight: 700; margin-top: 8px; font-size: 16px; }

.ss-group { margin-top: 14px; }
.ss-group-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; color: var(--gray-500);
  letter-spacing: 1.2px; text-transform: uppercase;
  padding: 6px 8px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 4px;
}
.ss-group-count {
  background: var(--gray-100); color: var(--gray-700);
  padding: 1px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0;
}
.ss-item {
  display: flex; gap: 14px; align-items: center;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 4px;
  text-decoration: none; color: var(--black);
  margin-bottom: 6px;
  transition: border-color 0.15s, transform 0.05s, background 0.15s;
  cursor: pointer;
}
.ss-item:hover { border-color: var(--yellow); background: #fffbe8; }
.ss-item-img {
  width: 50px; height: 50px; flex: 0 0 auto;
  background: var(--gray-100); border-radius: 3px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.ss-item-img img { width: 100%; height: 100%; object-fit: cover; }
.ss-item-body { flex: 1; min-width: 0; }
.ss-item-title {
  font-size: 14.5px; font-weight: 700; color: var(--black);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ss-item-sub { font-weight: 500; color: var(--gray-500); font-size: 12.5px; }
.ss-item-snippet {
  margin-top: 3px; font-size: 12.5px; color: var(--gray-700);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ss-item-arrow {
  flex: 0 0 auto; color: var(--gray-500); font-size: 18px;
  font-weight: 700; padding: 0 6px;
}
.ss-item:hover .ss-item-arrow { color: var(--yellow-dark); }

/* RTL (Arabic) */
body.ss-rtl .ss-title-zh::after { left: auto; right: 0; }
body.ss-rtl .ss-input-icon { margin-right: 0; margin-left: 12px; }
body.ss-rtl .ss-clear { left: auto; right: auto; }
body.ss-rtl .ss-modal { direction: rtl; }

/* Mobile */
@media (max-width: 640px) {
  .site-search-root { padding: 4vh 8px 8px; }
  .ss-head { padding: 18px 20px 0 20px; }
  .ss-title-zh { font-size: 17px; }
  .ss-title-en { font-size: 11px; }
  .ss-input-wrap { margin: 14px 20px 6px; height: 46px; padding: 0 10px; }
  #siteSearchInput { font-size: 15px; }
  .ss-hot { padding: 0 20px 10px; }
  .ss-body { padding: 4px 12px 14px; }
  .ss-item { padding: 8px; gap: 10px; }
  .ss-item-img { width: 42px; height: 42px; }
  .ss-item-title { font-size: 13.5px; }
  .ss-item-snippet { -webkit-line-clamp: 1; }
}
