/* Font Face Declarations */
@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('assets/fonts/raleway-v37-latin-300.woff2') format('woff2');
}

@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/raleway-v37-latin-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/raleway-v37-latin-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/raleway-v37-latin-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/raleway-v37-latin-700.woff2') format('woff2');
}

/* Base Styles */
:root {
  --primary: #38618c;
  --primary-dark: #2a4a6d; /* Darker version for hover effects */
  --secondary: #a3a8ac;
  --dark: #222;
  --footer-color: #1e3a54; /* Darker version of the primary color */
  --light: #f8f8f8;
  --white: #fff;
  --error: #e74c3c;
  --transition: all 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: "Raleway", sans-serif;
  line-height: 1.6;
  color: var(--dark);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Raleway", sans-serif;
  font-weight: 600;
  line-height: 1.3;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

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

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  position: relative;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 10rem;
  font-weight: 400;
  line-height: 1.6;
}

.section-title:after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: var(--primary);
}

.text-center {
  text-align: center;
}

.text-center:after {
  left: 50%;
  transform: translateX(-50%);
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  background-color: var(--primary);
  color: var(--white);
  border: none; /* Removed border */
  font-family: "Raleway", sans-serif;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

/* Update the primary button hover effect */
.btn:hover {
  background-color: var(--primary-dark); /* Use darker color on hover */
  color: var(--white); /* Keep text white */
}

/* Remove active/clicked effect */
.btn:active {
  transform: none; /* Already removed */
  /* No additional effects on click */
}

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

.btn-outline:hover {
  background-color: transparent;
  color: var(--primary-dark); /* Darker text on hover */
  border-color: var(--primary-dark); /* Darker border on hover */
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10000; /* High z-index to ensure header and dropdown appear above all content */
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  /* Ensure nothing appears behind the header */
  overflow: visible; /* Changed to visible so dropdown can appear */
  /* Ensure solid background - no transparency */
  background: white;
  /* Add a pseudo-element to ensure complete coverage */
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: -1;
}

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

/* Logo styles */
.logo {
  display: flex;
  align-items: center;
}

.logo-image {
  height: 77px; /* Increased by 20% from 64px */
  width: auto;
}


.footer-logo-image {
  height: 58px;
  filter: brightness(0) invert(1);
}

/* Add this to your existing CSS file */

.logo-link {
  display: inline-block;
  cursor: pointer;
}

.logo-link:focus,
.logo-link:active {
  outline: none;
  border: none;
}

/* Navigation and Language Switcher */
.nav-list {
  display: flex;
  list-style: none;
  align-items: center; /* Ensure vertical alignment */
  height: 100%;
}

.nav-link {
  padding: 0.5rem 1rem;
  font-family: "Raleway", sans-serif;
  font-weight: 500;
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-link:focus,
.nav-link:active {
  outline: none;
  border: none;
}

.nav-link:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: var(--transition);
  transform: translateX(-50%);
}

.nav-link:hover:after {
  width: 70%;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background-color: rgba(0, 0, 0, 0.2);
  margin: 0 10px;
}

.lang-item {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  z-index: 10001; /* Higher than header to ensure dropdown appears above hero section */
}

.lang-icon {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.5rem 1rem;
  font-family: "Raleway", sans-serif;
  font-weight: 500;
  height: 100%;
  transition: var(--transition);
  gap: 8px;
}

.lang-icon:hover {
  color: var(--primary);
}

.lang-icon svg {
  width: 16px;
  height: 16px;
}

.lang-icon svg:first-child {
  margin-right: 0;
}

.chevron-icon {
  width: 12px;
  height: 12px;
  transition: transform 0.3s ease;
}

.lang-icon[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.current-lang {
  font-size: 0.9rem;
  font-weight: 500;
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  list-style: none;
  margin: 0;
  padding: 8px 0;
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  z-index: 10002; /* Very high z-index to ensure dropdown appears above hero section */
}

.lang-icon[aria-expanded="true"] + .lang-dropdown,
.lang-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  width: 100%;
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--dark);
  font-family: "Raleway", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.lang-option:hover {
  background-color: var(--light);
  color: var(--primary);
}

.lang-option.active {
  background-color: var(--light);
  color: var(--primary);
  font-weight: 600;
}

.menu-toggle {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  /* Ensure button is accessible */
  min-width: 44px;
  min-height: 44px;
}

.hamburger {
  width: 30px;
  height: 20px;
  position: relative;
}

.hamburger span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: var(--primary);
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: var(--transition);
}

.hamburger span:nth-child(1) {
  top: 0px;
}

.hamburger span:nth-child(2) {
  top: 8px;
}

.hamburger span:nth-child(3) {
  top: 16px;
}

/* Hero Section */
.hero {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  overflow: hidden;
}

/* Add this new rule for the English title spacing */
.hero-title .first-part {
  margin-right: 1.5rem; /* Add extra space between the words */
}

/* Add this new rule for mobile hero title */
.mobile-break {
  display: none;
}

@media (max-width: 768px) {
  .hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .hero-title .first-part,
  .hero-title .second-part {
    display: block;
  }

  /* Add line break for English version on mobile */
  .hero-title.english .first-part::after {
    content: "\A";
    white-space: pre;
  }

  /* Keep hyphen for German version */
  .hero-title.german .first-part::after {
    content: "-";
  }
}

.video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.video-container video {
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.1);
  object-fit: cover;
  transition: transform 2s ease-out;
}

.video-container video.zoom-in {
  transform: translate(-50%, -50%) scale(1);
}

/* Mobile adjustments for hero section */
@media (max-width: 768px) {
  .hero {
    height: 100vh; /* Ensure full height */
  }

  .video-container video {
    object-fit: cover; /* Ensure video covers the container */
  }
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 0 20px;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  letter-spacing: 1px;
  line-height: 1.2;
  max-width: 900px;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  font-weight: 300;
  letter-spacing: 3px;
}

.hero-cta {
  margin-top: 2rem;
}

.btn-hero {
  background-color: var(--primary);
  color: var(--white);
  border: none;
  padding: 15px 35px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  transition: var(--transition);
}

.btn-hero:hover {
  background-color: var(--primary-dark);
  color: var(--white);
  transform: translateY(-2px);
}

/* Hero animations */
.hero-title,
.hero-subtitle {
  transition: opacity 1.5s cubic-bezier(0.19, 1, 0.22, 1), transform 1.5s cubic-bezier(0.19, 1, 0.22, 1);
  will-change: opacity, transform;
}

.hero-title {
  animation-delay: 0.5s;
}

.hero-subtitle {
  animation-delay: 1.2s;
}

/* Add this after the hero section styles */

/* Accessibility - Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .video-container video {
    display: none;
  }

  .hero .video-container {
    background: url("assets/images/parallax/giesserei.jpeg") center / cover no-repeat;
  }

  /* Keep the overlay visible for text contrast */
  .hero .overlay {
    background-color: rgba(0, 0, 0, 0.6);
  }

  /* Disable parallax effects for reduced motion */
  .parallax {
    background-attachment: scroll !important;
    transition: none !important;
  }

  /* Disable animations for reduced motion */
  .animate-on-scroll,
  .scroll-animate {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* Disable marquee animation */
  .marquee-content {
    animation: none !important;
    transform: none !important;
  }
}

/* Partners Section */
.partners {
  padding: 30px 0;
  background-color: var(--light);
  overflow: hidden;
}

.partners-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--secondary);
  margin-top: 30px;
  margin-bottom: 0;
  font-family: "Raleway", sans-serif;
}

.marquee {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.marquee-content {
  display: flex;
  animation: marquee 40s linear infinite;
  white-space: nowrap;
  will-change: transform;
}

/* Stop marquee on mobile and show all logos centered */
@media (max-width: 768px) {
  .marquee {
    overflow: visible;
  }
  
  .marquee-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    animation: none;
    transform: none;
    white-space: normal;
  }
  
  /* Hide duplicate logos on mobile */
  .marquee-content .partner-logo:nth-child(n+9) {
    display: none;
  }
}

.partner-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 60px; /* Increased spacing for better visual separation on desktop */
  padding: 16px; /* Padding around logos on desktop */
  height: 60px;
  vertical-align: middle;
  flex-shrink: 0; /* Prevent logos from shrinking */
}

.partner-logo img {
  max-height: 20px; /* Reduced from 22px to 20px */
  width: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: var(--transition);
}

.partner-logo img[alt="Siemens"],
.partner-logo img[alt="Airbus"] {
  max-height: 16px; /* Reduced from 18px to 16px */
}

.partner-logo img[alt="Porsche"] {
  max-height: 14px; /* Reduced even more for Porsche */
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Introduction Section */
.introduction {
  padding: 60px 0 100px 0;
  background: var(--light);
}

.introduction-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.introduction-content .section-title {
  margin-bottom: 4rem;
}

.introduction-text {
  margin-bottom: 3rem;
}

.about .section-title,
.contact .section-title {
  margin-bottom: 4rem;
}

.introduction-text p {
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: var(--secondary);
  font-weight: 400;
}

.introduction-text p:last-child {
  margin-bottom: 0;
}

/* Responsive improvements for introduction text */
@media (max-width: 768px) {
  .introduction-text p {
    font-size: 1rem;
    line-height: 1.6;
    padding: 0 20px;
  }
}

/* About Section */
.about {
  padding: 100px 0;
  background: var(--white);
}

.about-content {
  display: flex;
  align-items: center;
  gap: 50px;
}

.about-text {
  flex: 1;
  will-change: transform;
}

.about-text p {
  margin-bottom: 1.5rem;
}

.about-paragraphs {
  opacity: 0;
  transform: translateZ(0) translateX(-30px);
  -webkit-transform: translateZ(0) translateX(-30px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform, opacity;
  /* Force hardware acceleration */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.about-paragraphs.animate-on-scroll.active {
  opacity: 1;
  transform: translateZ(0) translateX(0);
  -webkit-transform: translateZ(0) translateX(0);
}

.about-image {
  flex: 1;
  overflow: hidden;
}

.about-image img {
  width: 100%;
  transition: transform 0.5s ease;
}

.about-image:hover img {
  transform: scale(1.05);
}

/* Parallax Sections - Completely revised */
.parallax {
  height: 100vh;
  position: relative;
  overflow: hidden;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center 50%; /* Default position */
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  z-index: 0;
  /* Remove fixed attachment - we'll handle parallax with JS */
  background-attachment: scroll;
}

.parallax::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 0;
}

.parallax-inner {
  position: relative;
  z-index: 10; /* Higher z-index to ensure visibility */
  text-align: center;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Parallax content styling */
.parallax-content {
  width: 100%;
  max-width: 800px;
  padding: 0 20px;
  position: relative;
  z-index: 15;
  opacity: 1 !important;
  visibility: visible !important;
}

.parallax-text {
  margin-bottom: 2rem;
}

.parallax-text h3,
.parallax-heading {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--white) !important;
  margin: 0;
  opacity: 1 !important;
  visibility: visible !important;
}

.parallax-title {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--white) !important;
  margin-bottom: 1.5rem;
  opacity: 1 !important;
  visibility: visible !important;
}

.parallax-button {
  margin-top: 1rem;
}

/* White outline button for parallax */
.btn-outline-white {
  background-color: transparent !important;
  color: var(--white) !important;
  border: 2px solid var(--white) !important;
  border-radius: 4px;
  padding: 12px 30px;
  font-family: "Raleway", sans-serif;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block !important;
  transition: var(--transition);
  opacity: 1 !important;
  visibility: visible !important;
}

.btn-outline-white:hover {
  background-color: var(--white);
  color: var(--dark);
  border-color: var(--white);
}

.parallax-1 {
  background-image: url("assets/images/parallax/giesserei.png");
}

.parallax-2 {
  background-image: url("assets/images/parallax/millingdrill2.jpg");
  background-position: center 30%; /* Position higher to prevent gap at top */
}

/* Mobile adjustments for parallax sections */
@media (max-width: 768px) {
  .parallax {
    height: 60vh;
    background-attachment: scroll !important;
    background-position: center center !important;
    background-size: cover !important;
  }
  
  .parallax-content {
    padding: 0 15px;
  }
  
  .parallax-text h3,
  .parallax-heading {
    font-size: 1.4rem;
    line-height: 1.4;
  }
  
  .parallax-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .parallax {
    height: 50vh;
    background-attachment: scroll !important;
    background-position: center center !important;
    background-size: cover !important;
  }
  
  .parallax-content {
    padding: 0 10px;
  }
  
  .parallax-text h3,
  .parallax-heading {
    font-size: 1.4rem;
    line-height: 1.4;
  }
  
  .parallax-title {
    font-size: 1.3rem;
  }
}

/* Accessibility - Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .parallax {
    background-attachment: scroll !important;
    transition: none !important;
    /* Ensure background is visible and centered */
    background-position: center center !important;
  }
}

/* Products Section */
.products {
  padding: 120px 0; /* Increased padding */
  overflow: hidden; /* Added to contain the off-screen animations */
  position: relative;
  z-index: 1;
  background-color: var(--white);
}

.products .section-title {
  margin-bottom: 4rem; /* Increased space between heading and first product */
}

.product-item {
  display: flex;
  align-items: center;
  margin-bottom: 150px; /* Increased space between products */
  gap: 50px;
  position: relative; /* Added for positioning context */
}

.product-item:last-child {
  margin-bottom: 50px; /* Less margin for the last item */
}

.product-item.reverse {
  flex-direction: row-reverse;
}

.product-image {
  flex: 1;
  overflow: hidden;
  position: relative; /* Added for positioning context */
  /* Force hardware acceleration for container */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.product-image img {
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  /* Force hardware acceleration for images */
  transform: translateZ(0) scale(0.85);
  -webkit-transform: translateZ(0) scale(0.85);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  /* Always ensure images are visible */
  opacity: 1 !important;
  visibility: visible !important;
}

/* Scale to full size when active */
.product-image.scroll-animate.active img,
.scroll-animate.active .product-image img,
.scroll-animate.active img {
  transform: translateZ(0) scale(1);
  -webkit-transform: translateZ(0) scale(1);
}

.product-image:hover img {
  transform: scale(1.05);
}

.product-content {
  flex: 1;
}

.product-text-parallax {
  will-change: transform;
}

/* Disable scroll animations on all-services page for accessibility */
.content-section.animate-on-scroll,
.content-section.animate-on-scroll * {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
}

.content-section.animate-on-scroll.active,
.content-section.animate-on-scroll.active * {
  opacity: 1 !important;
  transform: none !important;
}

.product-content h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.product-content p {
  margin-bottom: 1.5rem;
}

.product-content .btn-solid {
  background-color: var(--primary);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  font-weight: 500;
}

.product-content .btn-solid:hover {
  background-color: var(--primary-dark);
  color: var(--white);
  transform: translateY(-2px);
}

.product-content .btn-solid svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  transition: transform 0.3s ease;
}

.product-content .btn-solid:hover svg {
  transform: translateX(3px);
}

/* Services CTA */
.services-cta {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--light-gray);
}

.services-cta-title {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 1.5rem;
}

.services-subline {
  font-size: 1.2rem;
  color: var(--secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Services Page Styles */
.services-page {
  background-color: #1A3857;
  color: var(--white);
}

.services-hero {
  padding: 120px 0 80px 0;
  background: transparent;
}

.services-hero .hero-title {
  font-size: 3rem;
  color: var(--white);
  text-align: center;
  margin-bottom: 0;
}

.service-section {
  padding: 80px 0;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 3rem;
  margin-top: 3rem;
}

.service-item h3 {
  font-size: 1.5rem;
  color: var(--white);
  margin-bottom: 1rem;
  font-weight: 600;
}

.service-content p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
}

.services-page .section-title {
  color: var(--white);
}

.services-page .footer {
  background-color: #1A3857;
  color: var(--white);
}

.services-page .footer a {
  color: rgba(255, 255, 255, 0.8);
}

.services-page .footer a:hover {
  color: var(--primary);
}

@media (max-width: 768px) {
  .services-hero .hero-title {
    font-size: 2.5rem;
  }
  
  .service-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .process-timeline {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .process-step {
    min-width: auto;
  }
}

/* Enhanced scroll animations for products - scale animation */
.scroll-animate[data-animation="slide-right"],
.scroll-animate[data-animation="slide-left"] {
  transform: scale(0.85); /* Start at 85% size */
  opacity: 1; /* Always visible */
  backface-visibility: hidden; /* Prevent flickering */
  perspective: 1000px; /* Enable 3D transforms */
  transform-origin: center center; /* Scale from center */
}

.scroll-animate {
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  /* Force hardware acceleration */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Ensure smooth animation even during fast scrolling */
  transform: translateZ(0) scale(0.85);
  -webkit-transform: translateZ(0) scale(0.85);
  /* Always ensure 100% opacity for images */
  opacity: 1 !important;
}

.scroll-animate.active {
  transform: translateZ(0) scale(1); /* Scale to full size with GPU acceleration */
  -webkit-transform: translateZ(0) scale(1);
  opacity: 1 !important; /* Keep visible */
}

/* Ensure all images inside scroll-animate containers are always visible */
.scroll-animate img,
.scroll-animate[data-animation] img {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Ensure images are always visible, even if inside animate-on-scroll containers */
.animate-on-scroll img,
.product-image img,
.scroll-animate img {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Contact Section */
.contact {
  padding: 100px 0;
  background-color: var(--white);
  color: var(--dark);
}

.contact .section-title:after {
  background-color: var(--primary);
}

.contact-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 50px;
}

.contact-form {
  flex: 1.5;
}

.form-submission-error {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.form-submission-error p {
  margin: 0;
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-family: "Raleway", sans-serif;
  font-weight: 500;
}

.required {
  color: var(--error);
  margin-left: 3px;
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px; /* Added border radius */
  background-color: var(--white);
  color: var(--dark);
  font-family: "Raleway", sans-serif;
  transition: var(--transition);
}

.form-input:focus {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
  background-color: var(--white);
}

.form-input.error {
  border-color: var(--error);
}

.error-message {
  display: none;
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 5px;
  position: absolute;
  left: 0;
}

.form-group.has-error .error-message {
  display: block;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  padding-bottom: 20px;
}

.checkbox input {
  width: auto;
}

.checkbox label {
  margin-bottom: 0;
  font-weight: 400;
}

.checkbox .error-message {
  bottom: 0;
  top: auto;
}

.contact .btn {
  background-color: var(--primary);
  color: var(--white);
  border-radius: 4px;
}

.contact .btn:hover {
  background-color: var(--primary-dark); /* Darker on hover */
  color: var(--white);
}

.contact-info {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 60px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.info-item {
  flex: 1;
  text-align: center;
  margin-bottom: 0;
}

.info-item h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.info-item h3 svg {
  width: 20px;
  height: 20px;
  stroke: var(--primary);
}

/* Footer */
.footer {
  background: #102A45;
  color: var(--white);
  padding: 50px 0 20px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

/* Desktop: Logo links, Links rechts */
@media (min-width: 769px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
  
  .footer-logo {
    flex: 0 0 auto;
  }
  
  .footer-links {
    flex: 0 0 auto;
  }
  
  .footer-social {
    flex: 0 0 auto;
  }
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 15px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  transition: var(--transition);
  text-decoration: none;
}

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

.social-link i {
  width: 20px;
  height: 20px;
}

.footer-logo {
  display: flex;
  align-items: center;
}

.footer-contact h4 {
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-contact .contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--white);
  font-size: 14px;
  line-height: 1.4;
}

.footer-contact .contact-item i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-links ul {
  display: flex;
  list-style: none;
  gap: 20px;
  margin: 0;
  padding: 0;
}

/* Desktop: Ensure links are horizontal and aligned to the right */
@media (min-width: 769px) {
  .footer-links ul {
    flex-direction: row;
    justify-content: flex-end;
  }
}

.footer-links a:hover {
  color: var(--light);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer-copyright {
  text-align: left;
}

.footer-legal-links {
  text-align: right;
}

.footer-legal-links a {
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

.footer-legal-links a:hover {
  color: var(--white);
}

.footer-divider {
  margin: 0 10px;
  color: rgba(255, 255, 255, 0.4);
}


/* Animation Classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateZ(0) translateY(20px);
  -webkit-transform: translateZ(0) translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, transform;
  /* Force hardware acceleration */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.animate-on-scroll.active {
  opacity: 1;
  transform: translateZ(0) translateY(0);
  -webkit-transform: translateZ(0) translateY(0);
}

/* Optimize animations with will-change for better performance */
.animate-on-scroll,
.scroll-animate {
  will-change: transform, opacity;
  /* Force hardware acceleration */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
}

/* Remove will-change after animation to free up resources */
.scroll-animate.active,
.animate-on-scroll.active {
  will-change: auto;
}


/* Responsive Styles */
@media (max-width: 992px) {
  .about-content,
  .product-item,
  .contact-container {
    flex-direction: column;
  }
  
  .contact-info {
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    justify-content: center;
  }
  
  .info-item {
    margin-bottom: 2rem;
    text-align: center;
    width: 100%;
    max-width: 100%;
  }

  .product-item.reverse {
    flex-direction: column;
  }

  .section-title {
    font-size: 2rem;
  }
}

/* Enhanced mobile styles for service items */
@media (max-width: 768px) {
  .product-item {
    flex-direction: column !important;
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 0;
    width: 100%;
  }

  .product-item.reverse {
    flex-direction: column !important;
  }

  .product-image {
    flex: none;
    width: 100%;
    order: 1;
    padding: 0;
  }

  .product-content {
    flex: none;
    width: 100%;
    order: 2;
    text-align: left;
    padding: 0 1rem;
    max-width: none;
  }

  .product-content h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    width: 100%;
  }

  .product-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    text-align: left;
    max-width: none;
    width: 100%;
  }

  .product-image img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 0;
  }

  /* Ensure scroll-animate animations work on mobile */
  .scroll-animate {
    transform: translateZ(0) scale(0.85) !important;
    -webkit-transform: translateZ(0) scale(0.85) !important;
    opacity: 1 !important;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  }

  .scroll-animate.active {
    transform: translateZ(0) scale(1) !important;
    -webkit-transform: translateZ(0) scale(1) !important;
    opacity: 1 !important;
  }

  .scroll-animate img {
    opacity: 1 !important;
    visibility: visible !important;
  }
}

@media (max-width: 576px) {
  .product-item {
    padding: 0;
    margin-bottom: 2.5rem;
    gap: 1rem;
  }

  .product-content {
    padding: 0 0.75rem;
    margin-top: 4rem; /* Add space between image and text */
  }

  .product-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
  }

  .product-content p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
  }

  .product-image img {
    height: 220px;
  }
  
  /* Main page product section mobile spacing */
  .section-subtitle {
    margin-bottom: 5rem !important; /* Decreased from default */
  }
  
  .products {
    margin-top: 4rem !important; /* Add space above content */
  }
  
  /* About section mobile spacing */
  .about {
    margin-top: 4rem !important; /* Add space above about section */
  }
  
  /* About section title mobile alignment */
  .about .section-title {
    text-align: center !important; /* Center align title on mobile */
  }
}

/* Services page specific mobile optimizations */
@media (max-width: 768px) {
  .products {
    padding: 60px 0;
  }
  
  .products .container {
    padding: 0 0.5rem;
    max-width: none;
    width: 100%;
  }
  
  .section-header {
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
  }
  
  .section-title {
    font-size: 2rem;
    margin-bottom: 1rem;
  }
  
  .section-subtitle {
    font-size: 1rem;
    line-height: 1.6;
    padding: 0;
    max-width: none;
  }
}

@media (max-width: 576px) {
  .products {
    padding: 40px 0;
  }
  
  .products .container {
    padding: 0 0.25rem;
  }
  
  .section-header {
    margin-bottom: 2rem;
    padding: 0 0.25rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .section-subtitle {
    font-size: 0.95rem;
    line-height: 1.5;
  }
}

@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }

  .parallax h2,
  .parallax .parallax-heading {
    font-size: 1.4rem;
  }

  .logo-image {
    height: 62px; /* Increased by 20% from 52px */
  }

  .footer-logo-image {
    height: 46px;
  }

  /* Adjust partner logos for medium screens */
  .partner-logo {
    margin: 0 25px;
  }

  .partner-logo img {
    max-height: 18px;
  }

  .partner-logo img[alt="Siemens"],
  .partner-logo img[alt="Airbus"] {
    max-height: 14px;
  }

  .partner-logo img[alt="Porsche"] {
    max-height: 12px;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: 0;
    background-color: var(--white);
    overflow: hidden;
    transition: height 0.3s ease;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  }

  .nav.active {
    height: auto;
  }

  .nav-list {
    flex-direction: column;
    padding: 20px 0;
  }

  .nav-link {
    display: block;
    padding: 15px 20px;
  }

  .nav-divider {
    display: none;
  }

  .lang-item {
    margin: 10px auto;
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .lang-icon {
    justify-content: center;
    padding: 10px 0;
    width: auto;
  }

  .lang-dropdown {
    display: none; /* Hide dropdown on mobile, use drawer instead */
  }
}

/* Language Drawer Styles - Hidden on desktop, visible on mobile */
@media (min-width: 769px) {
  .lang-drawer {
    display: none !important; /* Hidden on desktop */
    visibility: hidden !important;
    opacity: 0 !important;
  }
}

@media (max-width: 768px) {
  .lang-drawer {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s ease, opacity 0.3s ease;
  }
    
    .lang-drawer.active {
      visibility: visible;
      opacity: 1;
    }
    
    .lang-drawer-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(4px);
    }
    
    .lang-drawer-content {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      background-color: var(--white);
      border-radius: 20px 20px 0 0;
      box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
      transform: translateY(100%);
      transition: transform 0.3s ease;
      max-height: 50vh;
      display: flex;
      flex-direction: column;
    }
    
    .lang-drawer.active .lang-drawer-content {
      transform: translateY(0);
    }
    
    .lang-drawer-header {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      border-bottom: 1px solid rgba(0, 0, 0, 0.1);
      position: relative;
    }
    
    .lang-drawer-title {
      font-size: 1.1rem;
      font-weight: 600;
      color: var(--dark);
      margin: 0;
      text-align: center;
    }
    
    .lang-drawer-close {
      position: absolute;
      right: 20px;
      background: none;
      border: none;
      padding: 8px;
      cursor: pointer;
      color: var(--dark);
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      transition: background-color 0.2s ease;
    }
    
    .lang-drawer-close:hover {
      background-color: var(--light);
    }
    
    .lang-drawer-close svg {
      width: 20px;
      height: 20px;
    }
    
    .lang-drawer-options {
      display: flex;
      flex-direction: column;
      padding: 10px 0;
      overflow-y: auto;
    }
    
    .lang-drawer-option {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 20px;
      background: none;
      border: none;
      text-align: left;
      cursor: pointer;
      transition: background-color 0.2s ease;
      color: var(--dark);
      font-family: "Raleway", sans-serif;
      font-size: 1rem;
      font-weight: 500;
    }
    
    .lang-drawer-option:hover {
      background-color: var(--light);
    }
    
    .lang-drawer-option.active {
      background-color: var(--light);
      color: var(--primary);
    }
    
    .lang-drawer-check {
      width: 20px;
      height: 20px;
      color: var(--primary);
      opacity: 0;
      transition: opacity 0.2s ease;
    }
    
    .lang-drawer-option.active .lang-drawer-check {
      opacity: 1;
    }
  }

  .footer-content {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-links ul {
    justify-content: center;
  }


  .footer-column h4 {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .footer-contact .contact-item {
    justify-content: center;
    font-size: 13px;
    margin-bottom: 8px;
  }

  .footer-links ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  
  /* On mobile, keep social icon centered */
  .footer-social {
    order: 3;
  }

  .footer-links li {
    margin-bottom: 0;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 15px;
  }

  .footer-copyright,
  .footer-legal-links {
    text-align: center;
  }

  /* Adjust partner logos for mobile */
  .partners {
    padding: 20px 0;
  }

  .partner-logo {
    margin: 0;
    height: 50px;
    flex-shrink: 0;
  }

  .partner-logo img {
    max-height: 24px; /* Increased from 16px to 24px */
  }

  .partner-logo img[alt="Siemens"],
  .partner-logo img[alt="Airbus"] {
    max-height: 20px; /* Increased from 12px to 20px */
  }

  .partner-logo img[alt="Porsche"] {
    max-height: 18px; /* Increased from 10px to 18px */
  }


  /* Ensure no white gap at bottom */
  body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .footer {
    margin-top: auto;
  }
}

@media (max-width: 576px) {
  .hero-content h1 {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.8rem;
  }


  .parallax h2,
  .parallax .parallax-heading {
    font-size: 1.4rem;
  }

  /* Further adjust partner logos on very small screens */
  .partner-logo {
    margin: 0 15px;
    height: 45px;
  }

  .partner-logo img {
    max-height: 22px; /* Increased from 14px to 22px */
  }

  .partner-logo img[alt="Siemens"],
  .partner-logo img[alt="Airbus"] {
    max-height: 18px; /* Increased from 11px to 18px */
  }

  .partner-logo img[alt="Porsche"] {
    max-height: 16px; /* Increased from 9px to 16px */
  }
}

/* Accessibility Enhancements */
:focus {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Remove focus outline for all buttons */
button:focus,
button:active,
a.btn:focus,
a.btn:active,
.btn:focus,
.btn:active,
.btn-hero:focus,
.btn-hero:active,
.btn-outline:focus,
.btn-outline:active,
.btn-outline-white:focus,
.btn-outline-white:active,
.btn-rounded:focus,
.btn-rounded:active,
.btn-solid:focus,
.btn-solid:active,
.lang-icon:focus,
.lang-icon:active,
.lang-option:focus,
.lang-option:active,
.menu-toggle:focus,
.menu-toggle:active,
.footer a:focus,
.footer a:active,
.footer-links a:focus,
.footer-links a:active,
.footer-legal-links a:focus,
.footer-legal-links a:active,
.footer-social a:focus,
.footer-social a:active,
.social-link:focus,
.social-link:active {
  outline: none !important;
  border: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip to main content link for keyboard users */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

.btn-rounded {
  border-radius: 4px;
}

.btn-solid {
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 12px 30px;
  font-family: "Raleway", sans-serif;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
  transition: var(--transition);
}

.btn-solid:hover {
  background-color: var(--primary-dark);
  color: var(--white);
  transform: translateY(-2px);
}

/* Add a class for iOS-specific styles */
.ios .parallax {
  background-attachment: scroll !important; /* Fallback for iOS */
}

/* Mobile device specific parallax fixes */
.mobile-device .parallax {
  background-attachment: scroll !important;
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  /* Improve performance on mobile */
  will-change: auto !important;
  transform: none !important;
}

/* Ensure scroll-animate animations work on mobile devices */
.mobile-device .scroll-animate {
  transform: translateZ(0) scale(0.85) !important;
  -webkit-transform: translateZ(0) scale(0.85) !important;
  opacity: 1 !important;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.mobile-device .scroll-animate.active {
  transform: translateZ(0) scale(1) !important;
  -webkit-transform: translateZ(0) scale(1) !important;
  opacity: 1 !important;
}

.mobile-device .parallax-1,
.mobile-device .parallax-2 {
  background-attachment: scroll !important;
  background-position: center center !important;
  background-size: cover !important;
}

/* Additional mobile optimizations */
@media (max-width: 768px) {
  .parallax {
    /* Force hardware acceleration for better performance */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Ensure proper background rendering */
    background-attachment: scroll !important;
    background-position: center center !important;
    background-size: cover !important;
  }
  
  /* Optimize parallax content for mobile */
  .parallax-content {
    /* Reduce complexity for mobile */
    transform: none !important;
    will-change: auto !important;
  }
  
  /* Disable all scroll animations on mobile for accessibility */
  .animate-on-scroll,
  .animate-on-scroll *,
  .scroll-animate,
  .scroll-animate *,
  .product-image,
  .product-image img,
  .about-paragraphs,
  .about-image,
  .about-image img {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
    will-change: auto !important;
  }
  
  .animate-on-scroll.active,
  .scroll-animate.active {
    opacity: 1 !important;
    transform: none !important;
  }
  
  /* Ensure images are always visible on mobile */
  .product-image img,
  .scroll-animate img,
  .about-image img {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
    -webkit-transform: scale(1) !important;
  }
  
  /* Disable hero animations on mobile */
  .hero-title,
  .hero-subtitle,
  .hero-cta {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  
  /* Ensure parallax text elements are visible on mobile */
  .parallax-text,
  .parallax-heading,
  .parallax-button {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  
  /* Ensure section titles and subtitles are visible */
  .section-title,
  .section-subtitle {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  
  /* Ensure contact info is visible */
  .contact-info,
  .info-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
