/* ==========================================================================
   Parts catalog — filter sidebar + product grid
   ========================================================================== */

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.catalog-search {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
}
.catalog-search svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--color-text-muted);
}
.catalog-search input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 14.5px;
}
.catalog-search input:focus { border-color: var(--coral); outline: none; box-shadow: 0 0 0 3px rgba(242,84,45,0.15); }

.catalog-toolbar-right { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.catalog-toolbar-right label { font-size: 13.5px; color: var(--color-text-muted); white-space: nowrap; }
.catalog-toolbar-right select {
  box-sizing: border-box;
  min-height: 36px;
  padding: 9px 34px 9px 16px;
  border: 2px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  background: #fff;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.catalog-toolbar-right select:hover { border-color: var(--navy); background: var(--slate-100); }
.catalog-toolbar-right select:focus { outline: none; border-color: var(--coral); }
.filter-toggle { display: none; }
.filters-panel-apply { display: none; }

.catalog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-7);
  align-items: start;
}

.filters-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: sticky;
  top: 90px;
}
.filters-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.filters-panel-head h2 { font-size: 1.05rem; }
.filter-group { border-bottom: 1px solid var(--color-border); padding: var(--space-4) 0; }
.filter-group:first-of-type { padding-top: 0; }
.filter-group:last-of-type { border-bottom: none; padding-bottom: 0; }
.filter-group-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.filter-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: 14.5px;
  cursor: pointer;
}
.filter-option input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--coral);
  flex-shrink: 0;
}
.filter-option .count { margin-left: auto; color: var(--color-text-muted); font-size: 13px; }

.price-range-values { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.price-range-values strong { color: var(--navy); font-family: var(--font-heading); }
input[type="range"] {
  width: 100%;
  accent-color: var(--coral);
  height: 30px;
}

.active-filters { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.active-filters:empty { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--slate-100);
  border-radius: var(--radius-pill);
  padding: 6px 8px 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
}
.chip button {
  background: none; border: none; padding: 2px;
  display: flex; color: var(--color-text-muted);
}
.chip button svg { width: 14px; height: 14px; }
.chip button:hover { color: var(--coral); }

.results-meta { font-size: 14px; color: var(--color-text-muted); margin-bottom: var(--space-4); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.product-card {
  border: 1px solid var(--card-border-warm);
  border-top: 3px solid var(--coral);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.product-media {
  aspect-ratio: 4/3;
  background: linear-gradient(155deg, var(--slate-100), #E7ECF3);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.product-media svg { width: 34%; height: 34%; color: var(--navy); opacity: 0.85; }
.product-media img { width: 100%; height: 100%; object-fit: contain; padding: 8%; box-sizing: border-box; }
.product-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--coral); color: #fff;
  font-size: 11.5px; font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}
.product-badge.out {
  background: var(--slate);
}
.product-body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.product-cat { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); font-weight: 600; }
.product-title { font-family: var(--font-heading); font-weight: 700; font-size: 15.5px; }
.product-title a { color: inherit; text-decoration: none; }
.product-title a:hover { color: var(--coral); }
a.product-media { cursor: pointer; }
.product-tier { font-size: 13px; color: var(--color-text-muted); }
.product-foot { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-3); gap: var(--space-3); }
.product-price { font-family: var(--font-heading); font-weight: 700; color: var(--navy); font-size: 1.1rem; }
.product-price small { font-weight: 500; color: var(--color-text-muted); font-size: 12px; display: block; }
.product-stock { font-size: 12.5px; display: flex; align-items: center; gap: 5px; }
.product-stock.in { color: #15803D; }
.product-stock.out { color: var(--slate); }
.product-stock svg { width: 13px; height: 13px; }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-8) var(--space-5);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
}
.empty-state svg { width: 40px; height: 40px; color: var(--slate); margin: 0 auto var(--space-4); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-7);
  flex-wrap: wrap;
}
.pagination button {
  min-width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  padding: 0 12px;
}
.pagination button:hover:not(:disabled) { border-color: var(--navy); }
.pagination button[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .ellipsis { color: var(--color-text-muted); padding: 0 4px; }

@media (max-width: 900px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .filters-panel {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(340px, 88vw);
    z-index: 120;
    border-radius: 0;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform var(--transition-base);
    background: #fff;
  }
  .filters-panel.is-open { transform: translateX(0); }
  .filter-toggle { display: inline-flex; }
  .filters-panel-apply {
    display: block;
    position: sticky;
    bottom: 0;
    margin: var(--space-4) calc(-1 * var(--space-5)) calc(-1 * var(--space-5));
    padding: var(--space-4) var(--space-5);
    background: #fff;
    border-top: 1px solid var(--color-border);
  }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .product-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Extended warranty modal (parts catalog quick "Add to Cart")
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 200;
}
.modal-backdrop[hidden] { display: none; }
.modal-dialog {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
}
.modal-close:hover { background: var(--slate-100); color: var(--navy); }
.modal-close svg { width: 16px; height: 16px; }
.modal-dialog h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-2);
  padding-right: var(--space-6);
}
.modal-item-name {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}
body.modal-open { overflow-y: hidden; }

.warranty-picker {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}
.warranty-picker-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: var(--space-3);
}
.warranty-picker-label svg { width: 17px; height: 17px; color: var(--coral); }
.warranty-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14.5px;
}
.warranty-option:hover { background: var(--color-bg-alt); }
.warranty-option:has(input:checked) { background: #FFF1EC; }
.warranty-option input[type="radio"] { width: 17px; height: 17px; accent-color: var(--coral); flex-shrink: 0; }
.warranty-option .warranty-price { margin-left: auto; font-weight: 600; color: var(--navy); }

.fob-required-tag {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #DC2626;
  background: #FEF2F2;
  border-radius: 999px;
  padding: 2px 8px;
}
.fob-picker-hint { font-size: 13px; color: var(--color-text-muted); margin-top: var(--space-2); padding: 0 var(--space-3); }
.fob-picker-error { font-size: 13.5px; color: #DC2626; margin-top: var(--space-2); padding: 0 var(--space-3); font-weight: 600; }
