/* Header part-number search. Loaded on every public page. */
.htp-part-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  z-index: 45;
}
.htp-part-search form {
  display: block;
  position: relative;
  margin: 0;
  width: 200px;
}
.htp-ps-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 34px;
  background: #fff;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.10);
}
.htp-ps-field:focus-within {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 2px 8px rgba(17, 17, 17, 0.16);
}
.htp-part-search label.htp-ps-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.htp-part-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #111;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0 34px 0 11px;
  line-height: 1.2;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  outline: none;
}
.htp-part-search input[type="search"]::-webkit-search-decoration,
.htp-part-search input[type="search"]::-webkit-search-cancel-button,
.htp-part-search input[type="search"]::-webkit-search-results-button,
.htp-part-search input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.htp-part-search input[type="search"]::placeholder {
  color: #555;
  font-weight: 400;
}
.htp-part-search input[type="search"]:focus {
  outline: none;
  box-shadow: none;
}
.htp-ps-icon {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #111;
  cursor: pointer;
}
.htp-ps-icon svg {
  display: block;
}
.htp-ps-icon:hover {
  background: rgba(17, 17, 17, 0.08);
}
.htp-ps-icon:focus-visible {
  outline: none;
  background: rgba(17, 17, 17, 0.08);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
}
.htp-ps-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  width: max(100%, 16.5rem);
  max-width: min(28rem, calc(100vw - 16px));
  max-height: min(60vh, 22rem);
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
  color: #111;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.18);
  z-index: 80;
  padding: 4px 0;
}
.htp-ps-panel.is-open {
  display: block;
}
.htp-ps-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.htp-ps-panel li {
  margin: 0;
}
.htp-ps-panel button.htp-ps-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  color: #111;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 8px 12px;
  cursor: pointer;
  line-height: 1.3;
}
.htp-ps-panel button.htp-ps-item[aria-selected="true"],
.htp-ps-panel button.htp-ps-item:hover,
.htp-ps-panel button.htp-ps-item:focus-visible {
  background: #ffd800;
  outline: none;
}
.htp-ps-panel .htp-ps-part {
  font-weight: 700;
  font-family: ui-monospace, "IBM Plex Mono", Menlo, Consolas, monospace;
  margin-right: 0.5em;
}
.htp-ps-panel .htp-ps-family {
  color: #333;
  font-weight: 400;
  font-size: 12px;
}
.htp-ps-empty,
.htp-ps-status {
  margin: 0;
  padding: 10px 12px 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #111;
}
.htp-ps-empty a {
  color: #111;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

/* Leave room for the sticky table header when scrolling to a row (hash or search). */
table.parts tbody tr {
  scroll-margin-top: 48px;
}

/* Highlight a searched table row or drawing card. */
@keyframes htp-search-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 216, 0, 0.95); }
  60% { box-shadow: 0 0 0 10px rgba(255, 216, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 216, 0, 0); }
}
table.parts tbody tr.is-search-hit td,
table.parts tbody tr.is-search-hit th.col-part,
table.parts tbody tr.is-search-hit:hover td,
table.parts tbody tr.is-search-hit:hover th.col-part,
table.parts tbody tr.is-search-hit:nth-child(even) td,
table.parts tbody tr.is-search-hit:nth-child(even) th.col-part {
  background: #ffd800 !important;
}
table.parts tbody tr.is-search-hit th.col-part {
  box-shadow: inset 3px 0 0 #111, 4px 0 8px rgba(17, 17, 17, 0.06);
  animation: htp-search-pulse 1.15s ease-out 1;
}
.part-card.is-search-hit {
  outline: 3px solid #111;
  outline-offset: 4px;
  box-shadow: 0 0 0 8px #ffd800;
  border-radius: 6px;
  animation: htp-search-pulse 1.15s ease-out 1;
  scroll-margin-top: 16px;
}

@media (max-width: 1180px) {
  /* Page styles load after this file, so beat them on mid-width layout: links
     wrap to a second row so the title and the inline field both fit. */
  .site-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .site-header .header-tools {
    display: contents;
  }
  .site-header .brand {
    order: 1;
    flex: 1 1 0;
    min-width: 0;
  }
  .site-header .site-nav {
    order: 3;
    margin-left: auto;
  }
  .htp-part-search {
    order: 3;
  }
  .htp-part-search form {
    width: 180px;
  }
  .site-header .header-meta {
    display: none !important;
  }
  .site-header .header-links {
    order: 4;
    flex: 1 1 100%;
    justify-content: flex-start;
    min-width: 0;
  }
}

/* On small screens the catalog title + Products would not fit a 140px field
   without crowding the logo, so the control collapses to an icon and expands
   on tap. It stays on the Products row; the header-links row is unchanged. */
@media (max-width: 860px) {
  .htp-part-search {
    order: 3;
  }
  .htp-part-search form {
    width: 34px;
  }
  .htp-part-search:not(.is-open) .htp-ps-field {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.92);
  }
  .htp-part-search:not(.is-open) input[type="search"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    padding: 0;
    border: 0;
    pointer-events: none;
  }
  .htp-part-search.is-open form {
    width: 34px;
  }
  .htp-part-search.is-open .htp-ps-field {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: min(220px, calc(100vw - 28px));
    height: 40px;
    z-index: 50;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 4px 16px rgba(17, 17, 17, 0.18);
  }
  .htp-part-search.is-open input[type="search"] {
    font-size: 16px; /* avoid iOS zoom */
    pointer-events: auto;
    opacity: 1;
    position: static;
    width: 100%;
    height: 100%;
    padding: 0 36px 0 11px;
  }
  .htp-part-search.is-open .htp-ps-panel {
    position: absolute;
    right: 0;
    width: min(28rem, calc(100vw - 16px));
    min-width: 0;
    max-width: min(28rem, calc(100vw - 16px));
    z-index: 80;
  }
}
