/* RESET & VARIABLES */
:root {
  --primary-green: #7eb83f;
  --dark-green: #4a7522;
  --text-dark: #333333;
  --text-light: #ffffff;
  --bg-gray: #f5f5f5;
  --input-gray: #d9d9d9;
  
  --font-main: 'Inter', sans-serif;
  
  --transition-speed: 0.3s;
  --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 25px rgba(0,0,0,0.15);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-main);
  color: var(--text-dark);
}

body {
  background-color: #ffffff;
  overflow-x: hidden;
  line-height: 1.6;
}

ul {
  list-style: none;
}

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

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

/* UTILITIES */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section {
  padding: 5rem 0;
}

.section-title {
  color: var(--primary-green);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

/* HEADER & NAVIGATION */
.header {
  padding: 2rem 0;
  background-color: #ffffff;
}

.header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.header-nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo img {
  max-height: 80px;
}

.nav {
  background-color: var(--input-gray);
  border-radius: 50px;
  padding: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.nav-item {
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.5rem 0.8rem;
  border-radius: 50px;
  transition: all var(--transition-speed) ease;
  display: inline-block;
}

.nav-item:hover {
  background-color: var(--primary-green);
  color: var(--text-light);
  transform: translateY(-2px);
}

.btn-whatsapp-floating {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  z-index: 1000;
  background-color: var(--primary-green);
  color: white;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(126, 184, 63, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  flex-shrink: 0;
}

.btn-whatsapp-floating svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.btn-whatsapp-floating:hover {
  transform: scale(1.15) translateY(-2px);
  background-color: var(--dark-green);
  box-shadow: 0 8px 25px rgba(126, 184, 63, 0.6);
}

/* HERO SECTION */
.hero {
  position: relative;
  padding: 4rem 0 8rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 40%;
  left: 0;
  width: 100%;
  height: 60%;
  z-index: -1;
  opacity: 0.85; /* Blend slightly with the background if needed */
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  position: relative;
  z-index: 10;
}

.hero-map {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.hero-text-box {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  margin-left: auto;
  border-left: 4px solid var(--primary-green);
}

.hero-text-box h1 {
  color: var(--text-dark);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1rem;
  font-weight: 400;
}

.hero-text-box p {
  color: var(--text-dark);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.hero-text-box p:last-child {
  margin-bottom: 0;
  font-weight: 500;
  color: #555;
}

/* PRODUCTOS & SERVICIOS COMMON CARDS */
.card-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
}

.card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 450px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.card:hover .card-img {
  transform: scale(1.08);
}

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2rem 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.card-overlay h3 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  transition: transform var(--transition-speed);
}

.card:hover .card-overlay h3 {
  transform: translateY(-5px);
  color: var(--primary-green);
}

/* CONTACTO SECTION */
.contacto {
  background-color: var(--bg-gray);
}

.contact-form-container {
  max-width: 600px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-input, .form-textarea {
  width: 100%;
  background-color: var(--input-gray);
  border: none;
  border-radius: 25px; /* Pill shape for input */
  padding: 1.2rem 1.5rem;
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--text-dark);
  transition: box-shadow var(--transition-speed), background-color var(--transition-speed);
}

.form-textarea {
  border-radius: 20px;
  resize: vertical;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(126, 184, 63, 0.3);
  background-color: #eef5e9;
}

.form-input::placeholder, .form-textarea::placeholder {
  color: #888;
  font-weight: 500;
}

.btn-submit {
  align-self: flex-start;
  background-color: var(--primary-green);
  color: var(--text-light);
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  transition: background-color var(--transition-speed), transform var(--transition-speed);
  box-shadow: var(--shadow-md);
}

.btn-submit:hover {
  background-color: var(--dark-green);
  transform: translateY(-3px);
}

/* FOOTER */
.footer {
  background-color: var(--primary-green);
  color: var(--text-light);
  padding: 3rem 0;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
}

.footer-info p {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.footer-info a {
  color: var(--text-light);
  text-decoration: underline;
  transition: opacity var(--transition-speed);
}

.footer-info a:hover {
  opacity: 0.8;
}

.footer-logo img {
  max-width: 250px;
  /* Filter to make logo white if the original is green/grey */
  filter: brightness(0) invert(1); 
}

/* BACK TO TOP BUTTON */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--dark-green);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
  cursor: pointer;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--primary-green);
  transform: translateY(-5px);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* RESPONSIVE DESIGN (TABLET & DESKTOP) */
@media (min-width: 768px) {
  
  .header-container {
    flex-direction: row;
    justify-content: space-between;
  }
  
  .header-nav-wrapper {
    flex-wrap: nowrap;
  }
  
  .nav-links {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  
  .section-title {
    font-size: 2.5rem;
    text-align: center;
  }
  
  .hero-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  
  .hero-map {
    flex: 1;
    max-width: 45%;
    margin: 0;
  }
  
  .hero-text-box {
    flex: 1;
    max-width: 50%;
    margin-left: 0;
  }
  
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .contact-form-container {
    margin: 0 auto; /* Center form on desktop */
  }
  
  .footer-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .footer-logo {
    text-align: right;
  }
}

/* Small fixes for very large screens */
@media (min-width: 1024px) {
  .hero-text-box {
    padding: 3rem;
  }
}
