/* ==========================================================================
   Design System & Tokens
   ========================================================================== */
:root {
  /* Colors */
  --clr-primary: #115E59; /* Deep Teal/Green */
  --clr-primary-light: #14B8A6; /* Vibrant Teal */
  --clr-secondary: #84CC16; /* Fresh Lime Green */
  --clr-accent: #F59E0B; /* Warm Sun Yellow */
  
  --clr-surface: #FFFFFF;
  --clr-background: #F8FAFC;
  --clr-text-main: #0F172A;
  --clr-text-muted: #64748B;
  --clr-border: #E2E8F0;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px rgba(20, 184, 166, 0.3);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Radii */
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
}

/* ==========================================================================
   Reset & Global
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--clr-background);
  color: var(--clr-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--clr-primary);
}

.cef-font {
  font-family: var(--font-heading);
  font-weight: 700;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: var(--space-sm); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: var(--space-xs); }

p { margin-bottom: var(--space-sm); }

/* ==========================================================================
   Components
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  transition: all var(--transition-normal);
  cursor: pointer;
  border: none;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-primary-light) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

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

.btn-outline:hover {
  background: var(--clr-primary);
  color: white;
}

/* Navbar (Glassmorphism) */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.3);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  padding: 1rem 0;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  height: 100%;
  width: auto;
}

.logo img {
  height: 50px; 
  width: auto;
  transition: transform var(--transition-normal);
}

.logo img:hover {
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-item {
  font-weight: 500;
  color: var(--clr-text-main);
  position: relative;
  transition: color var(--transition-fast);
}

.nav-item:hover, .nav-item.active {
  color: var(--clr-primary-light);
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--clr-primary-light);
  transition: width var(--transition-normal);
}

.nav-item:hover::after, .nav-item.active::after {
  width: 100%;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--clr-primary);
  transition: var(--transition-fast);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: url('assets/images/hero_campo_background.png') no-repeat center/cover;
  clip-path: polygon(15% 0, 100% 0, 100% 100%, 0 100%);
  z-index: 0;
  opacity: 0.9;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(132, 204, 22, 0.2);
  color: var(--clr-primary);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.25rem;
  color: var(--clr-text-muted);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

/* Sections */
.section {
  padding: var(--space-xl) 0;
}

.section-light { background-color: var(--clr-surface); }

.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Feature/Product Grid */
.grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--clr-primary-light);
}

.card-icon {
  width: 60px;
  height: 60px;
  background: #f0fdf4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--clr-primary);
  margin-bottom: 1.5rem;
}

.card h3 {
  margin-bottom: 1rem;
}

.card p {
  color: var(--clr-text-muted);
  flex-grow: 1;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--clr-primary-light);
  font-weight: 600;
  margin-top: 1rem;
  transition: gap var(--transition-fast);
}

.card:hover .card-link {
  gap: 0.75rem;
}

/* Tables (For Extracted Data) */
.table-wrapper {
  overflow-x: auto;
  margin: var(--space-md) 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
}

/* Product Carousel (Netflix Style) */
.carousel-section {
  padding: var(--space-lg) 0;
  background-color: var(--clr-text-main); /* Dark background to make products pop like Netflix */
  color: white;
  position: relative;
  overflow: hidden;
}

.carousel-section .section-header h2 {
  color: white;
  text-align: left;
  margin-left: var(--space-sm);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.carousel-container {
  position: relative;
  display: flex;
  align-items: center;
}

.carousel-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 1.5rem var(--space-sm);
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

.carousel-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

.carousel-item {
  flex: 0 0 calc(80vw - 2rem); /* Mobile width */
  scroll-snap-align: center;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16/9;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
  background: var(--clr-surface);
}

@media (min-width: 640px) {
  .carousel-item { flex: 0 0 calc(40vw - 1rem); scroll-snap-align: start; }
}

@media (min-width: 1024px) {
  .carousel-item { flex: 0 0 calc(25vw - 1rem); scroll-snap-align: start; }
}

.carousel-item:hover {
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.carousel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  padding: 1.5rem;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}

.carousel-overlay h3 {
  color: white;
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
}

.carousel-overlay p {
  color: #CBD5E1;
  font-size: 0.875rem;
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.carousel-item:hover .carousel-overlay p {
  opacity: 1;
  transform: translateY(0);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease;
}

.carousel-container:hover .carousel-btn {
  opacity: 1;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.carousel-btn.prev {
  left: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.carousel-btn.next {
  right: 0;
  background: linear-gradient(to left, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: var(--clr-surface);
}

.data-table th, .data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--clr-border);
}

.data-table th {
  background-color: var(--clr-background);
  font-weight: 600;
  color: var(--clr-primary);
}

.data-table tr:hover {
  background-color: #f8fafc;
}

/* Floating WhatsApp */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: #25d366;
  color: #FFF;
  border-radius: 50px;
  text-align: center;
  font-size: 30px;
  box-shadow: 2px 2px 15px rgba(0,0,0,0.2);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  background-color: #128c7e;
  box-shadow: 2px 2px 20px rgba(0,0,0,0.3);
}

/* Footer Improvements */
.footer {
  background: #022C22;
  color: #fff;
  padding: 5rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1.5rem;
  line-height: 1.6;
}

.footer h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
  color: white;
}

.footer h4::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--clr-secondary);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-icon {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.05); /* Default to subtle dark for light backgrounds */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-primary); /* Use brand color instead of white by default */
  text-decoration: none;
  transition: all 0.3s ease;
}

/* Specific styling for footer where background is dark */
.footer .social-icon {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.social-icon:hover {
  background: var(--clr-secondary);
  color: #fff; /* Always white on hover because secondary is green */
  transform: translateY(-3px);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--clr-surface);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    box-shadow: var(--shadow-md);
    transform: translateY(-150%);
    opacity: 0;
    transition: all var(--transition-normal);
  }
  
  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
  }

  .hero::before {
    display: none;
  }

  .hero {
    background: url('assets/images/hero_campo_background.png') no-repeat center/cover;
    text-align: center;
  }

  .hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.9);
    z-index: 0;
  }

  .hero-actions {
    justify-content: center;
  }

  /* Footer Mobile */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer h4::after {
    left: 50%;
    transform: translateX(-50%);
  }

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

  .section {
    padding: var(--space-lg) 0;
  }
}

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: var(--space-md); }
.mb-2 { margin-bottom: var(--space-sm); }
