﻿:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: rgba(255,255,255,0.92);
  --surface-strong: #ffffff;
  --text: #2f4f4f;
  --muted: #5a6a5b;
  --primary: #4a7c59;
  --primary-dark: #386141;
  --accent: #8aa97a;
  --shadow: 0 16px 40px rgba(0,0,0,0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Evita saltos horizontales cuando algún elemento sobresale */
html, body {
  overflow-x: hidden;
  scrollbar-gutter: stable both-edges;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #e7e3da 0%, #f6f4ef 100%);
  color: var(--text);
  line-height: 1.6;
}

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

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.logo {
  width: 48px;
  height: auto;
}

.brand-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  border: none;
}

.main-nav {
  padding: 0 2rem 1rem;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--muted);
  font-weight: 600;
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary-dark);
}

main {
  padding: 2rem 2rem 4rem;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
  margin: 2rem auto;
  max-width: 1180px;
}

.hero-text {
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--primary);
}

.hero h1,
.page-intro h1,
.section-header h2,
.section-highlight h2 {
  color: var(--text);
  margin: 0 0 1rem;
  line-height: 1.15;
}

.hero h1 {
  font-size: clamp(2.2rem, 3vw, 3.4rem);
}

.hero p,
.section-intro p,
.section-highlight p,
.card p,
.testimonial-card p,
.about-card p,
.feature-card p,
.contact-card p {
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.8rem;
}

.hero-image img {
  width: 100%;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(74,124,89,0.16);
}

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

.section-intro,
.section-highlight,
.page-intro,
.contact-cta {
  max-width: 1180px;
  margin: 3rem auto;
  padding: 2rem;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.service-grid,
.feature-grid,
.team-grid,
.testimonial-grid {
  display: grid;
  gap: 1.5rem;
}

.service-grid,
.feature-grid,
.team-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.testimonial-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card,
.service-card,
.about-card,
.team-card,
.feature-card,
.testimonial-card,
.contact-card,
.contact-form {
  background: var(--surface-strong);
  border-radius: 24px;
  padding: 1.8rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.04);
}

.card h3,
.service-card h2,
.about-card h2,
.team-card h3,
.feature-card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.card p,
.service-card p,
.about-card p,
.team-card p,
.feature-card p {
  margin: 0;
}

.service-card ul,
.about-card ul {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
}

.service-card li,
.about-card li {
  margin-bottom: 0.75rem;
  color: var(--muted);
}

.section-highlight {
  display: grid;
  grid-template-columns: 1fr;
  text-align: center;
}

.highlight-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.highlight-list div {
  background: var(--surface-strong);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 12px 24px rgba(0,0,0,0.04);
}

.testimonial-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem;
}

.testimonial-card span {
  color: var(--primary);
  font-weight: 700;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1180px;
  margin: 2rem auto;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-form label {
  font-weight: 600;
  color: var(--text);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid rgba(47,79,79,0.16);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: #fff;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid rgba(74,124,89,0.25);
}

.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}

.footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .contact-grid,
  .service-grid,
  .feature-grid,
  .team-grid,
  .testimonial-grid,
  .highlight-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-top,
  .main-nav {
    padding: 1rem;
  }

  .header-top {
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav ul {
    justify-content: space-around;
  }

  .hero-actions {
    flex-direction: column;
  }
}

/* Evitar 'bailes' en móvil: hacer el header no-sticky y reservar espacio para imágenes */
@media (max-width: 640px) {
  .site-header {
    position: relative;
  }
}

/* Reservar aspecto para las imágenes de la galería y evitar reflows al cargar */
.gallery img {
  height: auto;
  aspect-ratio: 4 / 3;
  min-height: 140px;
  object-position: center;
}

/* Galería de servicios */
.gallery-section {
  max-width: 1180px;
  margin: 2.5rem auto;
  padding: 1.6rem;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.gallery-section h2 {
  margin: 0 0 0.6rem;
  color: var(--primary-dark);
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.gallery img {
  width: 100%;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.gallery img:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 18px 36px rgba(0,0,0,0.12);
}

/* Carrusel */
.carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.carousel-viewport {
  overflow: hidden;
  flex: 1 1 auto;
}
.carousel-track {
  display: flex;
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
  transition: transform 300ms ease;
}
.carousel-item {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.carousel-item img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 12px;
}
.carousel .caption {
  font-size: 0.95rem;
  color: var(--muted);
}
.carousel-btn {
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.06);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
}
.carousel-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 0.9rem;
}
.carousel-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0,0,0,0.12);
  border: none;
  cursor: pointer;
}
.carousel-dots button.active {
  background: var(--primary);
}

@media (min-width: 640px) {
  .carousel-item {
    flex: 0 0 50%;
  }
  .carousel-item img { height: 220px; }
}

@media (min-width: 980px) {
  .carousel-item { flex: 0 0 33.3333%; }
  .carousel-item img { height: 200px; }
}

/* Estilos móviles: ancho completo, botones overlay, dots y caption sobre la imagen */
@media (max-width: 640px) {
  .carousel {
    padding: 0;
    align-items: center;
  }
  .carousel-viewport {
    padding: 0 0.6rem;
  }
  .carousel-track { gap: 0.8rem; }
  .carousel-item { flex: 0 0 100%; position: relative; }
  .carousel-item img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 12px;
  }
  .carousel-btn.prev { left: 6px; }
  .carousel-btn.next { right: 6px; }
  .carousel-btn { background: rgba(0,0,0,0.45); color: #fff; border: none; }

  .carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    margin: 0;
    padding: 0;
  }
  .carousel-dots button { background: rgba(255,255,255,0.6); }
  .carousel-dots button.active { background: var(--primary); }

  .carousel .caption {
    position: absolute;
    left: 50%;
    bottom: 44px;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 26;
  }
}
