/* W.T. Autotechnik Custom Styles */

/* Layout System Variables */
:root {
  --header-h: 72px;
  --container: 64rem;            /* 1024px */
  --space-xs: clamp(8px, 1.2vw, 14px);
  --space-s:  clamp(12px, 2vw, 20px);
  --space-m:  clamp(16px, 3vw, 28px);
  --space-l:  clamp(24px, 5vw, 48px);
}

/* Sticky Header with Scroll Protection */
.site-header {
  position: sticky; 
  top: 0; 
  z-index: 1000;
  min-height: var(--header-h);
}

/* Scroll margin for anchors (prevents header overlap) */
[id] { 
  scroll-margin-top: calc(var(--header-h) + 12px); 
}

/* Container System */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-s);
}

/* Logo Animation */
@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

.logo-animation:hover {
  animation: logoFloat 2s ease-in-out infinite;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Button Hover Effects */
.btn-hover-scale {
  transition: all 0.3s ease;
}

.btn-hover-scale:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Service Card Hover Effects */
.service-card {
  transition: all 0.3s ease;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Review Card Styles */
.review-card {
  position: relative;
  overflow: hidden;
}

.review-card::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 10px;
  font-size: 4rem;
  color: #e5e7eb;
  font-family: Georgia, serif;
  z-index: 0;
}

.review-card-content {
  position: relative;
  z-index: 1;
}

/* Navigation Dropdown */
.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

/* Mobile Menu Animation */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-menu.active {
  max-height: 500px;
}

/* Star Rating Animation */
.star-rating {
  display: inline-flex;
}

.star-rating i {
  transition: all 0.2s ease;
}

.star-rating:hover i {
  transform: scale(1.1);
}

/* Form Focus States */
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Loading Animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #1e40af, #dc2626);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Card Shadows */
.card-shadow {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-shadow-lg {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Hero Section Background */
.hero-bg {
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
  position: relative;
  overflow: hidden;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

/* Service Icon Animations */
@keyframes iconBounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

.service-icon:hover {
  animation: iconBounce 1s ease-in-out;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
  .hero-bg {
    padding: 3rem 1rem;
  }
  
  .service-card {
    margin-bottom: 1rem;
  }
  
  .review-card {
    margin-bottom: 1rem;
  }
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-break {
    page-break-before: always;
  }
}

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

/* Focus Indicators */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #1e40af;
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .bg-wt-blue { background-color: #000080 !important; }
  .text-wt-blue { color: #000080 !important; }
  .bg-wt-red { background-color: #8B0000 !important; }
  .text-wt-red { color: #8B0000 !important; }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .auto-dark {
    background-color: #1f2937;
    color: #f9fafb;
  }
}

/* ===== RESPONSIVE LAYOUT FIXES ===== */

/* 1. Hero Section Responsive Fixes */
.hero-section {
  /* Responsive container with max-width */
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 64px);
  
  /* Ensure proper spacing from sticky header */
  scroll-margin-top: 80px;
  
  /* Prevent content overflow */
  overflow: hidden;
  position: relative;
}

/* Hero Typography - Responsive with clamp() */
.hero-title {
  font-size: clamp(2.5rem, 8vw, 7rem) !important;
  line-height: 1.1;
  margin-bottom: clamp(16px, 4vw, 24px);
  word-wrap: break-word;
  hyphens: auto;
}

.hero-subtitle {
  font-size: clamp(1.25rem, 4vw, 3rem) !important;
  line-height: 1.2;
  margin-bottom: clamp(12px, 3vw, 16px);
}

.hero-description {
  font-size: clamp(1rem, 3vw, 1.5rem) !important;
  line-height: 1.4;
  margin-bottom: clamp(16px, 4vw, 24px);
  max-width: 90%;
}

/* Badge Positioning - No absolute positioning */
.hero-badge {
  margin-bottom: clamp(24px, 6vw, 32px) !important;
  position: relative !important;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  padding: clamp(12px, 3vw, 16px) clamp(24px, 6vw, 32px);
  border-radius: 50px;
  font-size: clamp(0.875rem, 2.5vw, 1.125rem);
  font-weight: bold;
  white-space: nowrap;
  max-width: 100%;
}

/* 2. Sticky Header Fixes */
.sticky-header {
  z-index: 9999 !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Compensate for sticky header in page sections */
.section-with-anchor {
  scroll-margin-top: 100px;
}

/* 3. Responsive Section Paddings */
.section-padding {
  padding: clamp(32px, 8vw, 80px) clamp(16px, 4vw, 32px);
}

.section-padding-sm {
  padding: clamp(24px, 6vw, 48px) clamp(16px, 4vw, 24px);
}

/* Container max-widths for better layout control */
.container-responsive {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: clamp(16px, 4vw, 32px);
  padding-right: clamp(16px, 4vw, 32px);
}

/* 4. Button Touch Targets & Responsive Sizing */
.btn-responsive {
  min-height: 44px !important;
  min-width: 44px !important;
  padding: clamp(12px, 3vw, 16px) clamp(20px, 5vw, 32px) !important;
  font-size: clamp(0.875rem, 2.5vw, 1.125rem) !important;
  border-radius: clamp(8px, 2vw, 12px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 12px);
  text-align: center;
  white-space: nowrap;
  
  /* Touch-friendly hover states */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Large buttons for hero sections */
.btn-hero {
  min-height: 56px !important;
  padding: clamp(16px, 4vw, 20px) clamp(32px, 8vw, 40px) !important;
  font-size: clamp(1rem, 3vw, 1.25rem) !important;
}

/* 5. iFrame Responsive Behavior */
.iframe-responsive {
  width: 100%;
  min-height: 750px;
  border: 0;
  border-radius: clamp(8px, 2vw, 16px);
  
  /* Dynamic height based on viewport */
  height: calc(100vh - 200px);
  max-height: 900px;
}

/* YouTube iFrame specific (in aspect-video containers) */
.aspect-video .iframe-responsive {
  height: 100%;
  min-height: auto;
  max-height: none;
}

/* Very small devices adjustment */
@media (max-width: 390px) {
  .iframe-responsive {
    min-height: 820px;
    height: calc(100vh - 120px);
  }
  
  .hero-title {
    font-size: 2rem !important;
  }
  
  .hero-subtitle {
    font-size: 1.125rem !important;
  }
}

/* 6. NEW HERO & USP STRUCTURE - Clean Layout System */

/* New Hero Section Structure - Clean & Responsive */
.hero-new {
  position: relative;
  padding: calc(var(--header-h) + var(--space-l)) var(--space-s) var(--space-l);
  text-align: center;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__inner {
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 10;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: #be1322;           /* CI Rot */
  color: #fff;
  margin: 0 0 var(--space-s);
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: clamp(12px, 1.8vw, 16px);
}

.hero__badge-icon { 
  font-weight: 900; 
}

.hero-new h1 {
  font-size: clamp(28px, 6vw, 56px);
  line-height: 1.15;
  margin: 0 0 var(--space-s);
  color: white;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.hero__subtitle {
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.55;
  margin: 0 auto var(--space-m);
  max-width: 52rem;
  color: white;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

.hero__cta {
  display: inline-flex;
  gap: var(--space-s);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-m);
}

/* Unified Button System */
.btn-new {
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  min-height: 44px; 
  padding: 0.75rem 1.25rem; 
  border-radius: 12px;
  text-decoration: none; 
  font-weight: 700;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn-new--primary { 
  background: #be1322; 
  color: #fff; 
  border-color: #be1322;
}

.btn-new--primary:hover {
  background: #9d0f1a;
  border-color: #9d0f1a;
  transform: translateY(-2px);
}

.btn-new--ghost { 
  background: transparent; 
  border: 2px solid #be1322; 
  color: #ffffff;
}

.btn-new--ghost:hover {
  background: #be1322;
  color: #ffffff;
  transform: translateY(-2px);
}

/* Background decoration (non-interactive) */
.hero__bg { 
  pointer-events: none; 
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* USP Section - Clean Grid Structure */
.usp-new { 
  padding: var(--space-l) var(--space-s); 
}

.usp__grid {
  list-style: none; 
  padding: 0; 
  margin: 0;
  display: grid; 
  gap: var(--space-m);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .usp__grid { 
    grid-template-columns: repeat(2, 1fr); 
  }
}

@media (min-width: 1024px) {
  .usp__grid { 
    grid-template-columns: repeat(4, 1fr); 
  }
}

/* 6. Typography Scaling */
.text-responsive-xl {
  font-size: clamp(1.25rem, 4vw, 2rem);
  line-height: 1.3;
}

.text-responsive-lg {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  line-height: 1.4;
}

.text-responsive-base {
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  line-height: 1.5;
}

/* 7. Grid Responsive Improvements */
.grid-responsive {
  display: grid;
  gap: clamp(16px, 4vw, 32px);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-responsive-2 {
  display: grid;
  gap: clamp(16px, 4vw, 32px);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid-responsive-3 {
  display: grid;
  gap: clamp(16px, 4vw, 24px);
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* 8. Service Cards Responsive */
.service-card-responsive {
  padding: clamp(24px, 6vw, 32px);
  border-radius: clamp(12px, 3vw, 16px);
  margin-bottom: clamp(16px, 4vw, 24px);
}

/* 9. Background Elements - Prevent Content Overlap */
.bg-decorative {
  pointer-events: none !important;
  user-select: none;
  z-index: -1;
  opacity: 0.05;
}

.bg-decorative[aria-hidden="true"] {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(64px, 20vw, 128px);
  height: clamp(64px, 20vw, 128px);
}

/* 10. Performance & Accessibility */
.font-display-swap {
  font-display: swap;
}

.preload-hint {
  content-visibility: auto;
  contain-intrinsic-size: 200px;
}

/* 11. Breakpoint-Specific Adjustments */
@media (max-width: 360px) {
  .hero-section {
    padding: 16px;
  }
  
  .container-responsive {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .btn-responsive {
    font-size: 0.875rem !important;
    padding: 12px 16px !important;
  }
}

@media (min-width: 361px) and (max-width: 414px) {
  .hero-title {
    font-size: clamp(2.25rem, 7vw, 3rem) !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .hero-title {
    font-size: clamp(3.5rem, 8vw, 5rem) !important;
  }
  
  .grid-responsive-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .container-responsive {
    max-width: 1200px;
  }
  
  .hero-section {
    max-width: 1080px;
  }
}