/* ============================================================
   MMTECH — wspólne style (pasek, wyszukiwarka, kontakt, stopka)
   Jeden plik dla wszystkich podstron. Edytujesz raz.
   ============================================================ */

/* ---------- PASEK: wyszukiwarka ---------- */
.header-search { position: relative; }
.header-search input { padding-left: 42px; }
.header-search .icon {
  left: 13px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #64748B);
  pointer-events: none;
  font-size: 0;
}
.header-search .icon svg { width: 20px; height: 20px; display: block; }
.header-search input:focus {
  outline: none;
  background: #fff;
  border-color: var(--blue, #2563EB);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

/* ---------- PASEK: CTA ---------- */
.header-cta {
  background: var(--blue, #2563EB);
  border: 1.5px solid var(--blue, #2563EB);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.25);
}
.header-cta:hover {
  background: var(--blue-hover, #1D4ED8);
  border-color: var(--blue-hover, #1D4ED8);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.35);
}

/* ---------- WYNIKI WYSZUKIWANIA ---------- */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--line, #E2E8F0);
  border-radius: 12px;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.18), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  z-index: 1000;
  max-height: 420px;
  overflow-y: auto;
  display: none;
}
.search-results-dropdown.active { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--ink, #1E293B);
  border-bottom: 1px solid #F1F5F9;
  transition: background 0.15s;
  text-align: left;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover,
.search-result-item.is-active { background: var(--bg-muted, #F1F5F9); }
.search-result-item.is-active { box-shadow: inset 3px 0 0 0 var(--blue, #2563EB); }
.res-icon { font-size: 20px; flex-shrink: 0; }
.res-info { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.res-title { font-weight: 700; font-size: 14px; color: var(--ink, #1E293B); }
.res-desc { font-size: 12px; color: var(--muted, #64748B); }
.res-title mark { background: var(--blue-soft, #DBEAFE); color: var(--blue, #2563EB); border-radius: 2px; padding: 0 2px; }
.res-code {
  font-size: 11px;
  background: var(--bg-muted, #F1F5F9);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--blue, #2563EB);
  font-weight: 700;
}

/* ---------- PODŚWIETLENIE WIERSZA (wejście z kotwicą #KOD) ---------- */
@keyframes mmtechAnchorPulse {
  0%   { background-color: rgba(250, 204, 21, 0.0); }
  15%  { background-color: rgba(250, 204, 21, 0.45); }
  50%  { background-color: rgba(250, 204, 21, 0.35); }
  100% { background-color: rgba(250, 204, 21, 0.0); }
}
tr.mmtech-anchor-highlight td { animation: mmtechAnchorPulse 3s ease-out; }
tr.mmtech-anchor-highlight td:first-child { box-shadow: inset 4px 0 0 0 #EAB308; }

/* ---------- BLOK KONTAKTU ---------- */
.contact-form .field textarea {
  width: 100%;
  padding: 14px 18px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink, #1E293B);
  background: var(--bg, #F8FAFC);
  border: 1px solid var(--line, #E2E8F0);
  border-radius: 8px;
  resize: vertical;
  min-height: 120px;
  transition: all 0.15s;
}
.contact-form .field textarea::placeholder { color: var(--muted-2, #94A3B8); }
.contact-form .field textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--ink, #1E293B);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.contact-info .logo-block {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  border-radius: 0;
  margin-bottom: 32px;
}

/* Blok kontaktu — style bazowe (dla podstron, które ich nie mają w <style>) */
section.contact { padding: 96px 0; background: var(--bg-elev, #fff); border-top: 1px solid var(--line, #E2E8F0); }
.contact .container { display: grid; grid-template-columns: 1.5fr 1fr; gap: 96px; align-items: start; }
.contact-form-wrap h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; color: var(--ink); line-height: 1.2; letter-spacing: -0.025em; margin-bottom: 14px; }
.contact-form-wrap > p { font-size: 16px; line-height: 1.6; color: var(--body); margin-bottom: 40px; max-width: 460px; }
.contact-form-label { font-size: 12px; font-weight: 700; color: var(--ink); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 24px; }
.contact-form .field { margin-bottom: 20px; }
.contact-form .field label { display: block; font-size: 13px; color: var(--ink); font-weight: 500; margin-bottom: 8px; }
.contact-form .field input { width: 100%; padding: 14px 18px; font-family: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; transition: all 0.15s; }
.contact-form .field input::placeholder { color: var(--muted-2); }
.contact-form .field input:focus { outline: none; background: white; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08); }
.contact-submit { width: 100%; margin-top: 12px; padding: 18px 32px; background: var(--red, #DC2626); color: white; font-family: inherit; font-weight: 700; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; border: none; border-radius: 8px; cursor: pointer; transition: all 0.15s; box-shadow: 0 4px 12px -2px rgba(220, 38, 38, 0.25); }
.contact-submit:hover { background: var(--red-hover, #B91C1C); transform: translateY(-1px); box-shadow: 0 8px 20px -4px rgba(220, 38, 38, 0.35); }
.contact-info { padding-top: 8px; }
.contact-info .logo-block-img { height: 48px; width: auto; display: block; }
.contact-info-section { margin-bottom: 28px; }
.contact-info-section h4 { font-size: 12px; font-weight: 700; color: var(--ink); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 14px; }
.contact-info-section p { font-size: 14px; line-height: 1.7; color: var(--body); margin-bottom: 8px; }
.contact-info-section p strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.contact-info-section a { color: var(--body); text-decoration: none; transition: color 0.15s; }
.contact-info-section a:hover { color: var(--blue); }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--body); }
.legal-links a { color: var(--body); text-decoration: none; transition: color 0.15s; }
.legal-links a:hover { color: var(--blue); text-decoration: underline; }
.legal-links span { color: var(--muted-2); }

/* ---------- STOPKA ---------- */
footer.site-footer {
  background: var(--bg-elev, #FFFFFF);
  border-top: 1px solid var(--line, #E2E8F0);
  padding: 32px 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted, #64748B);
}
.footer-langs {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}
.footer-langs a { color: var(--muted-2, #94A3B8); text-decoration: none; transition: color 0.15s; }
.footer-langs a:hover { color: var(--blue, #2563EB); }
.footer-langs a.current { color: var(--ink, #1E293B); }
.footer-langs a[aria-disabled="true"] { opacity: 0.45; cursor: default; pointer-events: none; }

/* ---------- BANER JĘZYKOWY ---------- */
.lang-banner {
  background: var(--bg-dark, #0F172A);
  color: #fff;
  font-size: 14px;
}
.lang-banner .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.lang-banner-text { color: rgba(255,255,255,0.85); }
.lang-banner-actions { display: flex; align-items: center; gap: 8px; }
.lang-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink, #1E293B);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.15s;
}
.lang-banner-btn:hover { background: #60A5FA; color: #fff; }
.lang-banner-close {
  background: none;
  border: 0;
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
}
.lang-banner-close:hover { color: #fff; }

@media (max-width: 900px) {
  .header-search .search-results-dropdown { max-height: 320px; }
  .lang-banner .container { flex-direction: column; gap: 10px; text-align: center; }
}

/* ---------- PASEK: zakres tabletowy (901–1150 px) — pasek w dwóch rzędach ---------- */
@media (max-width: 1150px) and (min-width: 901px) {
  header.site-header .container {
    flex-wrap: wrap;
    row-gap: 12px;
    gap: 16px;
  }
  header.site-header .logo { order: 1; }
  header.site-header nav.main-nav {
    order: 2;
    margin-left: auto;
    margin-right: 0;
    gap: 22px;
    font-size: 14px;
  }
  header.site-header .header-search {
    order: 3;
    flex: 1 1 auto;
    width: auto;
    min-width: 220px;
  }
  header.site-header .header-cta { order: 4; }
}

/* ---------- PASEK: nigdy nie wychodzi poza ekran ---------- */
/* Na desktopie pasek zawsze w jednej linii: wyszukiwarka może się zwężać,
   nawigacja nie łamie się na drugi rząd (naprawa m.in. artykułów o wąskim .container). */
header.site-header .container { flex-wrap: nowrap; }
header.site-header nav.main-nav { flex-shrink: 0; }
header.site-header .header-search { min-width: 150px; flex-shrink: 1; }

@media (max-width: 1150px) {
  header.site-header .container { flex-wrap: wrap; row-gap: 12px; }
}

@media (max-width: 900px) {
  header.site-header .container { justify-content: center; }
  header.site-header nav.main-nav {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: 12px 18px;
    margin: 4px 0;
  }
  header.site-header .header-search { width: 100%; }
  header.site-header .header-cta { width: 100%; justify-content: center; text-align: center; }
}

/* ---------- TABELE: plakietki mogą się łamać na małym ekranie ---------- */
@media (max-width: 600px) {
  .compat-table .compat-status,
  .data-table .status-badge,
  .status-badge,
  .compat-status {
    display: inline-block !important;
    white-space: normal !important;
    line-height: 1.35;
  }
}

/* ---------- atramenty.html: notka pod tabelą na mobile ---------- */
@media (max-width: 900px) {
  .compat-footer-note {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 20px !important;
  }
  /* przycisk jest inline (<a>), więc width:100% bez display nic nie robił,
     a nowrap rozpychał stronę w poziomie na wąskich ekranach */
  .compat-footer-note .btn-cta {
    display: block;
    width: 100%;
    justify-content: center;
    text-align: center;
    white-space: normal !important;   /* bije nowrap z <style> w atramenty.html */
  }
}

/* ============================================================
   TABELE PRODUKTOWE NA MOBILE
   Dwa poziomy:
   1) 701–1100 px — tabela zostaje tabelą, ale przewija się w poziomie.
   2) ≤ 700 px    — każdy wiersz zamienia się w kartę (etykieta + wartość).
   Etykiety kart bierze z <thead> skrypt mmtech.js, który dokłada
   klasę .mmtech-tables-ready na <html>. Bez JS zostaje wariant 1.
   ============================================================ */

/* --- 1) Przewijanie w poziomie zamiast ściskania kolumn --- */
@media (max-width: 1100px) {
  .compat-table, .data-table {
    display: block;
    width: 100%;
    width: max-content;          /* szerokość = treść… */
    max-width: 100%;             /* …ale nigdy poza kontener */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .compat-table th, .compat-table td,
  .data-table th, .data-table td { white-space: nowrap; }
}

/* --- 2) Karty na smartfonie --- */
@media (max-width: 700px) {
  html.mmtech-tables-ready .compat-table,
  html.mmtech-tables-ready .data-table {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 0;
    border-radius: 0;
    background: none;
    overflow: visible;
  }

  /* nagłówek tabeli zbędny — jego treść trafia do etykiet w kartach */
  html.mmtech-tables-ready .compat-table thead,
  html.mmtech-tables-ready .data-table thead { display: none; }

  html.mmtech-tables-ready .compat-table tbody,
  html.mmtech-tables-ready .data-table tbody { display: block; }

  html.mmtech-tables-ready .compat-table tbody tr,
  html.mmtech-tables-ready .data-table tbody tr {
    display: block;
    background: var(--bg-elev, #fff);
    border: 1px solid var(--line, #E2E8F0);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  html.mmtech-tables-ready .compat-table tbody td,
  html.mmtech-tables-ready .data-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: auto;
    padding: 9px 0 !important;
    font-size: 14px !important;
    line-height: 1.4;
    text-align: right;
    white-space: normal;
    word-break: break-word;
    border: 0 !important;
    border-bottom: 1px solid var(--bg-muted, #F1F5F9) !important;
  }
  html.mmtech-tables-ready .compat-table tbody td:last-child,
  html.mmtech-tables-ready .data-table tbody td:last-child { border-bottom: 0 !important; }

  html.mmtech-tables-ready .compat-table tbody td::before,
  html.mmtech-tables-ready .data-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 45%;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted, #64748B);
    text-align: left;
  }

  /* pierwsza komórka = tytuł karty (nazwa/kod MMTech) */
  html.mmtech-tables-ready .compat-table tbody td:first-child,
  html.mmtech-tables-ready .data-table tbody td:first-child {
    display: block;
    text-align: left;
    font-size: 17px !important;
    font-weight: 800;
    color: var(--ink, #1E293B);
    padding: 0 0 12px !important;
  }
  html.mmtech-tables-ready .compat-table tbody td:first-child::before,
  html.mmtech-tables-ready .data-table tbody td:first-child::before { display: none; }

  /* plakietki i przyciski w karcie */
  html.mmtech-tables-ready .compat-table tbody td .compat-status,
  html.mmtech-tables-ready .data-table tbody td .status-badge {
    text-align: right;
  }
  html.mmtech-tables-ready .compat-table tbody td .msds-btn,
  html.mmtech-tables-ready .data-table tbody td .btn-msds {
    white-space: nowrap;
  }

  /* podświetlenie wiersza po wejściu z kotwicą #KOD — obrys całej karty */
  html.mmtech-tables-ready tr.mmtech-anchor-highlight {
    box-shadow: 0 0 0 2px #EAB308 !important;
  }
  html.mmtech-tables-ready tr.mmtech-anchor-highlight td:first-child { box-shadow: none; }
}

/* ============================================================
   Przycisk „Wyślij zapytanie” — z czerwonego na spokojny granat.
   Głębszy niż niebieski CTA z paska (#2563EB), więc się nie duplikują.
   ============================================================ */
.contact-submit {
  background: #1E40AF !important;              /* blue-800 — stonowany, „zaufanie” zamiast „alarm” */
  box-shadow: 0 4px 12px -2px rgba(30, 64, 175, 0.28) !important;
}
.contact-submit:hover {
  background: #1E3A8A !important;              /* blue-900 na hover */
  box-shadow: 0 8px 20px -4px rgba(30, 64, 175, 0.38) !important;
}

/* ============================================================
   Przycisk hero na podstronach produktu („Dobierz do swojego modelu”)
   — ten sam granat co „Zobacz produkty” w hero na index.html.
   Czerwień zostaje tylko przy CTA na dole strony, żeby na jednym
   ekranie nie konkurowały ze sobą dwa „alarmowe” przyciski.
   ============================================================ */
.btn-primary.btn-hero-dark {
  background: var(--ink, #1E293B);
  border-color: var(--ink, #1E293B);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(15, 23, 42, 0.35);
}
.btn-primary.btn-hero-dark:hover {
  background: #0F172A;
  border-color: #0F172A;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.45);
}

/* Wyjątek: zgłoszenie AWARII zostaje czerwone (uzasadniona pilność) */
.contact-submit--urgent {
  background: var(--red, #DC2626) !important;
  box-shadow: 0 4px 12px -2px rgba(220, 38, 38, 0.25) !important;
}
.contact-submit--urgent:hover {
  background: var(--red-hover, #B91C1C) !important;
  box-shadow: 0 8px 20px -4px rgba(220, 38, 38, 0.35) !important;
}
