/* ===== Reset & Variables ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #1a4d8f;
  --secondary-color: #2563eb;
  --accent-color: #f59e0b;
  --dark-color: #1f2937;
  --light-color: #f3f4f6;
  --text-dark: #111827;
  --text-light: #6b7280;
  --white: #ffffff;
  --transition: all 0.3s ease;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: var(--transition);
}

.navbar.scrolled {
  background: var(--white);
  box-shadow: 0 2px 30px rgba(0, 0, 0, 0.15);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo img {
  height: 60px;
  width: auto;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--secondary-color);
}
.nav-link:hover::after {
  width: 100%;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}
.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--primary-color);
  transition: var(--transition);
}

/* ===== Hero ===== */
.hero {
  height: 100vh;
  min-height: 600px;
  background:
    linear-gradient(135deg, rgba(26, 77, 143, 0.92), rgba(37, 99, 235, 0.85)),
    url("https://images.unsplash.com/photo-1503387762-592deb58ef4e?w=1600")
      center/cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  padding: 0 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease;
}
.hero-subtitle {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease 0.2s both;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 1s ease 0.4s both;
}

/* ===== Hero Stats ===== */
.hero-stats {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  padding: 0 20px 50px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 16px;
}

.hero-stat-item {
  flex: 1;
  text-align: center;
  padding: 22px 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.hero-stat-item:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-stat-item .stat-number {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 6px;
  line-height: 1;
}
.hero-stat-item .stat-label {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.8);
}
.hero-stat-divider {
  display: none;
}

/* ===== Scroll Indicator ===== */
.scroll-indicator {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  animation: bounce 2s infinite;
  z-index: 3;
  transition: color 0.3s ease;
}
.scroll-indicator:hover {
  color: var(--accent-color);
}

/* ===== Buttons ===== */
.btn {
  padding: 14px 32px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  display: inline-block;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: var(--accent-color);
  color: var(--white);
}
.btn-primary:hover {
  background: #d97706;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}
.btn-outline:hover {
  background: var(--white);
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* ===== Sections ===== */
section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}
.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
}
.title-underline {
  width: 80px;
  height: 4px;
  background: var(--secondary-color);
  margin: 0 auto 1rem;
}
.section-subtitle {
  color: var(--text-light);
  font-size: 1.1rem;
}

/* ===== About ===== */
.about {
  background: var(--light-color);
  padding-top: 3rem;
}

.about-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 3rem;
  height: 400px;
  box-shadow: var(--shadow-hover);
}

.about-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(26, 77, 143, 0.9),
    rgba(37, 99, 235, 0.85)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.about-hero-content {
  max-width: 800px;
  text-align: center;
  color: var(--white);
}
.about-hero-content h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--white);
}
.about-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.95);
}

.mission-vision {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.mv-item {
  background: var(--white);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border-left: 5px solid var(--accent-color);
}
.mv-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.mv-item h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
}
.mv-item i {
  color: var(--accent-color);
  font-size: 1.8rem;
}
.mv-item p {
  color: var(--text-light);
  line-height: 1.8;
  font-size: 1.05rem;
}

.values {
  background: var(--white);
  padding: 3rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.values h3 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--primary-color);
  font-size: 2rem;
}
.values-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.value-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 12px;
  transition: var(--transition);
  border: 2px solid transparent;
}
.value-item:hover {
  border-color: var(--accent-color);
  transform: translateY(-5px);
  background: var(--white);
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.2);
}
.value-item i {
  color: var(--accent-color);
  font-size: 2.5rem;
}
.value-item span {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 1.1rem;
}

/* ===== Services ===== */
.services {
  background: var(--white);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.service-card {
  background: var(--white);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border-top: 4px solid var(--secondary-color);
}
.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.service-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}
.service-card p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}
.service-features {
  list-style: none;
}
.service-features li {
  padding: 0.5rem 0;
  color: var(--text-light);
  position: relative;
  padding-left: 25px;
}
.service-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
}

/* ===== Projects ===== */
.projects {
  background: var(--light-color);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.project-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.project-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.project-image {
  position: relative;
  height: 220px;
  overflow: hidden;
}
.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: var(--transition);
}
.project-card:hover .project-image img {
  transform: scale(1.1);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, rgba(26, 77, 143, 0.9));
  display: flex;
  align-items: flex-end;
  padding: 1.2rem;
  opacity: 0;
  transition: var(--transition);
}
.project-card:hover .project-overlay {
  opacity: 1;
}
.project-overlay h4 {
  color: var(--white);
  font-size: 1rem;
  line-height: 1.3;
}

.project-info {
  padding: 1.2rem 1.5rem;
  text-align: center;
}
.project-info h3 {
  color: var(--text-dark);
  font-size: 1rem;
  line-height: 1.4;
}

/* ===== Team ===== */
.team {
  background: var(--white);
  text-align: center;
}
.team-content p {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-light);
}

/* ===== Contact ===== */
.contact {
  background: var(--light-color);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.office {
  background: var(--white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--secondary-color);
  transition: var(--transition);
  height: 100%;
}

.office:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.office h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
}

.office p {
  color: var(--text-light);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.office i {
  color: var(--accent-color);
  margin-top: 3px;
  flex-shrink: 0;
}

.contact-whatsapp {
  position: sticky;
  top: 100px;
}

.office {
  background: var(--white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--secondary-color);
  transition: var(--transition);
}
.office:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.office h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
}
.office p {
  color: var(--text-light);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.office i {
  color: var(--accent-color);
  margin-top: 3px;
  flex-shrink: 0;
}

.contact-whatsapp {
  position: sticky;
  top: 100px;
}

.whatsapp-box {
  background: var(--white);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-hover);
  border-top: 4px solid #25d366;
}

.whatsapp-icon-big {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, #25d366, #1ebe57);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.8rem;
  color: var(--white);
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.35);
  animation: pulse-whatsapp 2.5s infinite;
}

.whatsapp-box h3 {
  font-size: 1.6rem;
  color: var(--text-dark);
  margin-bottom: 1rem;
}
.whatsapp-box p {
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.btn-whatsapp-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #25d366;
  color: var(--white);
  padding: 16px 36px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  transition: var(--transition);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.35);
  margin-bottom: 1.5rem;
}
.btn-whatsapp-cta i {
  font-size: 1.5rem;
}
.btn-whatsapp-cta:hover {
  background: #1ebe57;
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(37, 211, 102, 0.5);
}

.whatsapp-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.whatsapp-info span {
  color: var(--text-light);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.whatsapp-info i {
  color: var(--accent-color);
}

/* ===== WhatsApp Float ===== */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 62px;
  height: 62px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--white);
  text-decoration: none;
  z-index: 9999;
  box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
  transition: var(--transition);
  animation: pulse-whatsapp 2.5s infinite;
}
.whatsapp-float:hover {
  transform: scale(1.15);
  box-shadow: 0 10px 35px rgba(37, 211, 102, 0.65);
  animation: none;
}
.whatsapp-float:hover .whatsapp-tooltip {
  opacity: 1;
  transform: translateX(0);
}

.whatsapp-tooltip {
  position: absolute;
  right: 75px;
  background: var(--dark-color);
  color: var(--white);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(10px);
  transition: var(--transition);
  pointer-events: none;
}
.whatsapp-tooltip::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right: none;
  border-left-color: var(--dark-color);
}

/* ===== Footer ===== */
.footer {
  background: var(--dark-color);
  color: var(--white);
  padding: 3rem 0 1rem;
}
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 {
  margin-bottom: 1rem;
  color: var(--accent-color);
}
.footer-col p {
  color: #9ca3af;
  margin-bottom: 0.5rem;
}
.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  margin-bottom: 0.5rem;
}
.footer-col ul li a {
  color: #9ca3af;
  text-decoration: none;
  transition: var(--transition);
}
.footer-col ul li a:hover {
  color: var(--accent-color);
}
.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #374151;
  color: #9ca3af;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-20px) translateX(-50%);
  }
  60% {
    transform: translateY(-10px) translateX(-50%);
  }
}

@keyframes pulse-whatsapp {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(50px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.animate-on-scroll.active {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive 968px ===== */
@media (max-width: 968px) {
  .nav-menu {
    position: fixed;
    left: -100%;
    top: 75px;
    flex-direction: column;
    background: var(--white);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding: 2rem 0;
    z-index: 999;
  }
  .nav-menu.active {
    left: 0;
  }
  .hamburger {
    display: flex;
  }
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
  }

  .hero-title {
    font-size: 2.5rem;
  }
  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 16px 40px;
  }
  .hero-stat-item {
    flex: 1 1 45%;
    padding: 18px 10px;
  }
  .hero-stat-item .stat-number {
    font-size: 2.2rem;
  }

  .about-hero {
    height: auto;
    min-height: 320px;
  }
  .about-hero-overlay {
    padding: 2rem;
  }
  .about-hero-content h3 {
    font-size: 1.6rem;
  }
  .about-description {
    font-size: 1rem;
  }

  .mission-vision {
    grid-template-columns: 1fr;
  }
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-content {
    grid-template-columns: 1fr;
  }
  .contact-whatsapp {
    position: static;
  }
}

/* ===== Responsive 640px ===== */
@media (max-width: 640px) {
  section {
    padding: 3.5rem 0;
  }

  .hero-title {
    font-size: 1.9rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  /*  FIX 1: Stats en 2x2 sin overflow */
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 16px 30px;
    width: 100%;
  }

  .hero-stat-item {
    flex: none;
    width: 100%;
    padding: 16px 8px;
  }

  .hero-stat-item .stat-number {
    font-size: 1.8rem;
  }
  .hero-stat-label {
    font-size: 0.8rem;
  }

  .hero-stat-item:last-child {
    grid-column: 1 / -1;
    max-width: 50%;
    margin: 0 auto;
  }

  .section-title {
    font-size: 1.9rem;
  }
  .section-header {
    margin-bottom: 2.5rem;
  }

  .about-hero {
    height: auto;
    min-height: 260px;
  }
  .about-hero-overlay {
    padding: 1.5rem;
  }
  .about-hero-content h3 {
    font-size: 1.3rem;
  }
  .about-description {
    font-size: 0.92rem;
    line-height: 1.6;
    text-align: left;
  }

  .mv-item {
    padding: 1.5rem;
  }
  .mv-item h3 {
    font-size: 1.2rem;
  }

  .values {
    padding: 1.5rem;
  }
  .values h3 {
    font-size: 1.5rem;
  }

  /* FIX 2: Values en 1 columna para que no se corte el texto */
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .value-item {
    padding: 1.2rem 0.8rem;
  }
  .value-item i {
    font-size: 2rem;
  }
  .value-item span {
    font-size: 0.95rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }
  .service-card {
    padding: 1.8rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-image {
    height: 200px;
  }

  .contact-content {
    gap: 1.5rem;
  }
  .office {
    padding: 1.5rem;
  }

  .whatsapp-box {
    padding: 2rem 1.2rem;
  }
  .btn-whatsapp-cta {
    font-size: 0.95rem;
    padding: 13px 24px;
    width: 100%;
    justify-content: center;
  }

  .whatsapp-float {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
    font-size: 1.6rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
