@layer components;

:root {
  --hero-gold: #fbbf24;
  --hero-gold-dark: #f59e0b;
  --hero-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Mobile-first Hero Section */
.hero-section {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport */
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: clamp(2rem, 8vw, 4rem) 0;
  scroll-snap-align: start;
}

.hero-carousel-wrapper {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-carousel {
  height: 100%;
  position: relative;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity;
}

.hero-slide.active {
  opacity: 1;
}

/* Hero Badge - Mobile Optimized */
.hero-badge {
  position: absolute;
  top: clamp(1rem, 3vw, 1.5rem);
  right: clamp(1rem, 4vw, 2rem);
  background: rgba(251, 191, 36, 0.97);
  backdrop-filter: blur(10px);
  color: #111827;
  padding: clamp(0.6rem, 2vw, 0.75rem) clamp(1rem, 3vw, 1.5rem);
  border-radius: 3rem;
  font-weight: 700;
  font-size: clamp(0.75rem, 2.5vw, 0.9rem);
  box-shadow: var(--hero-shadow);
  z-index: 3;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Hero Content - Perfect Mobile Readability */
.hero-content {
  position: relative;
  z-index: 10;
  max-width: min(90vw, 700px);
  color: hsl(0 0% 100% / 0.98);
  animation: slideInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  text-align: center;
  margin: 0 auto;
}

.hero-content .hero-badge {
  position: static;
  margin-bottom: clamp(1rem, 4vw, 1.5rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-content h1 {
  font-size: clamp(2rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: clamp(1rem, 3vw, 1.5rem);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--hero-gold), var(--hero-gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  font-size: clamp(1.1rem, 4vw, 1.3rem);
  margin-bottom: clamp(2rem, 6vw, 2.5rem);
  opacity: 0.95;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  line-height: 1.5;
  max-width: 28rem;
  margin-inline: auto;
}

/* Hero Buttons - Touch-Friendly */
.hero-actions {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vw, 1rem);
  margin-bottom: clamp(2rem, 6vw, 3rem);
  align-items: center;
}

.hero-btn {
  padding: clamp(1rem, 3vw, 1.25rem) clamp(1.75rem, 5vw, 2.5rem);
  border-radius: 3rem;
  font-weight: 700;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--hero-shadow);
  flex: 1;
  min-height: 3.5rem; /* Touch target */
  max-width: min(22rem, 90vw);
  will-change: transform;
}

.hero-btn.primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.hero-btn.primary:hover,
.hero-btn.primary:focus-visible {
  transform: translateY(-0.25rem) scale(1.03);
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.5);
}

.hero-btn.secondary {
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-btn.secondary:hover,
.hero-btn.secondary:focus-visible {
  transform: translateY(-0.25rem);
  box-shadow: 0 20px 40px rgba(255, 255, 255, 0.4);
}

.hero-btn.whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
}

.hero-btn.whatsapp:hover,
.hero-btn.whatsapp:focus-visible {
  box-shadow: 0 20px 40px rgba(37, 211, 102, 0.5);
}

/* Scroll Indicator */
.hero-scroll {
  position: absolute;
  bottom: clamp(1.5rem, 4vw, 2rem);
  left: 50%;
  transform: translateX(-50%);
  color: hsla(0, 0%, 100%, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: bounce 2s infinite;
  cursor: pointer;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  transition: color 0.3s ease;
}

.hero-scroll:hover {
  color: white;
}

.hero-scroll svg {
  width: clamp(1.2rem, 3vw, 1.5rem);
  height: clamp(1.2rem, 3vw, 1.5rem);
}

/* Carousel Dots - Touch Optimized */
.hero-dots {
  position: absolute;
  bottom: clamp(2.5rem, 6vw, 3rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: clamp(0.4rem, 1vw, 0.5rem);
  z-index: 5;
}

.dot {
  width: clamp(0.75rem, 2vw, 0.875rem);
  height: clamp(0.75rem, 2vw, 0.875rem);
  border-radius: 50%;
  background: hsla(0, 0%, 100%, 0.4);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  touch-action: manipulation;
}

.dot:focus-visible {
  outline: 2px solid var(--hero-gold);
  outline-offset: 2px;
}

.dot.active,
.dot:hover {
  background: var(--hero-gold);
  transform: scale(1.3);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.8);
}

/* Keyframe Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-0.75rem);
  }
  60% {
    transform: translateX(-50%) translateY(-0.375rem);
  }
}

/* Mobile-First Responsive */
@media (min-width: 480px) {
  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .hero-btn {
    flex: initial;
    max-width: none;
  }
}

@media (min-width: 768px) {
  .hero-section {
    padding-left: clamp(2rem, 5vw, 4rem);
    padding-right: clamp(2rem, 5vw, 4rem);
  }
  
  .hero-badge {
    position: absolute;
  }
  
  .hero-content {
    text-align: left;
    padding-left: 0;
  }
  
  .hero-actions {
    justify-content: flex-start;
  }
}

@media (min-width: 1024px) {
  .hero-content h1 {
    letter-spacing: -0.025em;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-btn,
  .dot {
    transition: none;
    animation: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .hero-badge,
  .hero-btn {
    border: 2px solid;
  }
}
