:root {
  /* Brand Colors */
  --primary: #004e92;
  /* Deep Blue - Trust/Tech */
  --primary-light: #3b82f6;
  /* Bright Blue */
  --secondary: #1b5e20;
  /* Forest Green - Nature */
  --secondary-light: #4ade80;
  /* Bright Green */
  --accent: #0ea5e9;
  /* Sky Blue */

  /* Neutrals */
  --bg-body: #f8fafc;
  --bg-white: #ffffff;
  --bg-dark: #0f172a;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #f1f5f9;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background: var(--bg-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

.section {
  padding: 80px 0;
  width: 100%;
  overflow-x: hidden;
}

.section-alt {
  background-color: var(--bg-white);
}

.text-center {
  text-align: center;
}

.text-white {
  color: var(--text-light);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  padding: 1rem 0;
  transition: all 0.3s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo img {
  height: 60px;
  width: auto;
  max-height: 60px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.nav-cta {
  background: var(--primary);
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-weight: 600;
}

.nav-cta:hover {
  background: var(--primary-light);
  color: white;
}

/* Mobile Menu Button */
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--primary);
}

/* Hero Section */
.hero {
  position: relative;
  padding: 160px 0 100px;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1e3a8a 100%);
  color: white;
  overflow: hidden;
  min-height: 60vh;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  z-index: 0;
}

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

/* Hero Tagline */
.hero-tagline {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary-light);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero h1 {
  color: white;
  margin-bottom: 1.5rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--secondary);
  color: white;
}

.btn-primary:hover {
  background: var(--secondary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Features Grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
  border-top: 4px solid var(--primary);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

/* Services Page */
.service-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  margin-bottom: 6rem;
}

.service-block.reverse {
  direction: rtl;
}

.service-block.reverse .service-content {
  direction: ltr;
}

.service-img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.service-list {
  list-style: none;
  margin-top: 1.5rem;
}

.service-list li {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  position: relative;
}

.service-list li::before {
  content: "✓";
  color: var(--secondary);
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* Industries */
.industry-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
}

.industry-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.industry-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.industry-content {
  padding: 2rem;
}

/* Projects */
.project-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--secondary);
}

.project-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.project-tag {
  background: var(--bg-body);
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-weight: 500;
}

/* Contact Form */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-input,
.form-textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 78, 146, 0.1);
}

/* Footer */
footer {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

footer h4 {
  color: white !important;
  margin-bottom: 1.5rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: #94a3b8;
}

.footer-links a:hover {
  color: white;
}

.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  color: #64748b;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.modal-box {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 400px;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Project Carousel Styles */
.carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  background: white;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-slide {
  min-width: 100%;
  display: flex;
  flex-direction: column;
  background: white;
}

.slide-image {
  width: 100%;
  height: 500px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.slide-video {
  width: 100%;
  height: 500px;
  position: relative;
  background: #000;
}

.slide-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.slide-content {
  padding: 2rem;
  background: white;
}

.slide-content h3 {
  margin: 0 0 1rem 0;
  color: var(--text-main);
  font-size: 1.75rem;
}

.slide-content p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.carousel-btn {
  position: absolute;
  top: 250px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.95);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.carousel-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
  left: 1rem;
}

.carousel-btn.next {
  right: 1rem;
}

.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: white;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  background: var(--primary);
  width: 32px;
  border-radius: 6px;
}

.indicator:hover {
  background: var(--secondary);
}

/* Client Carousel */
.clients-carousel-container {
  overflow: hidden;
  padding: 2rem 0;
  position: relative;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.clients-track {
  display: flex;
  flex-direction: row;
  gap: 3rem;
  width: max-content;
  align-items: center;
  will-change: transform;
  padding: 1rem 0;
}

.client-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  min-width: 120px;
}

.client-item>div,
.client-logo {
  height: 70px;
  width: auto;
  max-width: 150px;
  min-width: 80px;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.client-logo:hover {
  filter: grayscale(0%);
  opacity: 1;
}

/* Mejoras para móviles */
@media (max-width: 768px) {
  .clients-carousel-container {
    padding: 1.5rem 0;
  }
  
  .clients-track {
    gap: 2rem;
  }
  
  .client-item {
    min-width: 100px;
    padding: 0 0.5rem;
  }
  
  .client-item>div,
  .client-logo {
    height: 55px;
    max-width: 110px;
    min-width: 60px;
  }
}

/* Admin Dashboard Styles */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.admin-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.admin-item-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  background: white;
}

.admin-item-info {
  flex: 1;
}

.admin-item-title {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.admin-item-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.btn-delete {
  padding: 0.5rem 1rem;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-delete:hover {
  background: #b91c1c;
}

/* === HERO SLIDER DINÁMICO === */
.hero-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

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

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

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 58, 138, 0.85) 100%);
  z-index: 1;
}

/* ====================================================
   RESPONSIVE DESIGN
   ==================================================== */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
  .container {
    padding: 0 30px;
  }

  .service-block {
    gap: 3rem;
  }

  .grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* Tablets and below */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
    gap: 1rem;
  }

  .nav-links.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .service-block,
  .service-block.reverse,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    direction: ltr;
  }

  .service-block.reverse .service-content {
    direction: ltr;
  }

  .service-img {
    height: 300px;
  }

  .hero {
    padding: 120px 0 80px;
    text-align: center;
    min-height: 50vh;
  }

  .hero-content {
    margin: 0 auto;
  }

  .hero p {
    font-size: 1.1rem;
  }

  .hero-cta,
  .btn-group {
    justify-content: center;
  }

  .carousel-slide {
    display: block;
  }

  .slide-image,
  .slide-video {
    height: 300px;
  }

  .slide-content {
    padding: 1.5rem;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    top: 150px;
  }

  .carousel-btn.prev {
    left: 0.5rem;
  }

  .carousel-btn.next {
    right: 0.5rem;
  }

  .section {
    padding: 60px 0;
  }

  .grid-3 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Improved grid for industries on tablets */
  .grid-3[style*="minmax(400px"] {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile devices (576px and below) */
@media (max-width: 576px) {
  .container {
    padding: 0 15px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .hero {
    padding: 100px 0 60px;
    min-height: 40vh;
  }

  .hero p {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .section {
    padding: 40px 0;
  }

  .service-block {
    margin-bottom: 4rem;
  }

  .service-img {
    height: 250px;
  }

  .btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
  }

  .slide-content h3 {
    font-size: 1.5rem;
  }

  .logo img {
    height: 50px;
    max-height: 50px;
  }

  .navbar {
    padding: 0.75rem 0;
  }

  .industry-img {
    height: 180px;
  }

  .industry-content {
    padding: 1.5rem;
  }

  .contact-grid {
    gap: 2rem;
  }

  .form-input,
  .form-textarea,
  select {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Small mobile devices (480px and below) */
@media (max-width: 480px) {
  .hero {
    padding: 90px 0 50px;
  }

  .section {
    padding: 30px 0;
  }

  .carousel-btn {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .slide-image,
  .slide-video {
    height: 250px;
  }

  .clients-track {
    gap: 1.5rem;
  }

  .client-item {
    min-width: 90px;
    padding: 0 0.5rem;
  }

  .client-logo {
    height: 50px;
    max-width: 100px;
    min-width: 50px;
  }
}

/* Very small devices (375px and below) */
@media (max-width: 375px) {
  .container {
    padding: 0 10px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .hero {
    padding: 80px 0 40px;
  }

  .logo img {
    height: 45px;
    max-height: 45px;
  }

  .feature-card,
  .industry-content,
  .slide-content {
    padding: 1.25rem;
  }

  .clients-track {
    gap: 1rem;
  }

  .client-item {
    min-width: 70px;
    padding: 0 0.25rem;
  }

  .client-logo {
    height: 40px;
    max-width: 80px;
    min-width: 40px;
  }
}

/* Casos de Éxito */
.casos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.75rem;
}

.caso-card {
  background: white;
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  border-top: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.caso-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.caso-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.caso-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.caso-tag--forestal  { background: #dcfce7; color: #166534; }
.caso-tag--inmobiliario { background: #dbeafe; color: #1e40af; }
.caso-tag--infraestructura { background: #fef9c3; color: #854d0e; }
.caso-tag--servicio  { background: #f1f5f9; color: #475569; }

.caso-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
  margin: 0;
}

.caso-detalle {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.caso-detalle dt {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-top: 0.4rem;
}

.caso-detalle dd {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.55;
}

/* Landscape mode for mobile devices */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 100px 0 50px;
  }

  .service-img,
  .slide-image,
  .slide-video {
    height: 200px;
  }
}