:root {
  --color-primary: #434444;   /* Azul corporativo */
  --color-secondary: #f22828; /* Naranjo/acento */
  --color-dark: #222831;
  --color-light: #F1F3F5;
  --color-muted: #4b52b8;
  --color-white: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--color-light);
  color: var(--color-dark);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* TOP BAR */
.topbar {
  background: var(--color-dark);
  color: var(--color-white);
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.topbar span {
  margin-right: 1rem;
}

.topbar a {
  color: var(--color-secondary);
  font-weight: 600;
}

/* NAVBAR */
header {
  background: #E2E6EA;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  transition: transform 0.3s ease;
  will-change: transform;
}

header.header-hidden {
  transform: translateY(-100%);
}

.nav {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0.5rem 1.5rem 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  height: 95px;
  width: auto;
  object-fit: contain;
}

.logo > div:last-child {
  font-size: 1.15rem;
}

@media (max-width: 768px) {
  .logo-img {
    height: 70px;
  }
  .logo > div:last-child {
    font-size: 0.95rem;
  }
}

.nav-menu {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-size: 0.95rem;
}

.nav-menu a:not(.btn-primary) {
  position: relative;
  padding-bottom: 0.2rem;
  width: fit-content;
}

.nav-menu a:not(.btn-primary)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--color-secondary);
  transition: width 0.25s ease;
}

.nav-menu a:not(.btn-primary):hover::after {
  width: 0;
}

.nav-menu a.btn-primary::after {
  content: none;
  display: none;
}

.btn-primary {
  background: var(--color-secondary);
  color: var(--color-white);
  padding: 0.50rem 1rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary:hover {
  background: #e27e1b;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.16);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle span {
  width: 40px;
  height: 10px;
  background: var(--color-dark);
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  .nav-menu.mobile-open {
    display: flex;
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    background: #E2E6EA;
    width: 100%;
    padding: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  }
  .nav-toggle {
    display: flex;
  }
}

/* HERO CON YOUTUBE */
.hero {
  position: relative;
  background: #021b30;
  color: var(--color-white);
  overflow: hidden;
  padding: 3.5rem 1rem 3rem;
}

/* VIDEO BACKGROUND */
.hero-video-wrapper {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

.hero-video-wrapper video,
.hero-video-wrapper iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* OVERLAY */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(242,140,40,0.35), transparent 50%),
    linear-gradient(135deg, rgba(2,27,48,0.7), rgba(0,58,93,0.8));
  z-index: 2;
}

/* HERO INNER */
.hero-inner {
  position: relative;
  z-index: 3;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

/* TEXT */
.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: clamp(2rem, 3vw + 1rem, 3rem);
  margin-bottom: 1rem;
}

.hero-highlight {
  color: var(--color-secondary);
}

.hero-text {
  font-size: 0.98rem;
  max-width: 32rem;
  color: rgba(255,255,255,0.85);
  margin: 10px auto 1.5rem;
  text-align: center;
}

.btn-outline {
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.7);
  background: transparent;
  color: var(--color-white);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-outline:hover {
  background: var(--color-white);
  color: var(--color-primary);
}

.hero-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.hero-meta strong {
  display: block;
  font-size: 1.1rem;
  color: var(--color-white);
}

/* SECCIONES GENERALES */
.section {
  padding: 3rem 1rem;
  background: #F1F3F5;
}

.section.alt {
  background: #F1F3F5;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: 1.7rem;
  margin-bottom: 0.4rem;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--color-muted);
  max-width: 32rem;
  margin: 0.5rem auto 0;
}

/* GRID ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.about-text p {
  margin-bottom: 0.8rem;
  font-size: 0.96rem;
  color: #4a4a4a;
}

.about-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 1rem;
}

.about-item strong {
  display: block;
  font-size: 1.3rem;
  color: var(--color-primary);
}

.about-item span {
  font-size: 0.8rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.about-card {
  background: linear-gradient(135deg, var(--color-primary), #021b30);
  border-radius: 1rem;
  padding: 1.5rem;
  color: var(--color-white);
  box-shadow: 0 16px 30px rgba(0,0,0,0.15);
  font-size: 0.9rem;
}

.about-card h3 {
  margin-bottom: 0.6rem;
  font-size: 1rem;
}

.about-card ul {
  list-style: none;
  padding-left: 0;
}

.about-card li {
  margin-bottom: 0.4rem;
  padding-left: 1.1rem;
  position: relative;
}

.about-card li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-secondary);
}

/* NUESTROS ESPECIALISTAS */
.team-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid #eef2f5;
  text-align: center;
}

.team-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 2rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}

@media (max-width: 900px) and (min-width: 601px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}

.team-card {
  background: var(--color-white);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.team-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.team-thumb {
  width: 100%;
  height: 320px;
  overflow: hidden;
  background: #eaeaea;
}

.team-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.3s ease;
}

/* Enfoque desde más arriba para evitar cortes en los rostros y alinear alturas */
.team-card:nth-child(1) .team-thumb img {
  object-position: center 2%;
}

.team-card:nth-child(2) .team-thumb img {
  object-position: center 5%;
}

.team-card:nth-child(3) .team-thumb img {
  object-position: center 36%;
}

.team-card:hover .team-thumb img {
  transform: scale(1.03);
}

.team-body {
  padding: 1.2rem 1rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex-grow: 1;
}

.team-specialty {
  color: var(--color-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.35;
  margin-bottom: 0.55rem;
  min-height: 2.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0 0 0.3rem;
}

.team-role {
  font-size: 0.85rem;
  color: #666;
  margin: 0;
}

/* SERVICIOS GRID */
.services-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (min-width: 961px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 960px) and (min-width: 641px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

.service-card {
  background: var(--color-white);
  border-radius: 1rem;
  padding: 1.3rem;
  border: 1px solid #e5e5e5;
  box-shadow: 0 6px 16px rgba(0,0,0,0.04);
}

.service-tag {
  display: inline-block;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-secondary);
  margin-bottom: 0.5rem;
}

.service-card h3 {
  font-size: 1.02rem;
  margin-bottom: 0.4rem;
}

.service-card p {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 0.7rem;
}

.service-meta {
  font-size: 0.8rem;
  color: var(--color-dark);
  font-weight: 500;
}

/* PROJECTS GRID */
.projects-grid {
  display: grid;
  gap: 1.4rem;
  margin-top: 1rem;
}

@media (min-width: 961px) {
  .projects-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
  }

  /* Fila 1: Los dos primeros proyectos ocupan la primera fila (3 columnas de 6 cada uno = 50%) */
  .projects-grid .project-card:nth-child(1),
  .projects-grid .project-card:nth-child(2),
  .projects-grid .project-card.featured {
    grid-column: span 3;
  }

  .projects-grid .project-card:nth-child(1) .project-thumb,
  .projects-grid .project-card:nth-child(2) .project-thumb,
  .projects-grid .project-card.featured .project-thumb {
    height: 230px;
  }

  .projects-grid .project-card:nth-child(1) .project-body,
  .projects-grid .project-card:nth-child(2) .project-body,
  .projects-grid .project-card.featured .project-body {
    padding: 1.2rem 1.35rem 1.35rem;
  }

  .projects-grid .project-card:nth-child(1) .project-body .service-tag,
  .projects-grid .project-card:nth-child(2) .project-body .service-tag,
  .projects-grid .project-card.featured .project-body .service-tag {
    font-size: 1.18rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
  }

  .projects-grid .project-card:nth-child(1) .project-body p,
  .projects-grid .project-card:nth-child(2) .project-body p,
  .projects-grid .project-card.featured .project-body p {
    font-size: 0.94rem;
    line-height: 1.55;
    color: #444;
  }

  /* Fila 2: Los tres proyectos restantes en la segunda fila (2 columnas de 6 cada uno = 33.33%) */
  .projects-grid .project-card:nth-child(n+3):not(.featured) {
    grid-column: span 2;
  }
}

@media (max-width: 960px) and (min-width: 641px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.3rem;
  }

  .projects-grid .project-card:nth-child(1) .project-thumb,
  .projects-grid .project-card:nth-child(2) .project-thumb,
  .projects-grid .project-card.featured .project-thumb {
    height: 190px;
  }

  .projects-grid .project-card:nth-child(5):last-child {
    grid-column: span 2;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .projects-grid .project-card:nth-child(1) .project-thumb,
  .projects-grid .project-card:nth-child(2) .project-thumb,
  .projects-grid .project-card.featured .project-thumb {
    height: 190px;
  }
}

.project-card {
  cursor: pointer;
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid #e5e5e5;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 26px rgba(0,0,0,0.15);
}

.project-thumb {
  position: relative;
  width: 100%;
  height: 140px;
  background: #d7dee5;
  overflow: hidden;
  flex-shrink: 0;
}

.project-body {
  padding: 0.9rem 1rem 1.1rem;
  font-size: 0.9rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-body .service-tag {
  font-weight: 700;
  margin-bottom: 0.45rem;
  line-height: 1.35;
}

.project-body p {
  font-size: 0.86rem;
  color: #555;
  line-height: 1.45;
}

.project-tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 30px;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.galeria-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.project-card:hover .galeria-img {
  transform: scale(1.04);
}

.project-count-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(5, 9, 16, 0.78);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  letter-spacing: 0.2px;
}

/* CTA CONTACTO RÁPIDO */
.cta {
  background: linear-gradient(135deg, var(--color-primary), #021222);
  color: var(--color-white);
  border-radius: 1.5rem;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1.1fr;
  gap: 1.8rem;
  align-items: center;
  box-shadow: 0 18px 34px rgba(0,0,0,0.25);
}

@media (max-width: 900px) {
  .cta {
    grid-template-columns: 1fr;
  }
}

.cta h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.cta p {
  font-size: 0.95rem;
  max-width: 30rem;
  color: rgba(255,255,255,0.85);
}

.cta-contact {
  font-size: 0.9rem;
}

.cta-contact div {
  margin-bottom: 0.4rem;
}

.cta-contact span {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.7);
}

.cta-contact strong {
  font-size: 0.95rem;
}

.cta-contact a:hover {
  text-decoration: underline;
}

/* FOOTER */
footer {
  background: #050910;
  color: rgba(255,255,255,0.8);
  padding: 1.2rem 1rem;
  font-size: 0.8rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255,255,255,0.8);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--color-white);
  text-decoration: underline;
}

/* ESTRUCTURA DEL MODAL */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

/* CONTENEDOR E IMAGEN */
.modal-contenido {
  position: relative;
  max-width: 85%;
  max-height: 85vh;
  text-align: center;
}

.modal-contenido img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* BOTÓN CERRAR (X) */
.modal-cerrar {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #ffffff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  z-index: 10000;
}

.modal-cerrar:hover {
  color: #ff5555;
}

/* BOTONES FLECHAS */
.modal-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  font-size: 28px;
  padding: 12px 18px;
  cursor: pointer;
  border-radius: 50%;
  user-select: none;
  transition: background 0.2s, color 0.2s;
  z-index: 10000;
}

.modal-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  color: #000;
}

.modal-prev { left: 20px; }
.modal-next { right: 20px; }

/* CONTADOR DE FOTOS */
#modal-contador {
  color: #ffffff;
  margin-top: 10px;
  font-size: 14px;
}

/* CARRUSEL DE CLIENTES */
.clientes-wrapper {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 0 0.5rem 1.5rem;
}

.clientes-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #dcdfe3;
  background: var(--color-white);
  color: var(--color-dark);
  font-size: 1.15rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, color 0.2s ease;
  z-index: 10;
  user-select: none;
}

.clientes-btn:hover {
  background: var(--color-secondary);
  color: var(--color-white);
  border-color: var(--color-secondary);
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.clientes-btn:active {
  transform: scale(0.95);
}

.clientes-carousel {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 0.6rem 0.25rem;
}

.clientes-track {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  will-change: transform;
}

.cliente-item {
  flex: 0 0 calc((100% - 3 * 1.25rem) / 4);
  box-sizing: border-box;
  aspect-ratio: 1 / 1;
  height: auto;
  background: var(--color-white);
  border-radius: 14px;
  border: 1px solid #e5e5e5;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  user-select: none;
}

.cliente-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.09);
}

.cliente-item img {
  width: 100%;
  height: 100%;
  max-width: 82%;
  max-height: 82%;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  transition: transform 0.25s ease;
}

.cliente-item:hover img {
  transform: scale(1.05);
}

@media (max-width: 960px) and (min-width: 681px) {
  .cliente-item {
    flex: 0 0 calc((100% - 2 * 1.25rem) / 3);
    padding: 1.2rem;
  }
}

@media (max-width: 680px) and (min-width: 481px) {
  .cliente-item {
    flex: 0 0 calc((100% - 1.25rem) / 2);
    padding: 1.1rem;
  }
}

@media (max-width: 480px) {
  .cliente-item {
    flex: 0 0 100%;
    padding: 1.1rem;
  }
}