/* ==========================================================================
   VARIABLES CSS (cambiá los colores aquí para modificar toda la web)
   ========================================================================== */
:root {
  /* Colores base */
  --color-bg: #ffffff;
  --color-bg-alt: #f8f9fb;
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-primary: #0a192f; /* Azul profundo casi negro */
  --color-accent: #2563eb; /* Azul seguridad (puedes cambiarlo a #0d9488 para teal) */
  --color-cta: #ca8a04; /* Dorado discreto para llamados a la acción */
  --color-border: #e2e8f0;
  --color-footer-bg: #0a192f;
  --color-footer-text: #cbd5e1;

  /* Tipografía */
  --font-main: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Tamaños */
  --container-max: 1200px;
  --nav-height: 70px;
  --transition: 0.3s ease;
}

/* ==========================================================================
   RESET Y ESTILOS BASE
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

ul {
  list-style: none;
}

/* Utilidades */
.container {
  width: 90%;
  max-width: var(--container-max);
  margin: 0 auto;
}

.section-padding {
  padding: 5rem 0;
}

.bg-alt {
  background-color: var(--color-bg-alt);
}

.section-title {
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
  text-align: center;
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 3rem;
  font-size: 1.1rem;
}

/* Botones */
.btn {
  display: inline-block;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  transition:
    background-color var(--transition),
    transform var(--transition);
  cursor: pointer;
  border: none;
  font-family: var(--font-main);
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-cta,
.btn-hero,
.btn-submit {
  background-color: var(--color-cta);
  color: #ffffff;
}

.btn-cta:hover,
.btn-hero:hover,
.btn-submit:hover {
  background-color: #b7791f; /* un tono más oscuro del dorado */
}

/* ==========================================================================
   NAVBAR FIJA
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  transition: background-color 0.3s;
}

/* Pequeña variación al hacer scroll (JS añade clase .scrolled) */
.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img,
.logo-white {
  height: 40px;
  width: auto;
}

/* Mostrar logo blanco cuando el fondo es oscuro (solo en footer) */
.logo-white {
  display: none;
}

.main-nav .nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  color: var(--color-text);
  transition: color var(--transition);
  position: relative;
}

.nav-link::after {
  content: "";
  display: block;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition);
  position: absolute;
  bottom: -4px;
  left: 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-accent);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-cta {
  margin-left: 1rem;
}

/* Hamburguesa (móvil) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  gap: 5px;
  padding: 5px;
}

.hamburger-line {
  width: 25px;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transition);
  display: block;
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
  margin-top: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10, 25, 47, 0.8) 0%, rgba(10, 25, 47, 0.4) 100%);
  z-index: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  /* La imagen se define inline en el HTML */
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 1rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  font-weight: 300;
  opacity: 0.95;
}

/* ==========================================================================
   SERVICIOS (grid)
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.service-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 2rem 1.5rem;
  transition:
    box-shadow var(--transition),
    transform var(--transition);
  text-align: left;
}

.service-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.service-icon {
  color: var(--color-accent);
  width: 48px;
  height: 48px;
  margin-bottom: 1.25rem;
}

.service-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
}

.service-card p {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ==========================================================================
   SOLUCIONES (tarjetas por sector)
   ========================================================================== */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}

.solution-card {
  background: #fff;
  border-radius: 8px;
  padding: 2rem;
  border-left: 4px solid var(--color-accent);
}

.solution-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}

.pain {
  font-style: italic;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.solution {
  font-weight: 500;
  font-size: 0.95rem;
}

/* ==========================================================================
   NOSOTROS
   ========================================================================== */
.about-content {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  align-items: center;
  margin-top: 2rem;
}

.about-text {
  flex: 1 1 500px;
}

.about-text p {
  margin-bottom: 1.5rem;
  color: var(--color-text-muted);
}

.about-image {
  flex: 1 1 400px;
}

.about-image img {
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   TESTIMONIOS
   ========================================================================== */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.testimonial {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  font-style: italic;
  position: relative;
}

.testimonial p {
  margin-bottom: 1rem;
  color: var(--color-text);
}

.testimonial cite {
  display: block;
  font-style: normal;
  font-weight: 600;
  color: var(--color-accent);
}

/* ==========================================================================
   GALERÍA DE PROYECTOS
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-item {
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
}

.gallery-item:hover {
  transform: scale(1.02);
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

/* ==========================================================================
   CONTACTO
   ========================================================================== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  margin-top: 2rem;
}

.contact-form {
  background: #fff;
  padding: 2.5rem;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: border-color var(--transition);
  background: #fafbfc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  background: #fff;
}

.error-message {
  font-size: 0.8rem;
  color: #dc2626;
  margin-top: 0.2rem;
  display: none;
}

.form-group.error input,
.form-group.error textarea {
  border-color: #dc2626;
}

.form-feedback {
  margin-top: 1rem;
  font-weight: 500;
}

.contact-info {
  padding: 2rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 10px;
}

.contact-info h3 {
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

.contact-info p {
  margin-bottom: 1rem;
}

.contact-info a {
  color: var(--color-cta);
  text-decoration: underline;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding-top: 4rem;
  padding-bottom: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-logo {
  height: 45px;
  margin-bottom: 1rem;
}

.footer h4 {
  color: #ffffff;
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer ul li {
  margin-bottom: 0.5rem;
}

.footer a:hover {
  color: var(--color-cta);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 2rem;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.newsletter-form input {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: 4px;
  font-family: var(--font-main);
}

.newsletter-form .btn {
  background: var(--color-cta);
  color: #fff;
  padding: 0.5rem 1rem;
}

/* ==========================================================================
   RESPONSIVE (Mobile first adjustments)
   ========================================================================== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    padding: 5rem 2rem;
    transition: right var(--transition);
    z-index: 999;
  }

  .main-nav.active {
    right: 0;
  }

  .nav-links {
    flex-direction: column;
    gap: 2rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .about-content {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
