/* --- 1. IMPORT MODERN FONTS (2025 Selection) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  /* Earth & Nature Palette */
  --primary-green: #1b4332;
  --accent-lime: #D0E6A5;
  --accent-gold: #DDA15E;
  --bg-paper: #F8F7F4;
  --surface-white: #FFFFFF;
  --text-main: #0f1f18;
  
  --shadow-hover: 0 20px 40px -5px rgba(27, 67, 50, 0.15);
  --navbar-height: 78px;
  
  /* Modern Font Stack */
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* CLS FIX: Prevent font loading shifts */
@font-face {
  font-family: 'Space Grotesk';
  font-display: swap;
  src: local('Space Grotesk');
}

@font-face {
  font-family: 'Inter';
  font-display: swap;
  src: local('Inter');
}

/* CLS FIX: Enable smooth scrolling with offset */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navbar-height);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-paper);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* CLS FIX: Reserve space for navbar */
  padding-top: var(--navbar-height);
  /* CLS FIX: Prevent margin collapse */
  margin: 0;
  min-height: 100vh;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, .navbar-brand {
  font-family: var(--font-heading);
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  color: var(--primary-green);
  /* CLS FIX: Prevent heading shifts */
  margin-block-start: 0;
  margin-block-end: 0;
}

/* --- NAVBAR - STABILIZED --- */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 15px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  
  /* CLS FIX: Strict fixed positioning */
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 1030 !important;
  
  /* CLS FIX: Reserve exact height */
  min-height: var(--navbar-height);
  height: var(--navbar-height);
  
  /* Performance optimization */
  will-change: backdrop-filter;
  isolation: isolate;
  contain: layout style;
}

/* CLS FIX: Prevent navbar brand from shifting */
.navbar-brand {
  display: block;
  min-height: 48px;
  line-height: 48px;
}

.navbar-brand img {
  height: 48px;
  width: auto;
  display: block;
  /* CLS FIX: Reserve aspect ratio space */
  aspect-ratio: auto;
  vertical-align: middle;
}

.nav-link {
  font-family: var(--font-body);
  font-weight: 600 !important;
  color: var(--primary-green) !important;
  font-size: 1rem;
  margin: 0 10px;
  transition: color 0.3s ease-out;
  /* CLS FIX: Prevent layout shift on hover */
  display: inline-block;
}

.nav-link:hover {
  color: var(--accent-gold) !important;
}

/* --- HERO SECTION - STABILIZED --- */
.hero {
  position: relative;
  /* CLS FIX: Fixed minimum height prevents jumping */
  min-height: 85vh;
  height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
  border-radius: 0 0 50px 50px;
  margin: 0 10px 40px 10px;
  overflow: hidden;
  /* Performance optimization */
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  contain: layout paint;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0,0,0,0.3), rgba(27, 67, 50, 0.8));
  pointer-events: none;
  /* CLS FIX: Prevent overlay shift */
  will-change: opacity;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: white;
  max-width: 95%;
  padding: 20px;
  /* CLS FIX: Prevent content shift */
  width: 100%;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 5rem); 
  color: #fff;
  text-shadow: 0 4px 10px rgba(0,0,0,0.3);
  font-weight: 700 !important;
  line-height: 1.1;
  white-space: normal;
  /* CLS FIX: Reserve space */
  margin: 0 0 1rem 0;
  min-height: 1.1em;
}

.hero p {
  /* CLS FIX: Prevent paragraph shift */
  margin: 1rem 0;
}

.btn-custom {
  background-color: var(--accent-lime);
  color: var(--primary-green);
  padding: 15px 40px;
  border-radius: 50px;
  font-weight: 700;
  border: none;
  /* CLS FIX: Prevent button shift */
  display: inline-block;
  transition: transform 0.2s ease-out, background-color 0.2s ease-out;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
  /* CLS FIX: Maintain size on hover */
  min-width: fit-content;
}

.btn-custom:hover {
  transform: scale(1.05) translate3d(0, 0, 0);
  background-color: #b8d680;
}

/* --- PRODUCTS BENTO GRID - STABILIZED --- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  padding: 20px;
  /* CLS FIX: Prevent grid shift */
  contain: layout;
}

.product-card {
  background: var(--surface-white);
  border-radius: 30px;
  padding: 20px;
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
  border: 1px solid rgba(0,0,0,0.04);
  position: relative;
  display: flex;
  flex-direction: column;
  /* CLS FIX: Fixed height prevents grid jumping */
  height: 100%;
  min-height: 450px;
  /* Performance */
  transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
  contain: layout paint;
}

.product-card:hover {
  transform: translateY(-10px) translate3d(0, 0, 0);
  box-shadow: var(--shadow-hover);
  cursor: pointer;
}

.product-img {
  width: 100%;
  /* CLS FIX: Fixed height prevents layout shift */
  height: 250px;
  min-height: 250px;
  object-fit: cover;
  border-radius: 20px;
  margin-bottom: 20px;
  /* CLS FIX: Reserve space before image loads */
  background: #f0f0f0;
  /* Performance */
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.product-card h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  /* CLS FIX: Reserve height */
  min-height: 1.6em;
}

.badge-float {
  position: absolute;
  top: 30px;
  right: 30px;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--primary-green);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  /* CLS FIX: Prevent badge from affecting layout */
  z-index: 1;
}

.price {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary-green);
  margin-top: auto;
  /* CLS FIX: Reserve height */
  min-height: 1.6em;
}

/* --- QUOTE SECTION - STABILIZED --- */
.quote-section {
  position: relative;
  background: var(--primary-green);
  background: linear-gradient(135deg, var(--primary-green) 0%, #0f291e 100%);
  color: var(--accent-lime);
  padding: 100px 20px;
  text-align: center;
  border-radius: 40px;
  margin: 80px 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(27, 67, 50, 0.3);
  /* CLS FIX: Fixed min height */
  min-height: 400px;
  /* Performance */
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  contain: layout paint;
}

.quote-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-style: normal;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.2;
  position: relative;
  z-index: 2;
  margin-bottom: 30px;
  /* CLS FIX: Reserve space */
  min-height: 2.4em;
}

.quote-subtext {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.8;
  font-size: 0.9rem;
  z-index: 2;
  position: relative;
}

.quote-divider {
  width: 60px;
  height: 4px;
  background-color: var(--accent-gold);
  margin: 0 auto 30px;
  border-radius: 2px;
}

.quote-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 15rem;
  color: rgba(255, 255, 255, 0.03);
  z-index: 1;
  pointer-events: none;
  /* CLS FIX: Prevent decorative shifts */
  will-change: auto;
}

/* --- VIDEO SECTION - STABILIZED --- */
.ratio {
  /* CLS FIX: Reserve exact aspect ratio */
  position: relative;
  width: 100%;
}

.ratio-16x9 {
  /* CLS FIX: Fixed aspect ratio prevents shift */
  aspect-ratio: 16 / 9;
  padding-bottom: 0 !important;
}

.ratio iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* --- ABOUT IMAGES - STABILIZED --- */
.object-fit-cover {
  object-fit: cover;
  /* Performance */
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* CLS FIX: Reserve space for about section images */
.about-section img {
  /* Fixed height prevents shift */
  height: 300px;
  width: 100%;
  object-fit: cover;
  background: #f0f0f0;
}

/* --- FOOTER - STABILIZED --- */
footer {
  background: #0f291e;
  color: white;
  padding: 80px 0 30px;
  border-radius: 40px 40px 0 0;
  margin-top: 40px;
  /* CLS FIX: Fixed minimum height */
  min-height: 400px;
}

footer h4 { 
  color: white;
  margin-bottom: 1rem;
}

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

footer a:hover { 
  color: var(--accent-lime); 
}

/* --- MODALS - STABILIZED --- */
.modal-content { 
  border-radius: 30px; 
  border: none;
  /* CLS FIX: GPU acceleration */
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.modal-header { 
  border-bottom: none; 
  padding: 30px 30px 10px; 
}

.modal-body { 
  padding: 0 30px 30px; 
}

.btn-close { 
  opacity: 1; 
}

/* --- WHATSAPP FLOATING BUTTON - STABILIZED --- */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  /* CLS FIX: Reserve exact space */
  width: 60px;
  height: 60px;
}

.whatsapp-float a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.whatsapp-float img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  padding: 10px;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
  /* Performance */
  transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
}

.whatsapp-float img:hover {
  transform: scale(1.1) translate3d(0, 0, 0);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

/* --- GLOBAL CLS OPTIMIZATIONS --- */
*, *::before, *::after {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

/* CLS FIX: Prevent images from causing layout shifts */
img {
  max-width: 100%;
  height: auto;
  /* Reserve space before load */
  display: block;
}

/* CLS FIX: Sections have minimum heights */
section {
  /* Prevent sections from jumping */
  contain: layout;
}

/* Accessibility: Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Mobile responsiveness */
@media (max-width: 991px) {
  :root {
    --navbar-height: 60px;
  }
  
  body {
    padding-top: 60px;
  }
  
  .navbar {
    padding: 10px 0;
    min-height: 60px;
    height: 60px;
  }
  
  .navbar-brand img {
    height: 40px;
  }
  
  /* CLS FIX: Adjust heights for mobile */
  .hero {
    min-height: 70vh;
    height: 70vh;
  }
  
  .product-card {
    min-height: 400px;
  }
}

/* CLS FIX: Optimize Bootstrap transitions */
.collapse {
  transition: height 0.35s ease;
}

.collapsing {
  transition: height 0.35s ease;
}