/* Grid & cards — sized to match .product-card */
.salvage-grid { }

.salvage-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface, #fff);
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 8px);
  overflow: hidden;
  transition: box-shadow .2s, transform .1s, border-color .2s;
}
.salvage-card:hover {
  border-color: var(--primary, #0d6efd);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,.08));
}
.salvage-card-link {
  display: flex; flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}
.salvage-card-link:hover { text-decoration: none; color: inherit; }

.salvage-card-img-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 75%; /* raport fix 4:3 — aceeași înălțime indiferent de imaginea încărcată */
  background: var(--bg, #f3f4f6);
  overflow: hidden;
}
.salvage-card-img-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.salvage-card-noimg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #d1d5db; font-size: 4rem;
}
.salvage-card-badge {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.7); color: #fff;
  padding: 2px 8px; border-radius: 12px;
  font-size: .78rem;
  font-weight: 500;
}

.salvage-card-body {
  padding: 12px 14px;
  display: flex; flex-direction: column;
  flex: 1; gap: 6px;
}
.salvage-card-title {
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.3;
  color: #111827;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em; /* ~2 rânduri, aliniază titlurile între carduri */
}
.salvage-card-desc {
  color: #6b7280;
  font-size: .82rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Butoane acțiune — identice cu cardul din slider */
.salvage-card-actions {
  display: flex; gap: 6px;
  padding: 0 12px 12px;
}
.salvage-card-actions .btn {
  flex: 1;
  font-size: .78rem;
  padding: 5px 6px;
}

/* ── Filter card ───────────────────────────── */
.salvage-filter-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  padding: 16px 18px;
}
.salvage-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.salvage-filter-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600;
  font-size: 1rem;
  color: #111827;
}
.salvage-filter-title i { color: #0d6efd; }
.salvage-filter-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: #0d6efd; color: #fff;
  min-width: 22px; height: 22px;
  border-radius: 11px;
  font-size: .75rem; font-weight: 600;
  padding: 0 7px;
}
.salvage-filter-clear {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .85rem;
  color: #6b7280;
  text-decoration: none;
  transition: color .15s;
}
.salvage-filter-clear:hover { color: #ef4444; }

/* Active chips */
.salvage-filter-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #e5e7eb;
}
.salvage-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef4ff;
  color: #0d6efd;
  padding: 5px 10px 5px 12px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid #d6e4ff;
  transition: all .15s;
}
.salvage-chip:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}
.salvage-chip i:first-child { font-size: .9rem; }
.salvage-chip-close {
  font-size: 1rem;
  margin-left: 2px;
  opacity: .7;
}
.salvage-chip:hover .salvage-chip-close { opacity: 1; }

/* Filter grid */
.salvage-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.salvage-filter-field {
  display: flex; flex-direction: column;
  min-width: 0;
}
.salvage-filter-field label {
  font-size: .76rem;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 4px;
}
.salvage-filter-field label i { font-size: .85rem; color: #9ca3af; }
.salvage-filter-field .form-select {
  font-size: .88rem;
  padding: 7px 28px 7px 10px;
  border-color: #e5e7eb;
  background-color: #f9fafb;
  border-radius: 8px;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.salvage-filter-field .form-select:focus {
  border-color: #0d6efd;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(13,110,253,.12);
}
.salvage-filter-field .form-select:disabled {
  color: #9ca3af;
  background-color: #f3f4f6;
}

/* Responsive */
@media (max-width: 991.98px) {
  .salvage-filter-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 575.98px) {
  .salvage-filter-grid { grid-template-columns: repeat(2, 1fr); }
  .salvage-filter-card { padding: 14px; border-radius: 10px; }
}
@media (max-width: 380px) {
  .salvage-filter-grid { grid-template-columns: 1fr; }
}

/* Detail page specs list */
.salvage-specs li {
  padding: 6px 0;
  border-bottom: 1px dashed #e5e7eb;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.salvage-specs li:last-child { border-bottom: 0; }
.salvage-specs strong { font-weight: 600; color: #374151; margin-right: 6px; }

/* Detail page gallery — format standard fix, imaginea completă doar în lightbox (zoom) */
.salvage-gallery-main {
  position: relative;
  width: 100%;
  padding-bottom: 66%;   /* raport fix ~3:2, nu se mai schimbă după imaginea afișată */
  background: #f3f4f6;
  border-radius: 8px;
  overflow: hidden;
}
.salvage-gallery-main img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;     /* umple cadrul standard; necropat se vede la click (lightbox) */
  cursor: zoom-in;
  display: block;
}
.salvage-gallery-noimg {
  width: 100%; height: 300px; background: #f3f4f6;
  display: flex; align-items: center; justify-content: center;
  color: #d1d5db; font-size: 6rem; border-radius: 8px;
}
.salvage-gallery-thumbs {
  display: flex; gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.salvage-thumb {
  flex: 0 0 auto;
  width: 80px; height: 60px;
  padding: 0; border: 2px solid transparent;
  background: #f3f4f6;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}
.salvage-thumb.active { border-color: #0d6efd; }
.salvage-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Markdown content */
.markdown-content { line-height: 1.6; }
.markdown-content p { margin-bottom: 1rem; }
.markdown-content ul, .markdown-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.markdown-content li { margin-bottom: 4px; }
.markdown-content code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.markdown-content h1, .markdown-content h2, .markdown-content h3 { margin-top: 1.2rem; margin-bottom: .6rem; }

/* Lightbox */
.salvage-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
}
.salvage-lightbox img {
  max-width: 95vw; max-height: 95vh; object-fit: contain;
}
.salvage-lightbox-close, .salvage-lightbox-prev, .salvage-lightbox-next {
  position: absolute; background: rgba(255,255,255,.1); color: #fff;
  border: none; font-size: 2rem; line-height: 1;
  width: 48px; height: 48px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.salvage-lightbox-close { top: 20px; right: 20px; }
.salvage-lightbox-prev  { left: 20px; top: 50%; transform: translateY(-50%); }
.salvage-lightbox-next  { right: 20px; top: 50%; transform: translateY(-50%); }
.salvage-lightbox-close:hover, .salvage-lightbox-prev:hover, .salvage-lightbox-next:hover {
  background: rgba(255,255,255,.25);
}
