/* Hero Slider CSS Variables */
:root {
  --accent: #1a76d1;
  --accent-hover: #155ba3;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.1);
  --transition-fast: all 0.6s ease-in-out;
  --transition-smooth: all 0.75s ease-in-out;
  --glass-bg: rgba(255, 255, 255, 0.76);
  --glass-blur: blur(7px);
  --overlay-gradient: linear-gradient(135deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.15) 100%);
  
  /* Background Transition Variables */
  --bg-overlay-light: rgba(0, 0, 0, 0.1);
  --bg-overlay-medium: rgba(0, 0, 0, 0.3);
  --bg-overlay-dark: rgba(0, 0, 0, 0.5);
  --bg-blur-amount: blur(20px);
  --bg-blur-scale: scale(1.1);
  
  /* Consistent Timing Variables */
  --slide-transition-duration: 0.8s;
  --content-transition-duration: 0.6s;
  --fade-out-duration: 0.4s;
  --autoplay-duration: 6s;
  
  /* Navbar Height Variables */
  --nav-h: 80px;
}

.hero-container { 
  position: relative;
  margin: 0;
  padding: 0;
  border: none;
}

/* wrapper tinggi penuh minus navbar */
.slides-wrapper { 
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
}

/* Hero Slider Container - Dynamic Background from Active Slide */
.hero-slider {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--nav-h));
  min-height: 480px;
  max-height: 780px;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: none;
  z-index: 1;
  /* Dynamic background from active slide image */
  background: #2c3e50; /* Fallback only */
  /* CLS Prevention */
  contain: layout style paint;
  will-change: auto;
  /* Ensure smooth rendering */
  transform: translateZ(0);
  backface-visibility: hidden;
  /* Additional smoothness */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dynamic Background Layer - Blurred version of active slide */
.hero-slider::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: var(--bg-blur-amount);
  transform: var(--bg-blur-scale);
  opacity: 0.4;
  transition: opacity 0.8s ease-in-out, filter 0.8s ease-in-out;
  pointer-events: none;
}

/* Background overlay to ensure content readability */
.hero-slider::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: var(--bg-overlay-medium);
  pointer-events: none;
}

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
  .hero-slider {
    height: calc(100vh - var(--nav-h));
    max-height: 780px;
  }
  
  /* Large desktop hero cards for logo slides */
  .hero-slide:nth-child(1) .hero-card,
  .hero-slide:nth-child(2) .hero-card,
  .hero-slide:nth-child(3) .hero-card {
    width: min(85vw, 650px) !important;
    max-width: 650px !important;
    min-height: clamp(420px, 50vh, 520px) !important;
    padding: clamp(28px, 4vw, 48px) !important;
  }
  
  /* Large desktop logo sizing */
  .hero-logo {
    width: clamp(140px, 22vw, 220px) !important;
    max-width: 220px !important;
  }
  
  /* Large desktop title image sizing */
  .hero-title-image {
    width: clamp(320px, 75vw, 500px) !important;
    max-width: 500px !important;
  }
  
  /* Large desktop subtitle */
  .hero-slide:nth-child(1) .hero-subtitle,
  .hero-slide:nth-child(2) .hero-subtitle,
  .hero-slide:nth-child(3) .hero-subtitle {
    font-size: clamp(1rem, 2.3vw, 1.2rem) !important;
  }
  
  /* Large desktop button */
  .hero-slide:nth-child(1) .hero-btn,
  .hero-slide:nth-child(2) .hero-btn,
  .hero-slide:nth-child(3) .hero-btn {
    padding: clamp(12px, 2.5vw, 16px) clamp(20px, 4vw, 28px) !important;
    font-size: clamp(0.9rem, 1.8vw, 1rem) !important;
    min-width: clamp(140px, 25vw, 180px) !important;
    max-width: clamp(220px, 40vw, 300px) !important;
  }
  
  /* Large desktop adjustments for slide 4 (Pabrik Pengolahan Makanan) */
  .hero-slide:nth-child(4) .hero-title {
    font-size: clamp(1.6rem, 4.2vw, 2.8rem) !important;
    line-height: 1.12 !important;
    margin-bottom: clamp(10px, 1.8vw, 18px) !important;
  }
  
  .hero-slide:nth-child(4) .hero-subtitle {
    font-size: clamp(0.9rem, 2.1vw, 1.1rem) !important;
    line-height: 1.45 !important;
    margin-bottom: clamp(18px, 3.2vw, 28px) !important;
  }
  
  .hero-slide:nth-child(4) .hero-card {
    min-height: clamp(400px, 48vh, 480px) !important;
    padding: clamp(24px, 4.2vw, 42px) !important;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .hero-slider {
    height: calc(100vh - var(--nav-h));
    min-height: 520px;
    max-height: 680px;
  }
}

@media (max-width: 767px) {
  .hero-slider {
    height: calc(100vh - var(--nav-h));
    min-height: 480px;
    max-height: 600px;
  }
  
  /* mobile: clean styles without transforms */
  .hero-card{ 
    margin-top: 0 !important; 
    padding: 20px;
  }
}

/* Individual Slide - Simple Smooth Fade (Anti-Flicker) */
.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  visibility: hidden;
  /* Simplified single transition - prevents conflicts */
  transition: opacity var(--slide-transition-duration) ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  /* Essential hardware acceleration only */
  transform: translateZ(0);
  backface-visibility: hidden;
  /* Transparent background - let container handle background */
  background: transparent;
  /* Smooth rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
  /* Ensure immediate visibility without delay */
  transition: opacity var(--slide-transition-duration) ease-in-out;
}

.hero-slide.active .hero-card {
  opacity: 1;
  visibility: visible;
}

/* Simplified Content Animation - No Stagger to Prevent Flicker */
.hero-slide.active .hero-card {
  opacity: 1;
  visibility: visible;
  transform: translateZ(0);
  /* Single smooth transition without delays */
  transition: opacity var(--content-transition-duration) ease-in-out;
}

.hero-slide.active .hero-logo-container {
  opacity: 1 !important;
  transform: none !important;
  /* No transition for logo to prevent flicker */
  transition: none !important;
}

.hero-slide.active .hero-title {
  opacity: 1;
  transform: translateY(0);
  /* Simple fade without stagger */
  transition: opacity var(--content-transition-duration) ease-in-out;
}

.hero-slide.active .hero-subtitle {
  opacity: 1;
  transform: translateY(0);
  /* Simple fade without stagger */
  transition: opacity var(--content-transition-duration) ease-in-out;
}

.hero-slide.active .hero-actions {
  opacity: 1;
  transform: translateY(0);
  /* Simple fade without stagger */
  transition: opacity var(--content-transition-duration) ease-in-out;
}

.hero-slide.fade-in {
  opacity: 1;
  visibility: visible;
  z-index: 2;
  /* Simplified fade-in */
  transition: opacity var(--slide-transition-duration) ease-in-out;
}

.hero-slide.fade-out {
  opacity: 0;
  visibility: hidden;
  z-index: 1;
  /* Quick fade-out to prevent overlap flicker */
  transition: opacity var(--fade-out-duration) ease-out;
}

/* Simplified crossfade without transform conflicts */
.hero-slide.transitioning-out {
  opacity: 0;
  z-index: 1;
  /* Quick exit to prevent flicker */
  transition: opacity var(--fade-out-duration) ease-out;
  transform: translateZ(0);
}

.hero-slide.transitioning-in {
  opacity: 1;
  z-index: 2;
  /* Smooth entrance */
  transition: opacity var(--slide-transition-duration) ease-in-out;
  transform: translateZ(0);
}

/* Background Overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,.4) 0%, rgba(0,0,0,.2) 100%);
  z-index: 1;
}

/* Content Container */
.hero-content {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px 18px 20px;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* This rule is now handled above in the consolidated section */


/* Hero Logo - Responsive for All Devices */
.hero-logo {
  width: clamp(120px, 20vw, 200px) !important;
  height: auto !important;
  max-width: 200px !important;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
  /* Remove transition effects */
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  /* Ensure proper display */
  display: block !important;
  margin: 0 auto !important;
}

/* Hero Title Image - Responsive for All Devices */
.hero-title-image {
  width: clamp(280px, 70vw, 450px) !important;
  height: auto !important;
  max-width: 450px !important;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
  /* Remove transition effects */
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  /* Force positioning */
  display: block !important;
  margin: 0 auto !important;
}

/* RESPONSIVE HERO-CARD FOR ALL LOGO SLIDES (1-3) - DEVICE OPTIMIZED */
.hero-slide:nth-child(1) .hero-card,
.hero-slide:nth-child(2) .hero-card,
.hero-slide:nth-child(3) .hero-card {
  background: var(--glass-bg) !important;
  backdrop-filter: var(--glass-blur) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  
  /* Responsive padding and sizing */
  padding: clamp(20px, 4vw, 40px) !important;
  width: min(90vw, 600px) !important;
  max-width: 600px !important;
  
  /* Flexible height based on content */
  min-height: clamp(320px, 40vh, 480px) !important;
  height: auto !important;
  max-height: none !important;
  
  /* Layout properties */
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: center !important;
  text-align: center !important;
  
  /* Ensure proper spacing */
  gap: clamp(12px, 2vw, 20px) !important;
  
  /* Prevent overflow */
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.hero-slide:nth-child(1) .hero-logo-container,
.hero-slide:nth-child(2) .hero-logo-container,
.hero-slide:nth-child(3) .hero-logo-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: clamp(8px, 1.5vw, 16px) !important;
  margin-bottom: 0 !important;
  width: 100% !important;
  flex-shrink: 0 !important;
}

.hero-slide:nth-child(1) .hero-subtitle,
.hero-slide:nth-child(2) .hero-subtitle,
.hero-slide:nth-child(3) .hero-subtitle {
  font-size: clamp(0.9rem, 2.2vw, 1.1rem) !important;
  color: #4a5568 !important;
  margin: 0 !important;
  line-height: 1.5 !important;
  font-weight: 400 !important;
  text-align: center !important;
  width: 100% !important;
  flex-shrink: 0 !important;
  padding: 0 clamp(8px, 2vw, 16px) !important;
}

.hero-slide:nth-child(1) .hero-actions,
.hero-slide:nth-child(2) .hero-actions,
.hero-slide:nth-child(3) .hero-actions {
  display: flex !important;
  gap: clamp(8px, 2vw, 16px) !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  width: 100% !important;
  margin-top: 0 !important;
  flex-shrink: 0 !important;
}

.hero-slide:nth-child(1) .hero-btn,
.hero-slide:nth-child(2) .hero-btn,
.hero-slide:nth-child(3) .hero-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: clamp(10px, 2.5vw, 14px) clamp(16px, 4vw, 24px) !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: clamp(0.8rem, 1.8vw, 0.95rem) !important;
  text-decoration: none !important;
  cursor: pointer !important;
  border: 2px solid transparent !important;
  min-width: clamp(120px, 25vw, 160px) !important;
  max-width: clamp(200px, 40vw, 280px) !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* ===== UNIFIED HERO-CARD SYSTEM - SINGLE SOURCE OF TRUTH ===== */
.hero-card {
  /* Visual Styling */
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.2);
  
  /* Layout */
  padding: clamp(24px, 5vw, 48px);
  text-align: center;
  max-width: 600px;
  width: 100%;
  position: relative;
  z-index: 2;
  margin-top: 0;
  
  /* Default sizing for text slides (4-12) */
  height: clamp(380px, 45vh, 520px);
  min-height: clamp(380px, 45vh, 520px);
  max-height: clamp(380px, 45vh, 520px);
  
  /* Flexbox for content alignment */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  
  /* Simplified Animation System - Anti-Flicker */
  opacity: 0;
  visibility: hidden;
  transform: translateZ(0); /* Hardware acceleration only */
  
  /* Simple Smooth Transition */
  transition: opacity 0.6s ease-in-out;
  will-change: opacity;
  backface-visibility: hidden;
  /* Performance optimizations */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Active State - Immediate Visibility to Prevent Flicker */
.hero-slide.active .hero-card {
  opacity: 1;
  visibility: visible;
  /* Immediate transition without delay */
  transition: opacity 0.6s ease-in-out;
}

/* Transition States for Smooth Crossfade */
.hero-slide.fade-out .hero-card {
  opacity: 0;
  visibility: hidden;
}

/* Remove individual element state management - let card handle all content */

/* Removed all keyframe animations to prevent cascade errors */

/* ===== HERO-CARD CONTENT STYLING ===== */
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 clamp(12px, 2vw, 20px) 0;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  /* Content inherits visibility from parent .hero-card */
}

/* Special styling for slide 4 (Pabrik Pengolahan Makanan) - Smaller title */
.hero-slide:nth-child(4) .hero-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem) !important;
  font-weight: 600 !important;
  line-height: 1.1 !important;
  margin: 0 0 clamp(8px, 1.5vw, 16px) 0 !important;
  /* Better text wrapping for long titles */
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  hyphens: auto !important;
}

/* Adjust subtitle for slide 4 to give more space */
.hero-slide:nth-child(4) .hero-subtitle {
  font-size: clamp(0.85rem, 2vw, 1rem) !important;
  line-height: 1.4 !important;
  margin: 0 0 clamp(16px, 3vw, 24px) 0 !important;
}

/* Adjust card height for slide 4 to accommodate content better */
.hero-slide:nth-child(4) .hero-card {
  min-height: clamp(380px, 45vh, 500px) !important;
  padding: clamp(20px, 4vw, 36px) !important;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #4a5568;
  margin: 0 0 clamp(24px, 4vw, 32px) 0;
  line-height: 1.6;
  font-weight: 400;
  /* Content inherits visibility from parent .hero-card */
}

/* Action Buttons */
.hero-actions {
  display: flex;
  gap: clamp(12px, 3vw, 20px);
  justify-content: center;
  flex-wrap: wrap;
  /* Content inherits visibility from parent .hero-card */
}

/* Logo Container - No Transition Effects for slides 1-3 */
.hero-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2vw, 20px);
  margin-bottom: clamp(20px, 3vw, 28px);
  /* Remove transition effects for logo slides */
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  will-change: auto;
  /* Ensure consistent positioning across all logo slides */
  justify-content: center;
  text-align: center;
}

/* This rule is now handled above in the consolidated section */

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2vw, 16px) clamp(20px, 4vw, 32px);
  border-radius: 12px;
  font-weight: 600;
  font-size: clamp(0.875rem, 2vw, 1rem);
  text-decoration: none;
  transition: var(--transition-fast);
  cursor: pointer;
  border: 2px solid transparent;
  min-width: 140px;
  text-align: center;
  will-change: transform, box-shadow;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-light);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 8px 20px rgba(26, 118, 209, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-light);
}

/* Enhanced Navigation Arrows with Spam-Click Prevention */
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 10;
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  opacity: 1;
  touch-action: manipulation;
  user-select: none;
  will-change: transform, background, box-shadow;
  
  /* Enhanced interaction states */
  outline: none;
  border: 2px solid transparent;
  
  /* Prevent text selection and context menu */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.hero-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.hero-nav:active:not(:disabled) {
  transform: translateY(-50%) scale(0.95);
  background: rgba(255, 255, 255, 1);
  transition: all 0.1s ease;
}

.hero-nav:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(26, 118, 209, 0.2);
}

/* Enhanced disabled state for spam-click prevention */
.hero-nav:disabled,
.hero-nav.nav-disabled {
  background: rgba(255, 255, 255, 0.4) !important;
  color: rgba(51, 51, 51, 0.4) !important;
  cursor: not-allowed !important;
  transform: translateY(-50%) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
  pointer-events: none;
}

/* Transitioning state visual feedback */
.hero-nav.nav-transitioning {
  background: rgba(255, 255, 255, 0.6);
  color: rgba(51, 51, 51, 0.6);
  cursor: wait;
  animation: nav-pulse 1s ease-in-out infinite alternate;
}

@keyframes nav-pulse {
  0% { opacity: 0.6; }
  100% { opacity: 0.8; }
}

/* Cooldown state visual feedback */
.hero-nav.nav-cooldown {
  background: rgba(255, 255, 255, 0.7);
  color: rgba(51, 51, 51, 0.7);
  cursor: wait;
  animation: nav-cooldown 0.1s ease-out;
}

@keyframes nav-cooldown {
  0% { transform: translateY(-50%) scale(0.9); }
  100% { transform: translateY(-50%) scale(1); }
}

.hero-nav svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.hero-nav:hover:not(:disabled) svg {
  transform: scale(1.1);
}

.hero-nav:active:not(:disabled) svg {
  transform: scale(0.9);
}

.hero-nav:disabled svg,
.hero-nav.nav-disabled svg {
  opacity: 0.5;
}

.hero-prev {
  left: 20px;
}

.hero-next {
  right: 20px;
}

/* Ensure no gaps or lines below hero slider */
.hero-slider::after,
.hero-container::after,
.slides-wrapper::after,
#heroHotfix::after,
#heroHotfix.hero-slider::after,
#heroHotfix.hero-slider.hero-section-animate::after,
#heroHotfix.hero-slider.hero-section-animate.touch-enabled::after,
#heroHotfix.hero-slider.hero-section-animate.touch-enabled.animate-in::after {
  display: none !important;
  content: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Remove any default spacing that might create lines */
section.hero-slider,
#heroHotfix,
#heroHotfix.hero-slider,
#heroHotfix.hero-slider.hero-section-animate,
#heroHotfix.hero-slider.hero-section-animate.touch-enabled,
#heroHotfix.hero-slider.hero-section-animate.touch-enabled.animate-in {
  margin: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  border: none !important;
}

/* Ensure smooth connection to next section */
.hero-slider + section,
.hero-slider + .section,
section.about-section-enhanced {
  margin-top: 0 !important;
  padding-top: 60px;
}

/* Responsive Design */
@media (min-width: 768px) {
  .hero-container {
    padding-top: var(--nav-h-lg);
  }
}

@media (min-width: 480px) {
  .slides-wrapper {
    min-height: 480px;
  }
}

@media (min-width: 768px) {
  .slides-wrapper {
    min-height: 520px;
  }
}

/* ===== RESPONSIVE HERO-CARD BREAKPOINTS ===== */
@media (max-width: 768px) {
  .hero-card {
    /* Tablet adjustments */
    padding: clamp(18px, 4vw, 24px);
    height: clamp(350px, 42vh, 420px);
    min-height: clamp(350px, 42vh, 420px);
    max-height: clamp(350px, 42vh, 420px);
    margin-top: 0;
  }
  
  .hero-title {
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  }
  
  .hero-subtitle {
    font-size: clamp(0.9rem, 2.2vw, 1.1rem);
    margin: 0 0 clamp(20px, 3.5vw, 28px) 0;
  }
}

@media (max-width: 576px) {
  .hero-card {
    /* Mobile adjustments */
    padding: clamp(16px, 3.5vw, 20px);
    height: clamp(320px, 38vh, 380px);
    min-height: clamp(320px, 38vh, 380px);
    max-height: clamp(320px, 38vh, 380px);
    margin-top: 0;
  }
  
  .hero-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    margin: 0 0 clamp(10px, 1.8vw, 16px) 0;
  }
  
  .hero-subtitle {
    font-size: clamp(0.85rem, 2vw, 1rem);
    margin: 0 0 clamp(18px, 3vw, 24px) 0;
  }
  
  .hero-actions {
    gap: clamp(10px, 2.5vw, 16px);
  }
}

/* Tablet Devices (768px and down) */
@media (max-width: 768px) {
  .hero-slider {
    height: clamp(450px, 65vh, 600px);
    min-height: 450px;
    margin: 0;
    padding: 0;
    border: none;
  }
  
  /* Tablet optimized hero cards for logo slides */
  .hero-slide:nth-child(1) .hero-card,
  .hero-slide:nth-child(2) .hero-card,
  .hero-slide:nth-child(3) .hero-card {
    width: min(88vw, 480px) !important;
    max-width: 480px !important;
    min-height: clamp(350px, 45vh, 420px) !important;
    height: auto !important;
    padding: clamp(18px, 3.5vw, 24px) !important;
    margin: 0 auto !important;
    gap: clamp(10px, 1.8vw, 16px) !important;
  }
  
  /* Tablet logo sizing */
  .hero-logo {
    width: clamp(100px, 18vw, 150px) !important;
    max-width: 150px !important;
  }
  
  /* Tablet title image sizing */
  .hero-title-image {
    width: clamp(240px, 60vw, 350px) !important;
    max-width: 350px !important;
  }
  
  /* Tablet subtitle */
  .hero-slide:nth-child(1) .hero-subtitle,
  .hero-slide:nth-child(2) .hero-subtitle,
  .hero-slide:nth-child(3) .hero-subtitle {
    font-size: clamp(0.85rem, 2vw, 1rem) !important;
    padding: 0 clamp(6px, 1.5vw, 12px) !important;
  }
  
  /* Tablet button */
  .hero-slide:nth-child(1) .hero-btn,
  .hero-slide:nth-child(2) .hero-btn,
  .hero-slide:nth-child(3) .hero-btn {
    padding: clamp(10px, 2.2vw, 14px) clamp(16px, 3.5vw, 20px) !important;
    font-size: clamp(0.75rem, 1.6vw, 0.85rem) !important;
    min-width: clamp(110px, 22vw, 150px) !important;
    max-width: clamp(180px, 38vw, 240px) !important;
  }
  
  /* Tablet adjustments for slide 4 (Pabrik Pengolahan Makanan) */
  .hero-slide:nth-child(4) .hero-title {
    font-size: clamp(1.3rem, 3.8vw, 2rem) !important;
    line-height: 1.08 !important;
    margin-bottom: clamp(7px, 1.2vw, 12px) !important;
  }
  
  .hero-slide:nth-child(4) .hero-subtitle {
    font-size: clamp(0.8rem, 1.9vw, 0.9rem) !important;
    line-height: 1.35 !important;
    margin-bottom: clamp(14px, 2.5vw, 20px) !important;
  }
  
  .hero-slide:nth-child(4) .hero-card {
    min-height: clamp(340px, 42vh, 400px) !important;
    padding: clamp(18px, 3.2vw, 24px) !important;
  }
  
  /* Text slides for tablet */
  .hero-card {
    margin: 0 auto;
    padding: clamp(18px, 3.5vw, 24px);
    max-width: 480px;
    height: clamp(300px, 38vh, 380px);
    min-height: clamp(300px, 38vh, 380px);
    max-height: clamp(300px, 38vh, 380px);
  }
  
  /* Mobile Logo Adjustments - Consistent for all logo slides */
  .hero-slide:nth-child(1) .hero-logo-container,
  .hero-slide:nth-child(2) .hero-logo-container,
  .hero-slide:nth-child(3) .hero-logo-container {
    gap: clamp(8px, 1.5vw, 12px) !important;
    margin-bottom: clamp(12px, 2.5vw, 16px) !important;
  }
  
  /* Consistent mobile subtitle spacing for logo slides */
  .hero-slide:nth-child(1) .hero-subtitle,
  .hero-slide:nth-child(2) .hero-subtitle,
  .hero-slide:nth-child(3) .hero-subtitle {
    margin-bottom: clamp(18px, 3vw, 22px) !important;
    font-size: clamp(0.9rem, 2.2vw, 1.1rem) !important;
  }
  
  /* Consistent mobile actions for logo slides */
  .hero-slide:nth-child(1) .hero-actions,
  .hero-slide:nth-child(2) .hero-actions,
  .hero-slide:nth-child(3) .hero-actions {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
  }
  
  /* Consistent mobile buttons for logo slides */
  .hero-slide:nth-child(1) .hero-btn,
  .hero-slide:nth-child(2) .hero-btn,
  .hero-slide:nth-child(3) .hero-btn {
    width: 100% !important;
    max-width: 280px !important;
    padding: 14px 24px !important;
  }
  
  .hero-logo {
    width: clamp(108px, 18vw, 162px) !important;
    max-width: 162px !important;
  }
  
  .hero-title-image {
    width: clamp(648px, 126vw, 864px) !important;
    max-width: 864px !important;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  .hero-btn {
    width: 100%;
    max-width: 280px;
    padding: 14px 24px;
  }
  
  .hero-nav {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.85);
  }
  
  .hero-nav:hover {
    background: rgba(255, 255, 255, 0.95);
  }
  
  .hero-nav svg {
    width: 16px;
    height: 16px;
  }
  
  .hero-prev {
    left: 16px;
  }
  
  .hero-next {
    right: 16px;
  }
  
  /* Responsive nav indicators for tablet */
  .hero-indicators {
    bottom: 20px;
    padding: 8px 16px;
  }
  
  .hero-dots-container {
    gap: 6px;
    max-width: 240px;
  }
  
  .hero-dot {
    width: 7px;
    height: 7px;
  }
  
  .hero-dot.active {
    width: 20px;
    height: 7px;
  }
}

/* Navigation Button Touch Optimization */
@media (max-width: 768px) {
  .hero-nav {
    width: 44px;
    height: 44px;
    /* Larger touch target for mobile */
    min-width: 44px;
    min-height: 44px;
  }
  
  .hero-nav svg {
    width: 16px;
    height: 16px;
  }
}

/* Extra Small Devices (phones, 480px and down) */
@media (max-width: 480px) {
  .hero-slider {
    height: clamp(400px, 60vh, 500px);
    min-height: 400px;
    margin: 0;
    padding: 0;
    border: none;
  }
  
  .hero-nav {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
  
  .hero-nav svg {
    width: 14px;
    height: 14px;
  }
  
  .hero-container {
    padding-top: 0;
    margin: 0;
    padding-bottom: 0;
  }
  
  /* Mobile optimized hero cards for logo slides */
  .hero-slide:nth-child(1) .hero-card,
  .hero-slide:nth-child(2) .hero-card,
  .hero-slide:nth-child(3) .hero-card {
    width: min(85vw, 350px) !important;
    max-width: 350px !important;
    min-height: clamp(280px, 35vh, 320px) !important;
    height: auto !important;
    padding: clamp(16px, 3vw, 20px) !important;
    margin: 0 auto !important;
    gap: clamp(8px, 1.5vw, 12px) !important;
  }
  
  /* Mobile logo sizing */
  .hero-logo {
    width: clamp(80px, 15vw, 120px) !important;
    max-width: 120px !important;
  }
  
  /* Mobile title image sizing */
  .hero-title-image {
    width: clamp(200px, 50vw, 280px) !important;
    max-width: 280px !important;
  }
  
  /* Mobile subtitle */
  .hero-slide:nth-child(1) .hero-subtitle,
  .hero-slide:nth-child(2) .hero-subtitle,
  .hero-slide:nth-child(3) .hero-subtitle {
    font-size: clamp(0.8rem, 1.8vw, 0.9rem) !important;
    padding: 0 clamp(4px, 1vw, 8px) !important;
  }
  
  /* Mobile button */
  .hero-slide:nth-child(1) .hero-btn,
  .hero-slide:nth-child(2) .hero-btn,
  .hero-slide:nth-child(3) .hero-btn {
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 16px) !important;
    font-size: clamp(0.7rem, 1.5vw, 0.8rem) !important;
    min-width: clamp(100px, 20vw, 140px) !important;
    max-width: clamp(160px, 35vw, 200px) !important;
  }
  
  /* Mobile adjustments for slide 4 (Pabrik Pengolahan Makanan) */
  .hero-slide:nth-child(4) .hero-title {
    font-size: clamp(1.2rem, 3.5vw, 1.8rem) !important;
    line-height: 1.05 !important;
    margin-bottom: clamp(6px, 1vw, 10px) !important;
  }
  
  .hero-slide:nth-child(4) .hero-subtitle {
    font-size: clamp(0.75rem, 1.8vw, 0.85rem) !important;
    line-height: 1.3 !important;
    margin-bottom: clamp(12px, 2vw, 16px) !important;
  }
  
  .hero-slide:nth-child(4) .hero-card {
    min-height: clamp(300px, 38vh, 360px) !important;
    padding: clamp(16px, 3vw, 20px) !important;
  }
  
  /* Text slides for mobile */
  .hero-title {
    font-size: clamp(18px, 4vw, 24px);
    line-height: 1.2;
    margin-bottom: 8px;
  }
  
  .hero-subtitle {
    font-size: clamp(12px, 2.5vw, 14px);
    line-height: 1.4;
    margin-bottom: 12px;
  }
  
  .hero-card {
    padding: clamp(16px, 3vw, 20px);
    max-width: 350px;
    margin: 0 auto;
    height: clamp(250px, 30vh, 300px);
    min-height: clamp(250px, 30vh, 300px);
    max-height: clamp(250px, 30vh, 300px);
  }
  
  .hero-btn {
    padding: 12px 20px;
    font-size: 14px;
    min-width: 140px;
  }
  
  /* Mobile nav indicators */
  .hero-indicators {
    bottom: 16px;
    padding: 6px 12px;
    border-radius: 30px;
  }
  
  .hero-dots-container {
    gap: 5px;
    max-width: 200px;
    overflow-x: scroll;
    padding: 2px 0;
  }
  
  .hero-dot {
    width: 6px;
    height: 6px;
    min-width: 6px;
  }
  
  .hero-dot.active {
    width: 16px;
    height: 6px;
    min-width: 16px;
  }
  
  .hero-nav {
    width: 40px;
    height: 40px;
  }
  
  .hero-nav svg {
    width: 14px;
    height: 14px;
  }
  
  .hero-prev {
    left: 12px;
  }
  
  .hero-next {
    right: 12px;
  }
}

/* Clean inactive state - No Flicker */
.hero-slide:not(.active) .hero-card {
  opacity: 0;
  visibility: hidden;
  /* Instant hide for inactive slides */
  transition: none;
}

.hero-slide:not(.active) .hero-title,
.hero-slide:not(.active) .hero-subtitle,
.hero-slide:not(.active) .hero-actions {
  opacity: 0;
  /* Instant hide for inactive content */
  transition: none;
}

/* Logo container always visible for slides 1-3 */
.hero-slide:nth-child(-n+3):not(.active) .hero-logo-container {
  opacity: 1 !important;
}

.hero-slide:nth-child(n+4):not(.active) .hero-logo-container {
  opacity: 0;
}

/* Simple fade-out to prevent flicker and overlap */
.hero-slide.fade-out .hero-card {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateZ(0) !important;
  /* Quick fade-out without complex transforms */
  transition: opacity 0.3s ease-out !important;
}

.hero-slide.fade-out .hero-title,
.hero-slide.fade-out .hero-subtitle,
.hero-slide.fade-out .hero-actions {
  opacity: 0 !important;
  /* Quick content fade-out */
  transition: opacity 0.2s ease-out !important;
}

/* Logo container keeps no transitions even on fade-out */
.hero-slide.fade-out .hero-logo-container {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Reduced Motion Support - Clean Instant Transitions */
@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-nav,
  .hero-btn,
  .hero-card,
  .hero-title,
  .hero-subtitle,
  .hero-actions {
    transition: none !important;
  }
  
  .hero-slide:not(.active) {
    opacity: 0 !important;
    visibility: hidden !important;
  }
  
  .hero-slide.active {
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  .hero-slide:not(.active) .hero-card,
  .hero-slide:not(.active) .hero-title,
  .hero-slide:not(.active) .hero-subtitle,
  .hero-slide:not(.active) .hero-actions {
    opacity: 1 !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .hero-card {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #000;
  }
  
  .hero-nav {
    background: white;
    border: 2px solid #000;
  }
}

/* Loading State with Subtle Pattern */
.hero-slide[data-loading="true"] {
  background: linear-gradient(135deg, 
    rgba(247, 250, 252, 0.8) 0%, 
    rgba(237, 242, 247, 0.6) 25%,
    rgba(247, 250, 252, 0.4) 50%,
    rgba(237, 242, 247, 0.6) 75%,
    rgba(247, 250, 252, 0.8) 100%);
}

/* Touch Gestures Indicator */
.hero-slider.touch-enabled {
  cursor: grab;
}

.hero-slider.touch-enabled:active {
  cursor: grabbing;
}

/* Fix gap issue for hero slider with animation classes */
.hero-section-animate,
.hero-section-animate.touch-enabled,
.hero-section-animate.touch-enabled.animate-in {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Ensure animation classes don't add spacing */
.animate-in,
.animate-in.hero-slider,
.animate-in.hero-slider.hero-section-animate {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  transform: none !important;
}

/* Additional gap prevention for all possible class combinations */
section#heroHotfix.hero-slider.hero-section-animate.touch-enabled.animate-in,
section#heroHotfix.hero-slider.hero-section-animate.touch-enabled,
section#heroHotfix.hero-slider.hero-section-animate,
section#heroHotfix.hero-slider {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-sizing: border-box !important;
}

/* ===== ACCESSIBILITY SUPPORT ===== */

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .hero-card {
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
  }
  
  .hero-slide.active .hero-card {
    transition-duration: 0.2s !important;
  }
  
  .hero-slide.fade-out .hero-card {
    transition-duration: 0.2s !important;
  }
}
