:root {
  --primary: #0D47A1;
  --secondary: #FFB300;
  --dark: #212121;
  --light: #F5F5F5;
  --white: #ffffff;
  --gray: #757575;
  --success: #2E7D32;
  --error: #C62828;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--white);
  color: var(--dark);
  line-height: 1.7;
}

/* Header */
header {
  background: linear-gradient(135deg, rgba(13, 71, 161, 0.9), rgba(0, 30, 80, 0.95)), url('https://images.unsplash.com/photo-1522071820081-009f0129c71c?auto=format&fit=crop&w=1350') no-repeat center center/cover;
  color: var(--white);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 2rem 1rem;
}

.header-content { z-index: 1; max-width: 800px; margin: 0 auto; }
.header-logo { margin-bottom: 1rem; }
header h1 { font-size: 3.5rem; font-weight: 700; margin-bottom: 0.5rem; text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5); }
header p { font-size: 1.3rem; opacity: 0.9; margin-bottom: 2rem; }

.cta-button {
  display: inline-block;
  background-color: var(--secondary);
  color: var(--dark);
  padding: 1rem 2.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.cta-button:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(255, 179, 0, 0.4); }

/* Navigation */
nav {
  background-color: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}
nav.nav-scrolled { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.nav-container { max-width: 1300px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 2rem; }
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { margin-right: 12px; }
.logo-text-container { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text { font-weight: 700; color: var(--primary); font-size: 1.5rem; }
.logo-subtext { font-weight: 400; color: var(--dark); font-size: 0.9rem; letter-spacing: 1px; }
.logo-subtext-footer { font-weight: 400; color: var(--white); font-size: 0.9rem; letter-spacing: 1px; }

.menu-toggle { display: none; cursor: pointer; } /* Estilos para la X en JS */
.nav-links { display: flex; list-style: none; }
.nav-links li { margin-left: 2.5rem; }
.nav-links a { text-decoration: none; color: var(--dark); font-weight: 500; transition: color 0.3s; position: relative; padding: 5px 0; }
.nav-links a:hover { color: var(--primary); }
.nav-links a::after { content: ''; position: absolute; width: 0; height: 3px; background: var(--secondary); bottom: -5px; left: 50%; transform: translateX(-50%); transition: width 0.3s; }
.nav-links a:hover::after { width: 100%; }

/* Sections */
section { padding: 5rem 2rem; max-width: 1200px; margin: 0 auto; }
.bg-light { background-color: var(--light); }

.section-title { text-align: center; margin-bottom: 4rem; }
.section-title h2 { font-size: 2.5rem; color: var(--primary); display: inline-block; position: relative; padding-bottom: 1rem; }
.section-title h2::after { content: ''; position: absolute; width: 80px; height: 4px; background: var(--secondary); bottom: 0; left: 50%; transform: translateX(-50%); border-radius: 2px; }

/* About Section */
.about-content { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 4rem; }
.about-text h3 { font-size: 1.8rem; color: var(--primary); margin-bottom: 1rem; }
.about-image img { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 15px 40px rgba(0,0,0,0.1); }

/* Services Section - CORREGIDO */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }

.service-card {
  background: var(--white);
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 2.5rem 2rem;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  overflow: hidden;
  /* --- AJUSTES PARA ALINEACIÓN --- */
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.service-icon-img {
  width: 280px;
  height: 250px;
  object-fit: cover;
  border-radius: 5%;
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

.service-card:hover .service-icon-img {
  transition: transform 0.7s ease-in-out;
  transform: scale(1.05);
}

.service-card h3 { font-size: 1.4rem; margin-bottom: 1rem; color: var(--primary); }

/* Nueva regla para empujar el botón hacia abajo */
.service-card > p {
    flex-grow: 1;
}

/* --- ESTILOS PARA EL NUEVO BOTÓN --- */
.card-button {
    display: inline-block;
    margin-top: 1.5rem; /* Espacio entre la descripción y el botón */
    padding: 0.6rem 1.5rem;
    background-color: transparent;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    border-radius: 50px;
    border: 2px solid var(--primary);
    transition: all 0.3s ease;
}

.card-button:hover {
    background-color: var(--primary);
    color: var(--white);
    transform: scale(1.05);
}

.card-button i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.card-button:hover i {
    transform: translateX(4px);
}
/* Fin de la corrección de Servicios */


/* Benefits Section */
.features-list { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 2rem; }
.feature-item { display: flex; align-items: center; background: var(--white); padding: 2rem; border-radius: 8px; border-left: 5px solid var(--primary); box-shadow: 0 5px 25px rgba(0,0,0,0.07); }
.feature-icon { font-size: 2.5rem; color: var(--primary); margin-right: 2rem; }
.feature-text h3 { margin-bottom: 0.5rem; font-size: 1.3rem; }

/* Contact Section */
.contact-container { display: grid; grid-template-columns: 1fr 1.5fr; gap: 3rem; }
.contact-info { background: var(--primary); color: var(--white); padding: 3rem; border-radius: 10px; }
.contact-info h3, .contact-form-wrapper h3 { font-size: 1.8rem; margin-bottom: 1.5rem; }
.contact-info p { opacity: 0.9; }
.contact-item { display: flex; align-items: flex-start; margin-top: 2rem; }
.contact-item i { font-size: 1.5rem; margin-right: 1.5rem; margin-top: 5px; color: var(--secondary); }
.contact-item a { color: var(--white); text-decoration: none; transition: opacity 0.3s; }
.contact-item a:hover { opacity: 0.8; }

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.form-control { width: 100%; padding: 1rem; border: 1px solid #ddd; border-radius: 5px; font-family: inherit; transition: border-color 0.3s, box-shadow 0.3s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.2); }
textarea.form-control { min-height: 150px; resize: vertical; }

.submit-btn { width: 100%; background: var(--secondary); color: var(--dark); border: none; padding: 1rem; border-radius: 5px; cursor: pointer; font-weight: 700; font-size: 1rem; transition: all 0.3s; }
.submit-btn:hover { background: #ffc107; box-shadow: 0 5px 15px rgba(255,179,0,0.4); }

.form-status { margin-top: 1rem; padding: 1rem; border-radius: 5px; text-align: center; display: none; }
.form-status.success { background-color: #d4edda; color: #155724; }
.form-status.error { background-color: #f8d7da; color: #721c24; }

/* Footer */
footer { background: var(--dark); color: var(--white); padding: 2rem; }

.footer-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-logo img {
  width: 50px;
  height: 50px;
}

.footer-copy {
  margin: 0;
  font-size: 0.95rem;
}

/* Floating Buttons */
.floating-buttons { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 15px; z-index: 1000; }
.floating-btn { width: 55px; height: 55px; border-radius: 50%; color: white; display: flex; align-items: center; justify-content: center; text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,0.2); transition: transform 0.3s, background-color 0.3s; font-size: 1.5rem; }
.floating-btn.whatsapp { background-color: #25D366; }
.floating-btn.top { background-color: var(--primary); display: none; /* Controlado por JS */ }
.floating-btn:hover { transform: scale(1.1); }

/* Animations */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-in.is-visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.2s; } .delay-2 { transition-delay: 0.4s; }

.cta-button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.cta-button-container .cta-button {
  width: 100%;
  text-align: center;
}

.cta-button.secondary-outline {
  background-color: transparent;
  border: 2px solid var(--secondary);
  color: var(--secondary);
}

.cta-button.secondary-outline:hover {
  background-color: var(--secondary);
  color: var(--dark);
  box-shadow: 0 8px 25px rgba(255, 179, 0, 0.3);
}

.contact-socials {
  margin-top: 2rem;
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.contact-socials a {
  color: var(--secondary);
  font-size: 1.5rem;
  transition: color 0.3s;
}

.contact-socials a:hover {
  color: var(--white);
}

.form-status {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 6px;
  font-weight: 500;
  text-align: center;
  display: none;
}

.form-status.success {
  background-color: #e6f4ea;
  color: #256029;
  border: 1px solid #a5d6a7;
}

.form-status.error {
  background-color: #fdecea;
  color: #c62828;
  border: 1px solid #f5c6cb;
}

.floating-center-btn {
  position: fixed;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  z-index: 999;
  background-color: transparent;
  padding: 0;
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.floating-center-btn img {
  width: 60px;
  height: auto;
  display: block;
  border-radius: 8px;
}

.floating-center-btn:hover {
  transform: translateY(-50%) scale(1.05);
}

/* ----- Responsive ----- */

@media (min-width: 768px) {
  .cta-button-container {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
    max-width: none;
  }

  .cta-button-container .cta-button {
    flex: 1 1 0;
    max-width: 250px;
  }
}

@media (max-width: 992px) {
  .about-content, .contact-container { grid-template-columns: 1fr; }
  .about-image { order: -1; margin-bottom: 2rem; }
}

@media (max-width: 768px) {
  header h1 { font-size: 2.5rem; }
  header p { font-size: 1.1rem; }
  section { padding: 4rem 1rem; }
  .nav-container { padding: 0.8rem 1rem; }
  .nav-links { position: fixed; top: 67px; left: -100%; width: 70%; height: calc(100vh - 67px); background-color: var(--white); flex-direction: column; align-items: center; padding-top: 3rem; box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1); transition: left 0.35s ease-in-out; }
  .nav-links.active { left: 0; }
  .nav-links li { margin: 1.5rem 0; margin-left: 0; }
  .menu-toggle { display: flex; flex-direction: column; justify-content: space-around; width: 30px; height: 24px; }
  .menu-toggle span { display: block; height: 3px; width: 100%; background-color: var(--primary); border-radius: 3px; transition: all 0.3s ease-in-out; }
  .menu-toggle.active span:nth-child(1) { transform: translateY(10.5px) rotate(45deg); }
  .menu-toggle.active span:nth-child(2) { opacity: 0; }
  .menu-toggle.active span:nth-child(3) { transform: translateY(-10.5px) rotate(-45deg); }
}

@media (max-width: 600px) {
  .footer-flex {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-copy {
    margin-top: 1rem;
  }

  .contact-socials {
    justify-content: center;
  }
}

@media (max-width: 400px) {
  html {
    font-size: 14px;
  }
  
  header {
    padding: 1rem;
  }
  
  header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }
  
  header p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  #contacto {
    padding: 2rem 1rem;
  }
  
  .contact-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .contact-info {
    padding: 1.5rem;
  }
  
  .contact-form-wrapper {
    padding: 1rem;
  }
  
  .contact-item {
    flex-direction: column;
    margin-top: 1rem;
  }
  
  .contact-item i {
    margin-right: 0;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
  }
  
  .contact-item div p {
    margin-bottom: 0.3rem;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  .form-control {
    padding: 0.7rem;
    font-size: 0.9rem;
  }
  
  .submit-btn {
    padding: 0.8rem;
    font-size: 0.9rem;
  }
  
  .contact-info a, 
  .contact-info p,
  .form-control {
    word-break: break-word;
    overflow-wrap: break-word;
  }
  
  footer {
    padding: 2rem 1rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .footer-logo {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .footer-logo img {
    margin-bottom: 0.5rem;
  }
  
  .footer-links a {
    font-size: 0.9rem;
  }
  
  .copyright {
    margin-top: 2rem;
    padding-top: 1rem;
    font-size: 0.8rem;
  }
  
  .floating-buttons {
    bottom: 10px;
    right: 10px;
  }
  
  .floating-btn {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
  }
}

@media (max-width: 320px) {
  .service-icon-img {
    width: 100%;
    height: auto;
  }
  .contact-container {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .contact-info, .contact-form-wrapper {
    padding: 1.5rem 1rem;
  }

  .form-group label, 
  .form-control, 
  .submit-btn {
    font-size: 0.95rem;
  }

  .form-control {
    padding: 0.75rem;
  }
}