/* ========================================
   Agro Servicios de la Costa - Estilos
   Diseño corporativo industrial | Mobile-first
   ======================================== */

/* --- Variables --- */
:root {
  --color-primary: #0f2744;
  --color-primary-dark: #0a1c33;
  --color-primary-light: #1a365d;
  --color-white: #ffffff;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-whatsapp: #25d366;
  --color-whatsapp-dark: #20bd5a;
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-xs: 0 1px 2px rgba(15, 39, 68, 0.04);
  --shadow-sm: 0 2px 4px rgba(15, 39, 68, 0.06), 0 2px 8px rgba(15, 39, 68, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 39, 68, 0.08), 0 2px 6px rgba(15, 39, 68, 0.04);
  --shadow-lg: 0 12px 24px rgba(15, 39, 68, 0.12), 0 4px 8px rgba(15, 39, 68, 0.06);
  --shadow-xl: 0 20px 40px rgba(15, 39, 68, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition-fast: 0.2s ease;
  --transition: 0.3s ease;
  --transition-slow: 0.4s ease;
}

/* --- Animaciones --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-gray-800);
  background-color: var(--color-white);
  overflow-x: hidden;
}


img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-hover);
}

ul {
  list-style: none;
}

/* --- Utilidades --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Header (Sticky) --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition);
}

.header.scrolled {
  box-shadow: var(--shadow-sm);
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.header__logo {
  font-family: var(--font-main);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
}

.header__logo:hover {
  color: var(--color-primary);
}

.header__logo .logo {
  height: 64px;
  width: auto;
}

/* --- Navigation --- */
.nav__list {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
}

.nav__list.active {
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--color-white);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-lg);
}

.nav__link {
  display: block;
  padding: 0.625rem 0;
  color: var(--color-gray-700);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav__link:hover {
  color: var(--color-accent);
}

/* Hamburger menu */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.menu-toggle:hover {
  background-color: var(--color-gray-100);
}

.menu-toggle:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.menu-toggle.active .menu-toggle__bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active .menu-toggle__bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .menu-toggle__bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.menu-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  text-align: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?w=1920&q=80');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 39, 68, 0.92) 0%, rgba(26, 54, 93, 0.85) 50%, rgba(15, 39, 68, 0.88) 100%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: 3rem 1.5rem;
  max-width: 720px;
}

.hero__title {
  font-family: var(--font-main);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero__slogan {
  font-size: 1.125rem;
  font-weight: 500;
  opacity: 0.95;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn--primary {
  background-color: var(--color-white);
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  background-color: var(--color-gray-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--full {
  width: 100%;
}

/* --- Section titles --- */
.section-title {
  font-family: var(--font-main);
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.section-title--light {
  color: var(--color-white);
}

.section-subtitle {
  color: var(--color-gray-600);
  font-size: 1.0625rem;
  margin-bottom: 2.5rem;
  max-width: 560px;
  line-height: 1.6;
}

.services .section-subtitle {
  color: rgba(255, 255, 255, 0.85);
}

/* --- About --- */
.about {
  padding: 4rem 0;
  background-color: var(--color-gray-50);
}

.about__grid {
  display: grid;
  gap: 2.5rem;
}

.about__content {
  order: 1;
}

.about__text {
  margin-bottom: 1rem;
  color: var(--color-gray-600);
  font-size: 1rem;
}

.about__features {
  margin-top: 1.75rem;
}

.about__features li {
  padding: 0.375rem 0;
  color: var(--color-gray-700);
  font-weight: 500;
}

.about__visual {
  order: 0;
  display: flex;
  justify-content: center;
}

.about__card {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: var(--color-white);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  min-width: 220px;
  box-shadow: var(--shadow-lg);
}

.about__stat {
  display: block;
  font-family: var(--font-main);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.about__card p {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  opacity: 0.9;
}

/* --- Services --- */
.services {
  padding: 4rem 0;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.services__grid {
  display: grid;
  gap: 1.5rem;
}

.service-card {
  background-color: var(--color-white);
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

.service-card__icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-gray-50);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  transition: background-color var(--transition), color var(--transition);
}

.service-card:hover .service-card__icon {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.service-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.service-card__text {
  color: var(--color-gray-600);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* --- Contact --- */
.contact {
  padding: 4rem 0;
  background-color: var(--color-gray-50);
}

.contact__grid {
  display: grid;
  gap: 2.5rem;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-gray-800);
  font-size: 0.9375rem;
}

.form-group input,
.form-group textarea {
  padding: 0.875rem 1.125rem;
  font-family: var(--font-main);
  font-size: 1rem;
  border: 2px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-group input.error,
.form-group textarea.error {
  border-color: #dc2626;
}

.form-error {
  font-size: 0.875rem;
  color: #dc2626;
  margin-top: 0.375rem;
  min-height: 1.25rem;
}

.form-group textarea {
  resize: vertical;
  min-height: 130px;
}

.contact__card {
  background-color: var(--color-white);
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.contact__card h3 {
  color: var(--color-primary);
  margin-bottom: 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.contact__card p {
  margin-bottom: 1rem;
  color: var(--color-gray-600);
  font-size: 0.9375rem;
}

.contact__card a {
  color: var(--color-accent);
}

/* --- WhatsApp Button --- */
.whatsapp-btn {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-whatsapp);
  color: var(--color-white);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
  z-index: 99;
  transition: all var(--transition);
}

.whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
  background-color: var(--color-whatsapp-dark);
  color: var(--color-white);
}

.whatsapp-btn:active {
  transform: scale(1.05);
}

/* No superponer footer en mobile: ajuste de posición */
@media (max-width: 767px) {
  .whatsapp-btn {
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    right: calc(1.25rem + env(safe-area-inset-right, 0px));
  }
}

@media (min-width: 768px) {
  .whatsapp-btn {
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
  }
}

/* --- Footer --- */
.footer {
  background-color: var(--color-primary-dark);
  color: var(--color-gray-400);
  padding: 2.5rem 0;
}

/* Espacio extra en footer mobile para que el botón WhatsApp no tape el contenido */
@media (max-width: 767px) {
  .footer {
    padding-bottom: calc(2.5rem + 72px); /* Altura botón + margen */
  }
}

.footer__content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer__logo {
  font-family: var(--font-main);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.25rem;
}

.footer__contact a {
  color: var(--color-gray-400);
  transition: color var(--transition);
}

.footer__contact a:hover {
  color: var(--color-white);
}

.footer__bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer__bottom p {
  font-size: 0.875rem;
  opacity: 0.85;
}

/* --- Tablet (768px+) --- */
@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }

  .nav__list {
    display: flex;
    flex-direction: row;
    position: static;
    gap: 2rem;
    padding: 0;
    box-shadow: none;
  }

  .hero {
    min-height: 85vh;
  }

  .hero__title {
    font-size: 3rem;
  }

  .hero__slogan {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
  }

  .section-title {
    font-size: 2.25rem;
  }

  .about__grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
  }

  .about__visual {
    order: 1;
  }

  .about__content {
    order: 0;
  }

  .services__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
  }

  .service-card {
    padding: 2.25rem;
  }

  .contact__grid {
    grid-template-columns: 1.5fr 1fr;
  }

  .footer__content {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

/* --- Desktop (1024px+) --- */
@media (min-width: 1024px) {
  .header__container {
    padding: 1.125rem 1.5rem;
  }

  .hero__title {
    font-size: 3.5rem;
  }

  .hero__slogan {
    font-size: 1.375rem;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
  }

  .about {
    padding: 5rem 0;
  }

  .services__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .services {
    padding: 5rem 0;
  }

  .contact {
    padding: 5rem 0;
  }

  .service-card {
    padding: 2.5rem;
  }
}
