/* ============================================================================
   RT Maschinenbau – Final Stylesheet
   ============================================================================ */

:root {
  --primary: #0f5e4a;
  --primary-dark: #0a4233;
  --text: #1a1a1a;
  --text-light: #555555;
  --muted: #6b7780;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --border: #e0e5e8;
  --shadow: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --container: min(1100px, calc(100% - 40px));
  --topbar-h: 40px;
  --header-h: 80px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; transition: color 0.2s; }

/* ─── TOPBAR ──────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: visible;
}

.topbar-inner {
  width: var(--container);
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: var(--text);
}

.topbar a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar svg {
  width: 16px;
  height: 16px;
  fill: var(--primary);
}

/* ─── HEADER ─────────────────────────────────────────── */
.header-wrapper {
  background: var(--primary);
  position: sticky;
  top: var(--topbar-h);
  z-index: 110;
  overflow: visible;
}

.header-inner {
  width: var(--container);
  margin: 0 auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: relative;
  overflow: visible;
}

/* Logo als weißes erhabenes Feld – ragt nach oben in Topbar */
.logo-container {
  position: absolute;
  left: 0;
  top: -50px;
  z-index: 150;
  width: 96px;
  height: 120px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.15);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.main-logo {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  padding-left: 106px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  color: #fff;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.2s;
}

.main-nav a:hover {
  background: rgba(255,255,255,0.15);
}

/* ─── SIDE CONTACT ────────────────────────────────────── */
.side-contact {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 115;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-item .side-tab {
  background: var(--primary);
  color: #fff;
  border-radius: 8px 0 0 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  transform: translateX(calc(100% - 44px));
  transition: transform 0.2s ease;
  min-width: 160px;
}

.side-item:hover .side-tab {
  transform: translateX(0);
}

.side-tab svg {
  width: 16px;
  height: 16px;
  fill: #fff;
  flex-shrink: 0;
}

.side-tab span {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── MAIN CARD ──────────────────────────────────────── */
.main-card {
  width: var(--container);
  margin: 30px auto;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 50px 60px;
  scroll-margin-top: 140px;
}

/* ─── TYPOGRAFIE ──────────────────────────────────────── */
.section-head {
  margin-bottom: 30px;
}

.section-head h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.section-head p {
  font-size: 15px;
  color: var(--text-light);
}

.section-subhead {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 16px;
}

/* ─── LEISTUNGEN GRID ────────────────────────────────── */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.spec-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.spec-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.spec-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  color: var(--text-light);
}

.spec-value {
  color: var(--primary);
  font-weight: 600;
}

/* ─── WIR FERTIGEN GRID ──────────────────────────────── */
.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.part-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.2s;
}

.part-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.part-card h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.part-card p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
}

/* ─── GALERIE CELLULOID ──────────────────────────────── */
.gallery-wrap {
  overflow: hidden;
  border-radius: 12px;
  margin: 24px 0;
  border: 1px solid var(--border);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 3%, #000 97%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 3%, #000 97%, transparent 100%);
}

.gallery-track {
  display: flex;
  gap: 12px;
  animation: celluloidScroll 40s linear infinite;
  padding: 12px;
  width: max-content;
}

.gallery-wrap:hover .gallery-track {
  animation-play-state: paused;
}

@keyframes celluloidScroll {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 6px)); }
}

.gallery-slide {
  flex: 0 0 240px;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s;
}

.gallery-slide:hover {
  transform: scale(1.03);
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.gallery-controls p {
  font-size: 13px;
  color: var(--muted);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: var(--bg);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: var(--primary);
}

/* ─── VIDEOS ──────────────────────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.video-item {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.video-item video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.video-player-full {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  width: 80vw;
  max-width: 900px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.video-player-full.open {
  display: block;
}

.video-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.85);
  cursor: pointer;
}

.video-overlay.open {
  display: block;
}

/* ─── KONTAKT ─────────────────────────────────────────── */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.contact-col h2,
.anfahrt-col h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  color: var(--primary);
  transition: background 0.2s, border-color 0.2s;
}

.contact-list a:hover {
  border-color: var(--primary);
}

.contact-list svg {
  width: 20px;
  height: 20px;
  fill: var(--primary);
}

.anfahrt-col p {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.7;
}

.anfahrt-col a {
  color: var(--primary);
  font-weight: 600;
}

.cta {
  display: inline-block;
  background: var(--primary);
  color: #fff !important;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 700;
  margin-top: 12px;
  transition: background 0.2s, transform 0.1s;
  text-align: center;
}

.cta:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ─── FOOTER ─────────────────────────────────────────── */
.footer {
  background: #1a1a1a;
  color: #ecf1f4;
  padding: 48px 0;
  margin-top: 60px;
}

.footer-content {
  width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.footer-left h3 {
  font-size: 20px;
  color: #fff;
  margin-bottom: 16px;
}

.footer-left p {
  font-size: 15px;
  line-height: 1.7;
  color: #b7c1c8;
  margin-bottom: 8px;
}

.footer-left a {
  color: #fff;
  font-weight: 600;
}

.footer-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-end;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 15px;
  color: #fff;
  font-weight: 500;
}

.footer-links a:hover {
  opacity: 0.85;
}

.copyright {
  font-size: 14px;
  color: #b7c1c8;
}

.copyright a {
  color: #fff;
}

/* ─── TO-TOP BUTTON ──────────────────────────────────── */
.to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 90;
  transition: all 0.2s;
}

.to-top.show {
  display: flex;
}

.to-top:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.to-top svg {
  width: 20px;
  height: 20px;
  fill: var(--primary);
}

.to-top:hover svg {
  fill: #fff;
}

/* ─── LIGHTBOX ────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  z-index: 10001;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.3);
  color: #fff;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.25);
}

.lightbox-nav svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

#lightboxPrev { left: 40px; }
#lightboxNext { right: 40px; }

/* ─── COOKIE BANNER ──────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  padding: 20px 28px;
  z-index: 99999;
  display: none;
  align-items: center;
  gap: 24px;
  max-width: 90vw;
  min-width: 320px;
}

.cookie-banner.show {
  display: flex;
}

.cookie-content {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-content p {
  font-size: 14px;
  color: var(--text);
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.cookie-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  border: none;
  text-decoration: none;
  display: inline-block;
}

.cookie-info {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.cookie-info:hover {
  background: rgba(15, 94, 74, 0.1);
}

.cookie-reject {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.cookie-reject:hover {
  background: #e8edf2;
  transform: translateY(-1px);
}

.cookie-accept {
  background: var(--primary);
  color: #fff;
}

.cookie-accept:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ─── LEGAL CONTENT (Volle Breite, linksbündig) ──────── */
.legal-content {
  text-align: left;
}

.legal-content h3,
.legal-content h2 {
  text-align: left;
}

.legal-content p {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.7;
}

/* ─── RESPONSIVE ──────────────────────────────────────── */
@media(max-width: 860px) {
  .header-inner {
    height: auto;
    padding: 16px 0;
    flex-direction: column;
    gap: 16px;
  }

  .logo-container {
    position: static;
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 12px;
  }

  .brand-text {
    padding-left: 0;
    text-align: center;
    width: 100%;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .main-nav a {
    white-space: nowrap;
  }

  .side-contact {
    display: none;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  .footer-right {
    align-items: flex-start;
  }

  .main-card {
    padding: 30px;
    margin: 20px auto;
  }

  .to-top {
    bottom: 20px;
    right: 20px;
  }
}

@media(max-width: 600px) {
  .topbar-inner {
    font-size: 12px;
    gap: 12px;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
  }

  .lightbox-nav svg {
    width: 20px;
    height: 20px;
  }

  #lightboxPrev { left: 10px; }
  #lightboxNext { right: 10px; }

  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    right: 20px;
    left: 20px;
    transform: none;
    width: auto;
  }

  .cookie-content {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 16px;
  }

  .cookie-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }

  .cookie-btn {
    min-width: 120px;
  }
}
