/* ZumaParts Fitment Search — public widget styles. Scoped under zp-fitment-*
   so nothing collides with the storefront's own design system; safe to load
   standalone (shortcode on a bare WP page) or alongside the site CSS. */

.zp-fitment-selector,
.zp-fitment-results {
  box-sizing: border-box;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}
.zp-fitment-selector *,
.zp-fitment-results * {
  box-sizing: border-box;
}

/* Compact vehicle finder — mirrors zp-header.html's Find-by-Vehicle bar
   (same colors/fields/make-logo dropdown) at a smaller, shop-page-friendly
   size. */
.zp-fitment-selector {
  --zp-blue: #2767B0;
  --zp-blue-deep: #1C4E85;
  --zp-slate: #32353A;
  max-width: 640px;
}
.zp-fitment-selector__row {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.zp-fitment-selector__field,
.zp-fitment-selector__make-toggle {
  padding: 9px 10px;
  border: 1.5px solid #DCDFE4;
  border-radius: 3px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--zp-slate);
  background: #F4F5F7;
  outline: none;
  height: 36px;
}
.zp-fitment-selector__field {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}
.zp-fitment-selector__field--year { flex: 0 1 76px; }
.zp-fitment-selector__field:focus { border-color: var(--zp-blue); background: #fff; }
.zp-fitment-selector__field:disabled { color: #8B8E94; cursor: not-allowed; }
.zp-fitment-selector__field--part[hidden] { display: none; }

/* Make — logo dropdown */
.zp-fitment-selector__make { position: relative; flex: 1.1 1 0; min-width: 0; }
.zp-fitment-selector__make-native { display: none; }
.zp-fitment-selector__make-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  text-align: left;
}
.zp-fitment-selector__make-toggle-inner { display: flex; align-items: center; gap: 6px; min-width: 0; }
.zp-fitment-selector__make-toggle-inner span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zp-fitment-selector__make-toggle svg { flex-shrink: 0; transition: transform 0.2s; color: #8B8E94; }
.zp-fitment-selector__make.is-open .zp-fitment-selector__make-toggle { border-color: var(--zp-blue); background: #fff; }
.zp-fitment-selector__make.is-open .zp-fitment-selector__make-toggle svg { transform: rotate(180deg); }

.zp-fitment-selector__make-logo {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: #DCE9F7;
  color: var(--zp-blue);
  font-family: 'Barlow Condensed', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.zp-fitment-selector__make-logo:empty { display: none; }
.zp-fitment-selector__make-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 2px; }

.zp-fitment-selector__make-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-width: calc(100vw - 32px);
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1.5px solid #DCDFE4;
  border-top: 3px solid var(--zp-blue);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 16px 36px rgba(15,17,20,0.22);
  padding: 8px;
  z-index: 60;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}
.zp-fitment-selector__make.is-open .zp-fitment-selector__make-panel { display: grid; }
.zp-fitment-selector__make-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 3px;
  color: var(--zp-slate);
  background: none;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zp-fitment-selector__make-option:hover,
.zp-fitment-selector__make-option.is-active { background: var(--zp-blue); border-left-color: var(--zp-blue); color: #fff; }

.zp-fitment-selector__go {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--zp-blue) 0%, var(--zp-blue-deep) 100%);
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: filter 0.15s;
}
.zp-fitment-selector__go span { display: none; }
.zp-fitment-selector__go:hover { filter: brightness(1.12); }

/* Sub Category — mega-panel (mirrors zp-header.html's Find-by-Vehicle Sub
   Category dropdown exactly: chips, thumbnail results grid, pagination,
   view-all link). */
.zp-fitment-selector__part { position: static; flex: 1.2; min-width: 0; }
.zp-fitment-selector__part[hidden] { display: none; }
.zp-fitment-selector__part-toggle {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 10px;
  border: 1.5px solid #DCDFE4;
  border-radius: 3px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--zp-slate);
  background: #F4F5F7;
  cursor: pointer;
  outline: none;
}
.zp-fitment-selector__part-toggle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zp-fitment-selector__part-toggle:disabled { color: #8B8E94; cursor: not-allowed; }
.zp-fitment-selector__part-toggle svg { transition: transform 0.2s; flex-shrink: 0; color: #8B8E94; }
.zp-fitment-selector__part.is-open .zp-fitment-selector__part-toggle { border-color: var(--zp-blue); background: #fff; }
.zp-fitment-selector__part.is-open .zp-fitment-selector__part-toggle svg { transform: rotate(180deg); }

.zp-fitment-selector__part-body {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 2px solid #DCDFE4;
  border-top: 3px solid var(--zp-blue);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 20px 44px rgba(15,17,20,0.28);
  padding: 16px;
  z-index: 200;
}
.zp-fitment-selector__part.is-open .zp-fitment-selector__part-body { display: block; }

.zp-fitment-selector__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.zp-fitment-selector__chip {
  padding: 5px 10px;
  border: 1.5px solid #DCDFE4;
  border-radius: 2px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--zp-slate);
  background: #fff;
  cursor: pointer;
}
.zp-fitment-selector__chip:hover { background: var(--zp-blue) !important; border-color: var(--zp-blue) !important; color: #fff !important; }
.zp-fitment-selector__chip.is-active { background: var(--zp-blue); border-color: var(--zp-blue); color: #fff; }

.zp-fitment-selector__part-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  border-top: 1px solid #DCDFE4;
  padding-top: 10px;
  margin-bottom: 10px;
}
.zp-fitment-selector__part-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 3px;
  color: var(--zp-slate);
  text-decoration: none;
  min-width: 0;
}
.zp-fitment-selector__part-item:hover { background: #F4F5F7; }
.zp-fitment-selector__part-thumb {
  width: 38px;
  height: 38px;
  border-radius: 2px;
  border: 1px solid #DCDFE4;
  background-color: #fff;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.zp-fitment-selector__part-info { min-width: 0; }
.zp-fitment-selector__part-info strong { display: block; font-size: 12px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zp-fitment-selector__part-info span { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 700; color: var(--zp-blue); }
.zp-fitment-selector__status { grid-column: 1 / -1; text-align: center; padding: 18px 8px; font-size: 12.5px; color: #8B8E94; }

.zp-fitment-selector__part-pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 10px; }
.zp-fitment-selector__page-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border: 1.5px solid #DCDFE4;
  border-radius: 2px;
  background: #fff;
  color: var(--zp-slate);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.zp-fitment-selector__page-btn.is-active { background: var(--zp-blue); border-color: var(--zp-blue); color: #fff; }
.zp-fitment-selector__page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.zp-fitment-selector__viewall {
  display: block;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--zp-blue);
  padding-top: 8px;
  border-top: 1px solid #DCDFE4;
}
.zp-fitment-selector__viewall:hover { color: var(--zp-blue-deep); }

.zp-fitment-results__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.zp-fitment-results__loading,
.zp-fitment-results__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: #5A5D63;
  font-size: 14.5px;
}

.zp-fitment-card {
  display: block;
  background: #fff;
  border: 2px solid #DCDFE4;
  border-radius: 3px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.zp-fitment-card:hover {
  border-color: #2767B0;
  box-shadow: 0 10px 26px rgba(39, 103, 176, 0.16);
  transform: translateY(-2px);
}
.zp-fitment-card__img {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: #F4F5F7;
}
.zp-fitment-card__img--placeholder { background: #F4F5F7; }
.zp-fitment-card__body { padding: 14px; }
.zp-fitment-card__sku {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: #8B8E94;
  margin-bottom: 6px;
}
.zp-fitment-card__name {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #32353A;
  line-height: 1.4;
}
.zp-fitment-card__price-row { margin-bottom: 6px; }
.zp-fitment-card__price {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 16px;
  font-weight: 700;
  color: #32353A;
}
.zp-fitment-card__price--was {
  font-size: 12.5px;
  font-weight: 500;
  color: #8B8E94;
  text-decoration: line-through;
  margin-left: 6px;
}
.zp-fitment-card__stock {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #065F46;
  background: #D1FAE5;
  padding: 2px 8px;
  border-radius: 2px;
}
.zp-fitment-card__stock--out { color: #7A1E1E; background: #FBDADA; }

.zp-fitment-results__pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
}
.zp-fitment-results__page {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 2px solid #DCDFE4;
  border-radius: 3px;
  background: #fff;
  color: #32353A;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.zp-fitment-results__page.is-active {
  background: #2767B0;
  border-color: #2767B0;
  color: #fff;
}

@media (max-width: 560px) {
  .zp-fitment-selector__row { flex-wrap: wrap; }
  .zp-fitment-selector__field,
  .zp-fitment-selector__field--year,
  .zp-fitment-selector__make,
  .zp-fitment-selector__part { flex: 1 1 calc(50% - 4px); }
  .zp-fitment-selector__go { flex: 1 1 100%; width: 100%; height: 38px; }
  .zp-fitment-selector__go span {
    display: inline;
    margin-left: 6px;
    font-family: 'Barlow Condensed', 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .zp-fitment-selector__make-panel { left: 0; right: 0; min-width: 0; max-width: none; }
  .zp-fitment-selector__part-body { max-height: 70vh; overflow-y: auto; }
  .zp-fitment-selector__part-results { grid-template-columns: 1fr; max-height: 260px; }
}
@media (max-width: 360px) {
  .zp-fitment-selector__make-panel { grid-template-columns: 1fr; }
}
