/* =============================================================================
   Pumpport — Kimyasal Uyumluluk Tablosu
   chemical-compat.css
============================================================================= */

/* ── Section ── */
.pp-compat-section {
  padding-bottom: 32px !important;
}
.pp-compat-wrap {
  /* sec-inner içinde; genişlik sec-inner'dan gelir */
}

/* ── Başlık & Arama ── */
.pp-compat-header {
  margin-bottom: 20px;
}
.pp-compat-hint {
  font-size: 14px;
  color: var(--gray-lt);
  margin-bottom: 12px;
}
.pp-compat-inputs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Kimyasal Input Alanı ── */
.pp-chem-field {
  position: relative;
  flex: 1 1 200px;
  max-width: 280px;
}
.pp-chem-input {
  width: 100%;
  padding: 9px 36px 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  background: #fff;
  color: var(--gray);
  transition: border-color .15s;
  outline: none;
}
.pp-chem-input:focus {
  border-color: var(--red);
}
.pp-chem-input.filled {
  border-color: var(--red);
  background: var(--red-soft);
}
.pp-chem-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ddd;
  color: #555;
  font-size: 14px;
  line-height: 22px;
  text-align: center;
  padding: 0;
  transition: background .15s;
}
.pp-chem-clear:hover {
  background: var(--red);
  color: #fff;
}

/* ── Autocomplete Dropdown ── */
.pp-chem-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  max-height: 220px;
  overflow-y: auto;
  z-index: 200;
  padding: 4px 0;
  list-style: none;
  margin: 0;
}
.pp-chem-dropdown li {
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background .1s;
}
.pp-chem-dropdown li:hover,
.pp-chem-dropdown li[aria-selected="true"] {
  background: var(--red-soft);
  color: var(--red);
}

/* ── Tablo Wrapper — overflow-x scroll, overflow-y görünür ── */
.pp-compat-table-wrap {
  overflow-x: auto;
  overflow-y: visible;          /* tooltip taşmasın diye hidden YOK */
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ── Ana Tablo ── */
.pp-compat-table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
}
.pp-compat-table th,
.pp-compat-table td {
  padding: 5px 8px;
  border: 1px solid var(--border);
  vertical-align: middle;
  text-align: center;
}

/* Thead */
.pp-compat-table thead tr {
  background: var(--dark);
  color: #fff;
}
.pp-compat-table thead th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  border-color: #333;
  white-space: nowrap;
}
.pp-compat-table .th-mat {
  text-align: left;
  min-width: 180px;
}
.pp-compat-table .th-grade {
  min-width: 80px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pp-compat-table .th-pump {
  width: 40px;
  color: #999;
}

/* Kategori etiketleri (Metals / Plastics) */
.cat-label {
  width: 26px;
  padding: 4px 4px !important;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  white-space: nowrap;
  text-align: center;
}
.cat-metal {
  background: #3a3a3a;
  color: #ccc;
  border-color: #444 !important;
}
.cat-plast {
  background: #1a3a5a;
  color: #a0c0e0;
  border-color: #2a4a6a !important;
}

/* Malzeme adı */
.mat-name {
  text-align: left !important;
  font-weight: 500;
  color: var(--dark);
  padding-left: 12px !important;
  white-space: nowrap;
}
.row-metal .mat-name { background: #fafafa; }
.row-elast .mat-name { background: #f5f8fc; }

/* ── Derece Hücreleri ── */
.cell-grade {
  font-weight: 700;
  font-size: 13px;
  transition: background .2s, color .2s;
}
.cell-grade.grade-A { background: #d4edda; color: #1a6b2f; }
.cell-grade.grade-B { background: #fff3cd; color: #856404; }
.cell-grade.grade-C { background: #ffe0b2; color: #8c4b00; }
.cell-grade.grade-D { background: #f8d7da; color: #842029; }

/* ── Pompa İkon Sütunu ── */
.cell-pump {
  width: 40px;
}
.pp-pump-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #aaa;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s, transform .15s;
}
.pp-pump-btn:hover {
  transform: scale(1.15);
}
.pp-pump-btn.inactive {
  background: #efefef;
  color: #ccc;
  pointer-events: none;
}
.pp-pump-btn.active {
  background: var(--red);
  color: #fff;
  pointer-events: auto;
}
/* Kimyasal girilmeden pompalar gizli */
.pp-pump-btn.neutral {
  opacity: 0;
  pointer-events: none;
}

/* ── Shared Pompa Overlay (position: fixed, JS tarafından konumlandırılır) ── */
.pp-pump-overlay {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.16);
  padding: 12px 12px 10px;
  width: 300px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  pointer-events: auto;
}
.pp-pump-overlay[hidden] { display: none; }

/* Başlık satırı: label + kapat */
.pp-ov-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}
.pp-ov-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-lt);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pp-ov-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e8e8e8;
  color: #555;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  padding: 0;
  transition: background .15s, color .15s;
}
.pp-ov-close:hover {
  background: var(--red);
  color: #fff;
}

/* 4 sütun küçük grid */
.pp-ov-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.pp-ov-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: #f8f8f8;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: border-color .15s, transform .15s;
}
.pp-ov-item:hover {
  border-color: var(--red);
  transform: scale(1.06);
  z-index: 1;
}
.pp-ov-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 3px;
}
.pp-ov-item-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #ccc;
  font-size: 18px;
}
/* İsim — hover'da overlay */
.pp-ov-name {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3px;
  opacity: 0;
  transition: opacity .15s;
  line-height: 1.2;
}
.pp-ov-item:hover .pp-ov-name { opacity: 1; }

/* ── Legend ── */
.pp-compat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  margin-top: 4px;
}
.leg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 6px;
  font-weight: 500;
  flex: 1 1 140px;
}
.leg strong {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.leg-title {
  display: block;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
}
.leg-sub {
  display: block;
  font-size: 10px;
  opacity: .72;
  line-height: 1.2;
}
.leg-A { background: #d4edda; color: #1a6b2f; }
.leg-B { background: #fff3cd; color: #856404; }
.leg-C { background: #ffe0b2; color: #8c4b00; }
.leg-D { background: #f8d7da; color: #842029; }
.leg-x { background: #f0f0f0; color: #666; }

/* ── Statik SEO Bölümü ── */
.pp-featured-section {
  background: #f8f9fa;
  padding-top: 32px !important;
}
.pp-featured-head {
  margin-bottom: 20px;
}
.pp-featured-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
}
.pp-featured-sub {
  font-size: 13px;
  color: var(--gray-lt);
}
.pp-featured-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
}
.pp-featured-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  background: #fff;
}
.pp-featured-table thead tr {
  background: var(--dark);
  color: #fff;
}
.pp-featured-table th,
.pp-featured-table td {
  padding: 7px 10px;
  border: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}
.pp-featured-table thead th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  border-color: #333;
}
.pp-ft-chem {
  text-align: left !important;
  min-width: 180px;
}
.pp-ft-mat { min-width: 52px; }
.pp-ft-name {
  text-align: left !important;
  font-weight: 500;
  background: #fafafa;
}
.pp-ft-tr {
  display: block;
  font-weight: 600;
  color: var(--dark);
  font-size: 12px;
}
.pp-ft-en {
  display: block;
  font-size: 10px;
  color: var(--gray-lt);
  margin-top: 1px;
}
.pp-featured-table td.grade-A { background: #d4edda; color: #1a6b2f; font-weight: 700; }
.pp-featured-table td.grade-B { background: #fff3cd; color: #856404; font-weight: 700; }
.pp-featured-table td.grade-C { background: #ffe0b2; color: #8c4b00; font-weight: 700; }
.pp-featured-table td.grade-D { background: #f8d7da; color: #842029; font-weight: 700; }
.pp-featured-note {
  font-size: 11px;
  color: var(--gray-lt);
}

/* screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ── Kolon başlık aktif kimyasal ── */
.th-grade.has-chem {
  font-size: 10px;
  padding: 4px 6px;
  color: #fff;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .pp-compat-inputs { flex-direction: column; gap: 6px; }
  .pp-chem-field    { max-width: 100%; flex-basis: auto; }
  .pp-pump-overlay  { width: calc(100vw - 32px); max-width: 300px; }
  .pp-ov-grid       { grid-template-columns: repeat(3, 1fr); }
}
