/* ============================================
   Homepage Specific Styles
   ============================================ */

/* ========== Hero Section ========== */
.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  /* Dynamic viewport height for mobile browsers */
  min-height: 600px;
  /* Minimum height to ensure content fits */
  /* No max-height - allow full screen coverage on all devices */
  overflow: hidden;
}

/* Mobile: Allow hero height to expand for long text content */
@media (max-width: 768px) {
  .hero {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }
}

/* Hero Background */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

/* Ensure picture element fills the container */
.hero-bg picture {
  display: block;
  width: 100%;
  height: 100%;
  /* Ensure picture fills the hero-bg container completely */
  position: absolute;
  inset: 0;
}

.hero-bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Center the image - crop equally from all sides, keeping core content visible */
  object-position: center center;
}

/* Mobile: ensure full coverage with center-based cropping */
@media (max-width: 768px) {
  .hero-bg picture {
    /* Ensure picture fills viewport on mobile */
    width: 100%;
    height: 100%;
  }

  .hero-bg img {
    /* Force minimum dimensions to ensure full coverage */
    min-width: 100%;
    min-height: 100%;
    /* Center position ensures the core content is always visible */
    object-position: center center;
  }
}

/* Hero Overlay - Multi-layer gradient */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  z-index: -1;
}

/* Decorative Elements */
.hero-decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

/* Hero Container - Full height flex layout */
.hero-container {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: calc(var(--header-height) + var(--space-8));
  padding-bottom: var(--space-8);
  max-width: 100%;
  /* Override container's max-width */
}

/* Hero Content - Flexible center area */
.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 800px;
  padding: var(--space-4) var(--space-6);
  /* Allow content to be visible - do not clip */
  overflow: visible;
}

@media (min-width: 768px) {
  .hero-content {
    padding: var(--space-8) var(--space-10);
  }
}

@media (min-width: 1024px) {
  .hero-content {
    padding: var(--space-10) var(--space-16);
  }
}

/* Hero Tag */
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
}

.hero-tag .tag-icon {
  color: var(--primary);
  font-size: 8px;
}

/* Hero Title */
.hero-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--white);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-6);
  text-wrap: balance;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: var(--text-4xl);
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: var(--text-5xl);
  }
}

.hero-title .text-highlight {
  color: var(--primary-light);
}

/* Hero Subtitle */
.hero-subtitle {
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.8);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  text-wrap: balance;
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: var(--text-lg);
  }
}

/* Mobile: Fluid typography for hero text to handle long translations */
@media (max-width: 480px) {
  .hero-title {
    /* Fluid: 1.25rem (20px) at 280px → 1.875rem (30px) at 480px */
    font-size: clamp(1.25rem, 0.5rem + 5vw, 1.875rem);
  }

  .hero-subtitle {
    /* Fluid: 0.75rem (12px) at 280px → 1rem (16px) at 480px */
    font-size: clamp(0.75rem, 0.4rem + 2.5vw, 1rem);
    margin-bottom: var(--space-6);
  }

  .hero-tag {
    /* Fluid: 0.625rem (10px) at 280px → 0.875rem (14px) at 480px */
    font-size: clamp(0.625rem, 0.3rem + 2vw, 0.875rem);
    padding: var(--space-1) var(--space-3);
    margin-bottom: var(--space-4);
  }
}

/* Hero CTA Buttons */
.hero-cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  max-width: 400px;
}

@media (min-width: 480px) {
  .hero-cta {
    flex-direction: row;
    justify-content: center;
    max-width: none;
  }
}

/* Scroll Indicator - Fixed at bottom of hero */
.hero .scroll-indicator {
  flex-shrink: 0;
  margin-top: auto;
  padding-bottom: var(--space-4);
}

/* ========== Problems/Solutions Section ========== */
.section-problems {
  background-color: var(--white);
}

.problems-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

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

.problem-card {
  display: flex;
  flex-direction: column;
  background-color: var(--gray-50);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.problem-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.problem-content {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-6);
  background-color: rgba(227, 27, 35, 0.05);
  border-left: 4px solid var(--primary);
}

.problem-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-alpha-10);
  border-radius: var(--radius-md);
  color: var(--primary);
}

.problem-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--gray-900);
  margin: 0;
}

.solution-content {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-6);
  background-color: var(--white);
  border-left: 4px solid var(--success);
}

.solution-arrow {
  display: none;
}

.solution-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--success-light);
  border-radius: var(--radius-md);
  color: var(--success);
}

.solution-text {
  font-size: var(--text-base);
  color: var(--gray-700);
  margin: 0;
}

.solution-text .text-primary {
  color: var(--primary);
  font-weight: var(--font-bold);
}

/* ========== Stats Section ========== */
.section-stats {
  position: relative;
  background: var(--gradient-darker);
  overflow: hidden;
}

.section-stats::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(227, 27, 35, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(100, 100, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  position: relative;
  z-index: 1;
  align-items: stretch;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
  }
}

.stat-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
}

@media (min-width: 768px) {
  .stat-card {
    padding: var(--space-8);
  }
}

.stat-card .stat-number {
  font-size: var(--text-3xl);
  word-break: break-word;
  overflow-wrap: break-word;
}

@media (min-width: 480px) {
  .stat-card .stat-number {
    font-size: var(--text-4xl);
  }
}

@media (min-width: 1024px) {
  .stat-card .stat-number {
    font-size: var(--text-5xl);
  }
}

.stat-card .stat-label {
  font-size: var(--text-xs);
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  min-height: 2.5em;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 480px) {
  .stat-card .stat-label {
    font-size: var(--text-sm);
  }
}

/* ========== About Gallery ========== */
.about-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.gallery-main {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background-color: var(--gray-100);
}

.gallery-slides {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
  opacity: 0;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity;
}

.gallery-slide.active {
  opacity: 1;
  transform: translateX(0);
}

.gallery-slide.slide-out-left {
  opacity: 0;
  transform: translateX(-100%);
}

.gallery-slide.slide-in-right {
  transform: translateX(100%);
}

.gallery-slide.slide-in-left {
  transform: translateX(-100%);
}

/* Gallery Arrows */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: var(--radius-full);
  color: var(--white);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-base), background-color var(--transition-base);
  z-index: 2;
}

.gallery-main:hover .gallery-arrow {
  opacity: 1;
}

.gallery-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
}

.gallery-prev {
  left: var(--space-4);
}

.gallery-next {
  right: var(--space-4);
}

/* Hide gallery arrows on mobile - use touch swipe instead */
@media (max-width: 767px) {
  .gallery-arrow {
    display: none !important;
  }
}

/* Gallery Dots */
.gallery-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
}

.gallery-dot {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: var(--radius-full);
  background-color: var(--gray-300);
  cursor: pointer;
  transition: all var(--transition-base);
  padding: 0;
}

.gallery-dot:hover {
  background-color: var(--gray-400);
}

.gallery-dot.active {
  background-color: var(--primary);
  width: 24px;
}

/* Gallery Caption */
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--transition-base), transform var(--transition-base);
  pointer-events: none;
  z-index: 1;
}

.gallery-caption.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== About Section ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}

@media (min-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.about-content {
  max-width: 560px;
}

@media (min-width: 1024px) {
  .about-content {
    max-width: none;
  }
}

.about-content .section-title {
  margin-bottom: var(--space-6);
  letter-spacing: 0.02em;
}

.about-content .lead {
  margin-bottom: var(--space-5);
  font-size: var(--text-lg);
  line-height: 1.8;
  letter-spacing: 0.01em;
  text-wrap: pretty;
  color: var(--gray-800);
}

.about-desc {
  margin-bottom: var(--space-6);
  line-height: 1.9;
  letter-spacing: 0.015em;
  text-wrap: pretty;
  color: var(--gray-600);
}

.about-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ========== Industries Section ========== */
.section-industries {
  background-color: var(--gray-50);
}

.industries-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  align-items: stretch;
}

@media (min-width: 480px) {
  .industries-grid {
    gap: var(--space-4);
  }
}

@media (min-width: 768px) {
  .industries-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }
}

.industry-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-3);
  background-color: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  /* Prevent overflow */
  overflow: hidden;
  min-width: 0;
}

@media (min-width: 480px) {
  .industry-card {
    padding: var(--space-4);
  }
}

@media (min-width: 768px) {
  .industry-card {
    padding: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .industry-card {
    padding: var(--space-8);
  }
}


/* Industry Image Placeholder */
.industry-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: var(--gray-200);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .industry-image {
    margin-bottom: var(--space-4);
  }
}

.industry-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.industry-image img[src=""],
.industry-image img:not([src]) {
  display: none;
}

.industry-image::after {
  content: attr(data-placeholder-text);
  position: absolute;
  color: var(--gray-400);
  font-size: var(--text-sm);
}

.industry-image img[src=""]:not(:empty)+.industry-image::after,
.industry-image:has(img[src]:not([src=""])) ::after {
  display: none;
}


.industry-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--gray-100);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  font-size: var(--text-3xl);
  flex-shrink: 0;
}


.industry-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--gray-900);
  margin-bottom: var(--space-2);
  min-height: 2.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-wrap: balance;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  width: 100%;
}

@media (min-width: 480px) {
  .industry-title {
    font-size: var(--text-base);
  }
}

@media (min-width: 768px) {
  .industry-title {
    font-size: var(--text-lg);
  }
}

.industry-desc {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-bottom: 0;
  min-height: 2.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-wrap: balance;
  flex-grow: 1;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  width: 100%;
}

@media (min-width: 480px) {
  .industry-desc {
    font-size: var(--text-sm);
  }
}


/* ========== Products Preview Section ========== */
.section-products-preview {
  background-color: var(--white);
}

.section-products-preview .section-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .section-products-preview .section-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

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

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

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}

.product-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.product-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--white);
  background-color: var(--primary);
  border-radius: var(--radius-full);
}

.product-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-5);
}

.product-model {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--primary);
  margin-bottom: var(--space-1);
}

.product-name {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--gray-900);
  margin-bottom: var(--space-2);
}

.product-spec {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: var(--space-3);
}

.product-features {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.product-features li {
  font-size: var(--text-xs);
  color: var(--gray-600);
  padding: var(--space-1) var(--space-2);
  background-color: var(--gray-100);
  border-radius: var(--radius-sm);
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--primary);
  margin-top: auto;
  transition: gap var(--transition-fast);
}

/* Make entire card clickable via stretched link */
.product-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.product-card:hover .product-link {
  gap: var(--space-3);
}

/* CTA Section styles moved to components.css for cross-page reuse */