/* Variables CSS - Tema Corporativo Equilibrado */
:root {
  --color-bg-main: #f5f0e8; /* Blanco crudo */
  --color-bg-section: #ffffff; /* Blanco */
  --color-bg-dark: #2c2c2a; /* Negro principal para navbar/footer */
  --color-text: #2c2c2a;
  --color-text-muted: #5a5a58;
  --color-trust: #2d6a4f; /* Verde corporativo */
  --color-cta: #f76205; /* Naranja */
  --color-cta-hover: #e05504;
  --color-overlay: rgba(44, 44, 42, 0.7);
  --color-border: rgba(44, 44, 42, 0.1);
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Reset y estilos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background-color: var(--color-bg-main);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 5%;
}

section {
  padding: 80px 0;
  position: relative;
  transition: background-color 0.4s ease;
}

/* Alternancia de fondos para que el sitio respire */
.section-light {
  background-color: var(--color-bg-main); /* Blanco crudo */
}

.section-white {
  background-color: var(--color-bg-section); /* Blanco puro */
}

.section-dark {
  background-color: var(--color-bg-dark); /* Negro corporativo */
  color: #ffffff;
}

.section-dark .card {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.section-dark h2, .section-dark h3, .section-dark h4 {
  color: #ffffff;
}

.section-dark p {
  color: #d1d1d1;
}

/* Tipografía */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

h1 { font-size: 4rem; color: #ffffff; } /* Hero H1 suele ser sobre fondo oscuro */
h2 { font-size: 2.8rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.3rem; }

p {
  margin-bottom: 20px;
  font-size: 1.15rem;
  color: var(--color-text-muted);
}

strong { color: var(--color-text); }
.section-dark strong { color: #ffffff; }

/* Botones Premium */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  border-radius: 50px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-primary {
  background-color: var(--color-cta);
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(247, 98, 5, 0.2);
}

.btn-primary:hover {
  background-color: var(--color-cta-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(247, 98, 5, 0.4);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}

.btn-secondary:hover {
  background-color: var(--color-text);
  color: var(--color-bg-section) !important;
}

.section-dark .btn-secondary {
  color: #ffffff;
  border-color: rgba(255,255,255,0.5);
}
.section-dark .btn-secondary:hover {
  background-color: #ffffff;
  color: var(--color-bg-dark) !important;
}

/* Header Navbar Elegante */
.header {
  background-color: rgba(44, 44, 42, 0.98); /* Negro corporativo casi opaco */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition-smooth);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 90px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 60px;
  transition: transform 0.3s ease;
  border-radius: 8px; /* Bordes redondeados solicitados */
}

.logo:hover img {
  transform: scale(1.05);
}

.nav-menu {
  display: flex;
  gap: 50px; /* Separar más los enlaces */
  align-items: center;
  margin-left: auto;
  margin-right: 5%; /* Mover ligeramente a la derecha pero no al borde */
}

.nav-link {
  font-weight: 500;
  font-size: 1.05rem;
  color: #ffffff; /* Texto blanco en navbar negra */
  position: relative;
  padding: 8px 0;
  opacity: 0.9;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-trust); /* Subrayado verde corporativo suave */
  transition: var(--transition-smooth);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  color: #ffffff;
  opacity: 1;
}

/* Dropdown sin flecha (ahora con flecha lateral) */
.dropdown {
  position: relative;
  display: inline-block;
  padding-bottom: 20px;
  margin-bottom: -20px;
}

.dropdown-icon {
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--color-bg-section);
  min-width: 260px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.1); /* Sombra más suave en tema claro */
  z-index: 10;
  border-radius: 12px;
  top: calc(100% + 15px);
  left: 50%;
  transform: translateX(-50%);
  padding: 15px 0;
  border: 1px solid var(--color-border);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.dropdown:hover .dropdown-content {
  display: block;
  opacity: 1;
  visibility: visible;
  top: 100%;
}

.dropdown-content a {
  color: var(--color-text);
  padding: 12px 25px;
  display: block;
  font-size: 1rem;
}

.dropdown-content a:hover {
  background-color: var(--color-bg-main);
  color: var(--color-cta);
  padding-left: 30px;
}

/* Hero Section (Carrusel) */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background-color: var(--color-bg-dark);
  padding: 0;
}

.hero-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  background-size: cover;
  background-position: center;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(44,44,42,0.95) 0%, rgba(44,44,42,0.6) 50%, rgba(44,44,42,0.3) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 40px 0;
}

.hero-content h1 {
  animation: fadeUp 1s ease forwards;
  color: #ffffff;
}

.hero-content p {
  animation: fadeUp 1s ease 0.2s forwards;
  opacity: 0;
  color: #f5f0e8;
  font-size: 1.3rem;
}

.hero-actions {
  display: flex;
  gap: 20px;
  margin-top: 50px;
  animation: fadeUp 1s ease 0.4s forwards;
  opacity: 0;
}

/* Grids Premium */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 60px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

/* Cards Modernas (Claras) */
.card {
  background-color: var(--color-bg-section);
  padding: 40px 30px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.03); /* Sombra muy sutil */
  transition: var(--transition-smooth);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-8px);
  border-color: rgba(45, 106, 79, 0.3); /* Hover border verde corporativo */
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08); /* Sombra ligeramente más fuerte */
}

.card img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 25px;
  object-fit: cover;
  aspect-ratio: 16/10;
  transition: transform 0.7s ease;
}

.card:hover img {
  transform: scale(1.03);
}

.card-icon {
  font-size: 3rem;
  color: var(--color-trust); /* Iconos en verde corporativo */
  margin-bottom: 25px;
  transition: var(--transition-smooth);
}

.card:hover .card-icon {
  transform: scale(1.1);
  color: var(--color-cta); /* Cambia a naranja en hover para dinamismo */
}

/* Showcase de Proyectos */
.project-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4/5;
  display: block;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.project-card:hover img {
  transform: scale(1.08);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44,44,42,0.95) 0%, rgba(44,44,42,0.4) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px 30px;
  transition: var(--transition-smooth);
}

.project-overlay h3 {
  margin-bottom: 5px;
  transform: translateY(20px);
  transition: var(--transition-smooth);
  color: #ffffff;
}

.project-overlay p {
  color: #f5f0e8;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition-smooth);
  transition-delay: 0.1s;
  font-size: 1rem;
  margin-bottom: 0;
}

.project-card:hover .project-overlay h3,
.project-card:hover .project-overlay p {
  transform: translateY(0);
  opacity: 1;
}

/* Galerías Internas (Carrusel) */
.gallery-carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-trust) var(--color-bg-main);
}

.gallery-carousel::-webkit-scrollbar {
  height: 8px;
}
.gallery-carousel::-webkit-scrollbar-track {
  background: var(--color-bg-main);
  border-radius: 10px;
}
.gallery-carousel::-webkit-scrollbar-thumb {
  background: var(--color-trust);
  border-radius: 10px;
}

.gallery-item {
  flex: 0 0 calc(80% - 20px);
  scroll-snap-align: center;
  border-radius: 16px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .gallery-item {
    flex: 0 0 calc(40% - 20px);
  }
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

/* Botón Flotante Chat */
.floating-chat {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 65px;
  height: 65px;
  background-color: var(--color-bg-section);
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  border: 2px solid var(--color-border);
}

.floating-chat:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 15px 40px rgba(45, 106, 79, 0.3);
  border-color: var(--color-trust);
}

.floating-chat img {
  width: 35px;
  height: 35px;
  object-fit: contain;
}

.floating-chat::before {
  content: 'Cuéntanos tu idea';
  position: absolute;
  right: calc(100% + 15px);
  background-color: var(--color-bg-dark);
  color: #fff;
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.floating-chat:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Footer (Negro Corporativo, 2 Columnas) */
.footer {
  background-color: var(--color-bg-dark);
  color: #f5f0e8;
  padding: 20px 0 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
}

.footer-logo {
  opacity: 0.9;
  transition: opacity 0.3s;
}
.footer-logo:hover {
  opacity: 1;
}
.footer-logo img {
  border-radius: 8px; /* Redondear logo en footer también */
}

.footer-info {
  display: flex;
  align-items: center;
}

.footer-info p {
  color: #f5f0e8;
  opacity: 0.8;
  margin: 0;
}

/* Iconos de Redes */
.social-icons {
  display: flex;
  gap: 10px;
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; 
  height: 40px; 
  border-radius: 50%;
  background-color: rgba(255,255,255,0.05);
  transition: var(--transition-smooth);
}

.social-icons a:hover {
  background-color: rgba(255,255,255,0.1);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.social-icons img, .social-icons svg {
  width: 24px; 
  height: 24px; 
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.footer-bottom {
  text-align: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.7;
}

.footer-links {
  display: flex;
  gap: 30px;
  justify-content: center;
}

.footer-links a {
  font-size: 0.9rem;
  color: #f5f0e8;
  opacity: 0.7;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: var(--transition-smooth);
}
.footer-links a:hover {
  color: var(--color-trust);
  opacity: 1;
  text-decoration-color: var(--color-trust);
}

/* Animaciones de Scroll (Scroll Reveal) */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bloques de enfoque en Servicios */
.enfoque-block {
  background-color: rgba(45, 106, 79, 0.05); /* Verde corporativo muy suave */
  border-left: 4px solid var(--color-trust);
  padding: 30px;
  border-radius: 0 12px 12px 0;
  margin: 40px 0;
}
.enfoque-block p {
  color: var(--color-text);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0;
}

/* Responsive */
@media (max-width: 992px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 2.2rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 30px;}
  
  .nav-menu {
    position: fixed;
    top: 90px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 90px);
    background-color: rgba(44, 44, 42, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: flex-start;
    padding: 40px 20px;
    margin: 0;
    transition: left 0.4s ease;
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
  }
  
  .menu-toggle span {
    width: 30px;
    height: 2px;
    background-color: #ffffff;
    transition: 0.3s;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 40px; }
  .footer-brand { align-items: center; }
  .social-icons { justify-content: center; }
  .footer-links { flex-direction: column; gap: 15px; }
}
