/* ===== VARIABLES Y CONFIGURACIÓN ===== */
:root {
  --navy: #0b2a63;
  --navy-dark: #071d47;
  --navy-light: #1a3a7a;
  --orange: #ff7a00;
  --orange-dark: #e06a00;
  --orange-light: #ff9a3d;
  --gray: #6b7280;
  --gray-light: #f8fafc;
  --muted: #f7f8fb;
  --text: #1f2937;
  --text-light: #6b7280;
  --white: #ffffff;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background-color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== COMPONENTES REUTILIZABLES ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 700;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  gap: 8px;
  font-size: 15px;
}

.btn.primary {
  background: var(--orange);
  color: var(--white);
}

.btn.primary:hover {
  background: var(--orange-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn.ghost {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--white);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.section {
  padding: 80px 0;
}

.section h2 {
  font-size: 36px;
  color: var(--navy);
  margin-bottom: 16px;
  font-family: 'Montserrat', sans-serif;
  text-align: center;
}

.subtitle {
  color: var(--gray);
  margin-bottom: 40px;
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-size: 18px;
}

.center {
  text-align: center;
}

/* ===== TOPBAR ===== */
.topbar {
  background: var(--navy);
  color: var(--white);
  padding: 10px 0;
  font-size: 14px;
}

.tb-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.contact-small {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.contact-small div {
  display: flex;
  align-items: center;
  gap: 5px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.socials-top {
  display: flex;
  gap: 12px;
}

.socials-top a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  text-decoration: none;
  transition: var(--transition);
  font-size: 14px;
}

.socials-top a:hover {
  background: var(--orange);
  transform: translateY(-2px);
}

/* ===== NAVEGACIÓN ===== */
.nav-wrap {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(11, 42, 99, 0.08);
  transition: var(--transition);
}

.nav-wrap.scrolled {
  box-shadow: 0 4px 20px rgba(11, 42, 99, 0.12);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: auto;
  height: 50px;
  object-fit: contain;
  border-radius: 8px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text .company {
  font-weight: 800;
  color: var(--navy);
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  line-height: 1.1;
}

.brand-text .tag {
  font-size: 13px;
  color: var(--gray);
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  transition: var(--transition);
  position: relative;
  font-size: 15px;
}

.nav-links a:hover {
  color: var(--orange);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--orange);
  transition: var(--transition);
  transform: translateX(-50%);
}

.nav-links a:hover::after {
  width: 80%;
}

.hamburger {
  display: none;
  background: none;
  border: 0;
  font-size: 28px;
  padding: 6px;
  cursor: pointer;
  color: var(--navy);
}

/* ===== HERO SECTION ===== */
.hero {
  padding: 90px 0 70px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" opacity="0.05"><polygon fill="white" points="0,1000 1000,0 1000,1000"/></svg>');
  background-size: cover;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-left h1 {
  font-size: 48px;
  margin: 0 0 16px;
  line-height: 1.1;
  color: var(--white);
  font-family: 'Montserrat', sans-serif;
}

.lead {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 24px;
  font-size: 18px;
  max-width: 600px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.hero-features {
  list-style: none;
  padding: 0;
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.hero-features li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-features li::before {
  content: '✓';
  color: var(--orange);
  font-weight: bold;
}

.hero-right .hero-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: var(--transition);
}

.hero-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.hero-card img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
}

/* ===== ABOUT SECTION MODERNA ===== */
.about-modern {
  background: var(--gray-light);
}

.about-compact {
  max-width: 900px;
  margin: 0 auto;
}

.about-header-compact {
  text-align: center;
  margin-bottom: 40px;
}

.about-badge {
  display: inline-block;
  background: var(--orange-light);
  color: var(--white);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.about-header-compact h2 {
  margin-bottom: 16px;
}

.about-header-compact p {
  color: var(--text-light);
  font-size: 16px;
  max-width: 700px;
  margin: 0 auto;
}

.about-features-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.feature-compact {
  text-align: center;
  padding: 20px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.feature-compact:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-icon-compact {
  font-size: 36px;
  display: block;
  margin-bottom: 12px;
}

.feature-compact h4 {
  color: var(--navy);
  font-size: 16px;
  margin: 0;
}

.stats-compact {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  padding: 30px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.stats-compact.animated {
  opacity: 1;
  transform: translateY(0);
}

.stat-item {
  text-align: center;
  position: relative;
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 122, 0, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  animation: pulse 2s ease-out;
}

@keyframes pulse {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5);
  }
}

.stat-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--orange);
  font-family: 'Montserrat', sans-serif;
  display: inline-block;
  position: relative;
  text-shadow: 0 2px 4px rgba(255, 122, 0, 0.1);
  transition: transform 0.3s ease;
}

.stat-item:hover .stat-num {
  transform: scale(1.1);
}

.stat-text {
  color: var(--text-light);
  font-size: 14px;
  margin-top: 4px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.stat-item:hover .stat-text {
  color: var(--navy);
}

.stat-divider {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, transparent, #e5e7eb, transparent);
  animation: fadeIn 0.8s ease 0.5s backwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    height: 0;
  }
  to {
    opacity: 1;
    height: 50px;
  }
}

/* Animación de brillo para los números */
@keyframes shine {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.stats-compact.animated .stat-num {
  background: linear-gradient(
    90deg,
    var(--orange) 0%,
    var(--orange-light) 50%,
    var(--orange) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine 3s linear infinite;
}

/* Efecto de partículas */
.stat-item::after {
  content: '✨';
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 20px;
  opacity: 0;
  animation: sparkle 2s ease-in-out 1s infinite;
}

@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(180deg);
  }
}

/* ===== SERVICES SECTION ===== */
.services {
  background: var(--white);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.card {
  background: var(--white);
  padding: 30px;
  border-radius: 16px;
  border: 1px solid #f1f3f8;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--orange-light);
}

.card .icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.card h3 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 20px;
}

.card p {
  color: var(--text-light);
  flex-grow: 1;
  margin: 0;
}

/* ===== PROJECTS SECTION ===== */
.projects {
  background: var(--gray-light);
  position: relative;
}

.projects-container {
  position: relative;
}

.projects-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 20px 10px 40px;
  margin: 0 -10px;
  scrollbar-width: none;
}

.projects-scroll::-webkit-scrollbar {
  display: none;
}

.project {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  flex: 0 0 320px;
  min-width: 320px;
  cursor: pointer;
}

.project:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.project img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.project figcaption {
  padding: 20px;
}

.project h4 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 18px;
}

.project p {
  color: var(--text-light);
  margin: 0;
}

.scroll-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.scroll-btn {
  background: var(--navy);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.scroll-btn:hover {
  background: var(--orange);
  transform: scale(1.1);
}

/* ===== TESTIMONIALS SECTION ===== */
.testimonials {
  background: var(--white);
  position: relative;
}

.testimonials-container {
  position: relative;
}

.testimonials-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 20px 10px 40px;
  margin: 0 -10px;
  scrollbar-width: none;
}

.testimonials-scroll::-webkit-scrollbar {
  display: none;
}

.test {
  background: var(--white);
  padding: 30px;
  border-radius: 16px;
  border-left: 4px solid var(--orange);
  box-shadow: var(--shadow);
  transition: var(--transition);
  flex: 0 0 380px;
  min-width: 380px;
  display: flex;
  flex-direction: column;
}

.test:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.test p {
  font-style: italic;
  margin-bottom: 16px;
  color: var(--text);
  flex-grow: 1;
}

.test footer {
  font-weight: 600;
  color: var(--navy);
  margin-top: auto;
}

.test-rating {
  color: var(--orange);
  margin-bottom: 12px;
  font-size: 14px;
}

/* ===== CONTACT SECTION - OPTIMIZADA ===== */
.contact {
  background: var(--navy);
  color: var(--white);
  padding: 60px 0;
}

.contact h2 {
  color: var(--white);
}

.contact .subtitle {
  color: rgba(255, 255, 255, 0.8);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 40px;
  align-items: start;
  max-width: 1000px;
  margin: 0 auto;
}

.contact-info-wrapper {
  background: rgba(255, 255, 255, 0.05);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-info {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.contact-info li {
  padding: 10px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
}

.contact-info strong {
  min-width: 70px;
  color: var(--orange-light);
}

.socials {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  text-decoration: none;
  transition: var(--transition);
}

.socials a:hover {
  background: var(--orange);
  transform: translateY(-2px);
}

.contact-form-wrapper {
  background: var(--white);
  padding: 30px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

#contactForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--navy);
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: var(--transition);
  background: var(--white);
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

#charCounter {
  text-align: right;
  font-size: 12px;
  color: var(--gray);
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.form-actions .btn {
  flex: 1;
  padding: 12px 24px;
}

.form-actions .btn.ghost {
  border: 2px solid var(--gray-light);
  color: var(--text);
}

.form-actions .btn.ghost:hover {
  background: var(--gray-light);
  border-color: var(--gray);
}

.form-note {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
  display: none;
}

.form-message.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.form-message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.form-message.loading {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 40px 0 30px;
  text-align: center;
}

.lang-selector {
  margin-bottom: 20px;
}

.lang-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  font-weight: 600;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
  background: var(--orange);
  border-color: var(--orange);
}

.footer-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--orange);
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  padding: 20px;
  flex-direction: column;
}

.modal-content {
  max-width: 90%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: var(--white);
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
  z-index: 1001;
}

.modal-close:hover {
  color: var(--orange);
}

#modalCaption {
  color: var(--white);
  text-align: center;
  padding: 20px;
  font-size: 18px;
  font-weight: 600;
  max-width: 800px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  margin-top: 20px;
  backdrop-filter: blur(10px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .hero-right {
    order: -1;
  }
  
  .hero-card img {
    height: 300px;
  }
  
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
  
  .about-features-compact {
    grid-template-columns: 1fr;
  }
  
  .stats-compact {
    flex-direction: column;
    gap: 20px;
  }
  
  .stat-divider {
    display: none;
  }
}

@media (max-width: 768px) {
  .topbar {
    display: none;
  }
  
  .nav-links {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--white);
    flex-direction: column;
    padding: 40px 20px;
    box-shadow: var(--shadow-lg);
    transition: left 0.3s ease;
    gap: 10px;
  }
  
  .nav-links.active {
    left: 0;
  }
  
  .nav-links a {
    width: 100%;
    text-align: center;
    padding: 12px;
    font-size: 18px;
  }
  
  .hamburger {
    display: block;
  }
  
  .hero {
    padding: 60px 0 40px;
  }
  
  .hero-left h1 {
    font-size: 32px;
  }
  
  .lead {
    font-size: 16px;
  }
  
  .hero-cta {
    flex-direction: column;
  }
  
  .hero-cta .btn {
    width: 100%;
  }
  
  .section {
    padding: 60px 0;
  }
  
  .section h2 {
    font-size: 28px;
  }
  
  .cards {
    grid-template-columns: 1fr;
  }
  
  .project {
    flex: 0 0 280px;
    min-width: 280px;
  }
  
  .test {
    flex: 0 0 300px;
    min-width: 300px;
  }
  
  .contact {
    padding: 50px 0;
  }
  
  .contact-form-wrapper {
    padding: 20px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .modal-close {
    top: 10px;
    right: 20px;
    font-size: 30px;
  }
}

@media (max-width: 480px) {
  .hero-left h1 {
    font-size: 26px;
  }
  
  .contact-small {
    flex-direction: column;
    gap: 8px;
  }
  
  .stats-compact {
    padding: 20px;
  }
  
  .stat-num {
    font-size: 28px;
  }
  
  .lang-buttons {
    flex-direction: column;
  }
  
  .lang-btn {
    width: 100%;
  }
}