/* ============================================
   ТРАНС ГРЕЙН / TRANSGRAIN
   Синя корпоративна гама, бял хедър
   ============================================ */

:root {
  --blue-darkest: #0a1d40;
  --blue-dark:    #0e2a5c;
  --blue:         #1a3fa0;
  --blue-light:   #2a5bd7;
  --blue-soft:    #eef2fb;

  --white: #ffffff;
  --black: #0a0a0a;
  --gray:  #555555;
  --gray-soft: #f5f7fa;
  --border: #dfe4ee;

  --container: 1240px;
  --radius: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- ХЕДЪР ---------- */
.site-header {
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 100;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(10, 29, 64, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.logo { height: 84px; width: auto; }

.main-nav ul {
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
}

.main-nav a {
  color: var(--blue);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  letter-spacing: 0.2px;
  transition: color 0.15s;
}

.main-nav a:hover { color: var(--blue-dark); text-decoration: none; }

.lang-switch a {
  border: 1px solid var(--blue);
  color: var(--blue);
  padding: 5px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  transition: all 0.15s;
}
.lang-switch a:hover {
  background: var(--blue);
  color: var(--white);
  text-decoration: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.menu-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--blue);
  margin: 5px 0;
}

/* ---------- HERO BANNER ---------- */
.hero-banner {
  width: 100%;
  display: block;
  line-height: 0;
  overflow: hidden;
}

.hero-banner img {
  width: 1000%;
  height: auto;
  display: block;
}

@media (min-width: 769px) {
  .hero-banner {
    max-height: 620px;
  }
  .hero-banner img {
    height: 620px;
    object-fit: cover;
    object-position: top center;
  }
}

@media (max-width: 768px) {
  .hero-banner {
    margin-bottom: -1px;
  }
}

/* ---------- БУТОНИ ---------- */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.3px;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--white);
  color: var(--blue-dark);
  border: 2px solid var(--white);
}
.btn-primary:hover {
  background: transparent;
  color: var(--white);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.7);
}
.btn-outline:hover {
  background: var(--white);
  color: var(--blue-dark);
  border-color: var(--white);
  text-decoration: none;
}

.btn-blue {
  background: var(--blue);
  color: var(--white);
  border: 2px solid var(--blue);
}
.btn-blue:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  text-decoration: none;
}

.btn-blue-outline {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
}
.btn-blue-outline:hover {
  background: var(--blue);
  color: var(--white);
  text-decoration: none;
}

.btn-outline-light {
  color: var(--white);
  border-color: rgba(255,255,255,0.7);
}
.btn-outline-light:hover {
  background: var(--white);
  color: var(--blue-dark);
  text-decoration: none;
}

/* ---------- СЕКЦИИ ---------- */
.section { padding: 88px 0; }
.section-alt { background: var(--gray-soft); }
.section-blue { background: var(--blue-soft); }
.section-dark { background: var(--blue-dark); color: var(--white); }
.section-dark h2 { color: var(--white); }
.section-dark a { color: var(--white); }
.section-dark a.btn { color: var(--blue-dark); }
.section-dark a.btn-outline-light { color: var(--white); }

.section h2 {
  font-size: 36px;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
  font-weight: 700;
  color: var(--blue-dark);
}

.section-dark h2 { color: var(--white); }

.section p {
  margin-bottom: 16px;
  max-width: 880px;
  color: var(--gray);
  text-align: justify;
  hyphens: auto;
}

.section-dark p { color: rgba(255,255,255,0.9); }

.muted { color: var(--gray); font-size: 16px; }
.supporting {
  margin-top: 36px;
  color: var(--gray);
  padding: 24px 28px;
  background: var(--white);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  text-align: justify;
  hyphens: auto;
}

.lead-sm {
  font-size: 18px;
  color: var(--gray);
  margin-bottom: 40px;
  max-width: 780px;
  text-align: justify;
  hyphens: auto;
}

/* ---------- КАРТИ УСЛУГИ ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px 32px;
  position: relative;
  transition: all 0.25s;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--blue);
  border-radius: var(--radius) var(--radius) 0 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.card:hover {
  box-shadow: 0 12px 32px rgba(10, 29, 64, 0.1);
  transform: translateY(-4px);
  border-color: transparent;
}

.card:hover::before { transform: scaleX(1); }

.card h3 {
  font-size: 20px;
  margin-bottom: 14px;
  color: var(--blue-dark);
  font-weight: 700;
  line-height: 1.3;
}

.card p {
  color: var(--gray);
  font-size: 16px;
  margin: 0;
  line-height: 1.6;
  text-align: justify;
  hyphens: auto;
}

/* ---------- ТЕХНИКА ---------- */
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.equipment-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  transition: all 0.2s;
}

.equipment-item:hover {
  box-shadow: 0 8px 24px rgba(10, 29, 64, 0.1);
  transform: translateY(-3px);
}

.equipment-item img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

.equipment-item span {
  display: block;
  padding: 16px 18px;
  font-weight: 600;
  font-size: 15px;
  color: var(--blue-dark);
  border-top: 1px solid var(--border);
}

/* ---------- FEATURED PROJECT BLOCKS ---------- */
.featured-project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
  margin: 32px 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(10, 29, 64, 0.08);
  transition: box-shadow 0.25s, transform 0.25s;
}

.featured-project:hover {
  box-shadow: 0 12px 40px rgba(10, 29, 64, 0.12);
  transform: translateY(-2px);
}

.featured-project-image {
  height: 100%;
  min-height: 280px;
  overflow: hidden;
}

.featured-project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}

.featured-project:hover .featured-project-image img {
  transform: scale(1.03);
}

.featured-project-content {
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-project-content h3 {
  font-size: 24px;
  color: var(--blue-dark);
  margin-bottom: 14px;
  line-height: 1.25;
  font-weight: 700;
}

.featured-project-content p {
  color: var(--gray);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  max-width: 480px;
  text-align: justify;
  hyphens: auto;
}

.featured-project-reverse {
  direction: rtl;
}
.featured-project-reverse > * {
  direction: ltr;
}

/* ---------- SAFETY ---------- */
.safety-list {
  margin-top: 24px;
  padding-left: 0;
  list-style: none;
  max-width: 900px;
}
.safety-list li {
  padding: 18px 0 18px 32px;
  border-bottom: 1px solid var(--border);
  position: relative;
  color: var(--gray);
  text-align: justify;
  hyphens: auto;
}
.safety-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 24px;
  width: 12px;
  height: 12px;
  background: var(--blue);
  border-radius: 2px;
}
.safety-list li:last-child { border-bottom: 0; }
.safety-list strong { color: var(--blue-dark); }

/* ---------- КОНТАКТ ---------- */
.contact-info {
  margin: 32px 0;
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.contact-info p {
  margin: 0;
  color: var(--white);
  font-size: 17px;
}

.contact-info a {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact-info strong { color: rgba(255,255,255,0.7); font-weight: 500; }

/* ---------- PAGE HERO (галерия) ---------- */
.page-hero {
  padding: 80px 0 40px;
  background: var(--blue-dark);
  color: var(--white);
}

.page-hero h1 {
  font-size: 46px;
  letter-spacing: -0.8px;
  margin-bottom: 20px;
  color: var(--white);
  font-weight: 700;
}

.page-hero .lead-sm {
  color: rgba(255,255,255,0.85);
  margin-bottom: 0;
  text-align: justify;
  hyphens: auto;
}

/* ---------- ГАЛЕРИЯ ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  border: 0;
  background: var(--white);
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 3;
  transition: transform 0.2s;
}

.gallery-item:hover { transform: scale(1.01); }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item .gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(10, 29, 64, 0.85));
  color: var(--white);
  padding: 24px 14px 12px;
  font-size: 13px;
  text-align: left;
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 29, 64, 0.96);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  background: transparent;
  border: 0;
  color: var(--white);
  font-size: 42px;
  cursor: pointer;
  padding: 10px 20px;
  line-height: 1;
  font-family: inherit;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover { opacity: 1; }

.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

.lb-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--white);
  font-size: 15px;
  text-align: center;
  max-width: 80vw;
}

/* ---------- УДОСТОВЕРЕНИЯ И СЕРТИФИКАТИ ---------- */
.certificates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 40px 0;
}

.certificate-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(10, 29, 64, 0.06);
  cursor: pointer;
  position: relative;
}

.certificate-card:hover {
  box-shadow: 0 12px 32px rgba(10, 29, 64, 0.12);
  transform: translateY(-4px);
  text-decoration: none;
}

.certificate-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: top center;
  display: block;
  background: #f0f0f0;
}

.certificate-card::after {
  content: "🔍";
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(26, 63, 160, 0.9);
  color: var(--white);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.certificate-card:hover::after {
  opacity: 1;
}

.certificate-info {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.certificate-info h3 {
  font-size: 16px;
  color: var(--blue-dark);
  margin-bottom: 4px;
  font-weight: 700;
}

.certificate-info p {
  color: var(--gray);
  font-size: 14px;
  margin: 0;
}

.iso-block {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.iso-block h3 {
  font-size: 24px;
  color: var(--blue-dark);
  margin-bottom: 16px;
  font-weight: 700;
}

.iso-block > p {
  color: var(--gray);
  max-width: 880px;
  margin-bottom: 32px;
}

.iso-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.iso-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: all 0.2s;
}

.iso-card:hover {
  box-shadow: 0 8px 24px rgba(10, 29, 64, 0.1);
  transform: translateY(-3px);
}

.iso-icon {
  display: inline-block;
  background: var(--blue);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 8px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.iso-card h4 {
  font-size: 18px;
  color: var(--blue-dark);
  margin-bottom: 6px;
  font-weight: 700;
}

.iso-card p {
  color: var(--gray);
  font-size: 15px;
  margin: 0;
}

/* ---------- ФУТЪР ---------- */
.site-footer {
  background: var(--blue-darkest);
  color: rgba(255,255,255,0.75);
  padding: 56px 0 32px;
  font-size: 15px;
}

.footer-inner p { margin: 8px 0; }
.site-footer a { color: rgba(255,255,255,0.75); }
.site-footer a:hover { color: var(--white); }
.copyright {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 14px;
  color: rgba(255,255,255,0.5);
}

.center { text-align: center; margin-top: 12px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .equipment-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .page-hero h1 { font-size: 34px; }
  .section h2 { font-size: 28px; }

  .featured-project,
  .featured-project-reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }
  .featured-project-image {
    min-height: 220px;
  }
  .featured-project-content {
    padding: 28px 24px;
  }
  .featured-project-content h3 {
    font-size: 20px;
  }

  .certificates-grid,
  .iso-grid {
    grid-template-columns: 1fr;
  }
  .certificate-card img {
    height: 220px;
  }

  .menu-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 84px;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(10, 29, 64, 0.08);
    padding: 20px 24px;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: flex-start; gap: 16px; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .section { padding: 56px 0; }
  .section h2 { font-size: 24px; }
  .page-hero h1 { font-size: 26px; }
  .cards, .equipment-grid, .gallery-grid { grid-template-columns: 1fr; }
  .contact-info { flex-direction: column; gap: 12px; }

  .certificates-grid {
    gap: 16px;
  }
  .iso-block {
    margin-top: 40px;
  }

  .section p,
  .featured-project-content p,
  .card p,
  .page-hero .lead-sm,
  .safety-list li,
  .supporting,
  .lead-sm {
    text-align: left;
  }
}