/* Ajustes de padding de enlaces para shrink */
.navbar .nav-link { padding: .55rem .5rem; }
header.shrink .navbar .nav-link { padding: .2rem .4rem; font-size: .86rem; }
/* Header reducido al hacer scroll */
header.shrink {
  padding: .15rem 0;
  box-shadow: 0 10px 26px rgba(0,0,0,.22);
  background: rgba(12, 92, 54, 0.48) !important;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
header.shrink .logo { transform: scale(.90); letter-spacing: 0.2px; }
header.shrink nav .nav-link { color: #f3f7ff; }

/* Back To Top */
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1100;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .35s ease, transform .35s ease, box-shadow .25s ease;
  box-shadow: 0 8px 22px rgba(11,91,211,.25);
}
.back-to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { box-shadow: 0 12px 28px rgba(11,91,211,.35); }
/* Tipografía y variables mejoradas */
:root {
  --primary: #0b5bd3;
  --secondary: #0a2342;
  --accent: #ff7a18;
  --accent-2: #ffb238;
  --light: #f4f7fb;
  --muted: #8a94a6;
  --text: #1b1f2a;
  --header-h: 80px;
}

/* Hover/resaltado suave y notorio en contenido */
.service-card:hover .service-icon,
.service-card:focus-within .service-icon {
  background: linear-gradient(135deg, rgba(11, 91, 211, .22), rgba(255, 122, 24, .22));
  box-shadow: inset 0 0 0 2px rgba(11,91,211,.22), 0 6px 18px rgba(11,91,211,.18);
  transform: translateY(-2px);
}

.service-card:hover h3,
.service-card:focus-within h3 { color: var(--primary); }

.service-card:hover p,
.service-card:focus-within p { color: #2a3342; }

html {
  scroll-behavior: auto; /* lo gestiona Lenis */
  scroll-padding-top: var(--header-h);
}

body {
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 10% -10%, rgba(11, 91, 211, 0.12), transparent 50%),
              radial-gradient(1200px 800px at 110% 10%, rgba(255, 122, 24, 0.12), transparent 50%),
              linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
}

/* Header: efecto vidrio y sticky */
header {
  /* Verde corporativo profundo con ligera transparencia */
  background: rgba(12, 92, 54, 0.88) !important; /* #0C5C36 */
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: white;
  padding: 1rem 0;
  position: fixed;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: padding .35s ease, background-color .35s ease, box-shadow .35s ease;
}

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

.logo {
  letter-spacing: 0.5px;
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  transition: transform .35s ease, letter-spacing .35s ease;
}

.logo span { color: var(--accent); }

/* Imagen de marca (navbar) y logo de footer */
.navbar-brand { padding: 0; margin-right: 1rem; display: flex; align-items: center; min-height: var(--header-h); }

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: 4px 8px;
  border-radius: 10px;
  background: #ffffff; /* uniforme con el fondo del logo */
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 3px 10px rgba(0,0,0,.08);
}

.brand-img {
  height: 34px;
  width: auto;
  display: block;
  transition: transform .35s ease, filter .35s ease, height .35s ease;
  background: #ffffff; /* asegura uniformidad si el PNG tiene leve halo */
}

header.shrink .navbar-brand { min-height: calc(var(--header-h) - 22px); }
header.shrink .brand-chip { padding: 2px 5px; border-radius: 8px; }
header.shrink .brand-img { transform: scale(.99); height: 24px; }

/* Hover sutil: nada intrusivo */
.navbar-brand:hover .brand-chip { box-shadow: 0 6px 16px rgba(0,0,0,.12); }

.footer-logo {
  max-height: 56px;
  width: auto;
  display: inline-block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.15));
}

/* El logo dentro del chip usa mezcla normal para mantener colores correctos */
.navbar-dark .brand-chip .brand-img { mix-blend-mode: normal; }

@media (max-width: 992px) {
  .brand-img { height: 26px; }
}

nav .nav-link {
  color: #eaf1ff;
  margin-left: 18px;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color .25s ease, padding .25s ease, font-size .25s ease;
}

nav .nav-link:after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

nav .nav-link:hover { color: #fff; }
nav .nav-link:hover:after { transform: scaleX(1); }

/* Hero: gradiente animado y mejor jerarquía */
.hero {
  position: relative;
  padding: 200px 20px 140px !important;
  background: radial-gradient(circle at 20% 10%, rgba(255, 122, 24, .25), transparent 40%),
              radial-gradient(circle at 80% 20%, rgba(11, 91, 211, .25), transparent 45%),
              linear-gradient(rgba(0,0,0,.6), rgba(0,0,0,.6)),
              url('https://images.unsplash.com/photo-1550751827-4bd374c3f58b?q=80&w=2070&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
}

.hero:after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(1200px 400px at 50% 110%, rgba(255,255,255,0.06), transparent 60%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2rem, 3.8vw, 3.2rem) !important;
  line-height: 1.15;
  letter-spacing: .2px;
  text-shadow: 0 6px 24px rgba(0,0,0,.35);
}

.hero p {
  font-size: clamp(1rem, 1.6vw, 1.2rem) !important;
  color: #e6eaf2;
  max-width: 800px;
  margin: 0 auto 2rem;
}

/* Variante de hero más compacta para páginas internas */
.sub-hero {
  padding: 140px 20px 90px !important;
}

/* Botón con gradiente y elevación (no sobreescribe Bootstrap .btn) */
.btn-gradient {
  /* Verde acorde al navbar */
  background: linear-gradient(135deg, #0c5c36, #16a34a) !important;
  border: none !important;
  box-shadow: 0 12px 24px rgba(12, 92, 54, .28), 0 2px 6px rgba(0,0,0,.1);
  display: inline-block;
  color: white;
  padding: 12px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(12, 92, 54, .34), 0 4px 10px rgba(0,0,0,.12);
}

/* Secciones: títulos y espaciado */
.section-title { text-align: center; margin-bottom: 50px; }
.section-title h2 {
  font-weight: 700;
  letter-spacing: .2px;
}

.section-title p {
  color: var(--muted);
}

/* Secciones base */
.services { padding: 80px 0; background-color: #f9f9f9; }
.brands { padding: 60px 0; background-color: white; }
.contact { padding: 80px 0; }

/* Tarjetas con glassmorphism y borde sutil */
.service-card {
  background: rgba(255,255,255,0.75) !important;
  border: 1px solid rgba(11, 91, 211, 0.08);
  box-shadow: 0 10px 30px rgba(11, 91, 211, 0.08), 0 2px 8px rgba(0,0,0,.04) !important;
  border-radius: 10px;
  padding: 30px;
  transition: transform .45s cubic-bezier(.22,.61,.36,1), box-shadow .45s ease, border-color .45s ease, background-color .45s ease;
  position: relative;
  overflow: hidden;
  will-change: transform, box-shadow;
}

/* Tarjeta de contenido reutilizable */
.content-card {
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(11, 91, 211, 0.08);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(11, 91, 211, 0.08), 0 2px 8px rgba(0,0,0,.04);
  padding: 24px;
}

.service-card::before {
  content: "";
  position: absolute; inset: 0;
  padding: 1px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(11,91,211,.35), rgba(255,122,24,.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .0; transition: opacity .35s ease;
  pointer-events: none;
}

.service-card:hover,
.service-card:focus-within {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 18px 44px rgba(11, 91, 211, 0.16), 0 6px 18px rgba(0,0,0,.08) !important;
}

.service-card:hover::before,
.service-card:focus-within::before { opacity: 1; }

.service-icon {
  background: linear-gradient(135deg, rgba(11, 91, 211, .12), rgba(255, 122, 24, .12));
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 14px;
  font-size: 2.5rem;
  margin-bottom: 20px;
  box-shadow: inset 0 0 0 1px rgba(11,91,211,.12);
  transition: transform .35s ease, box-shadow .35s ease, background .35s ease, color .35s ease;
}

.service-icon i { color: var(--primary); }

.service-card h3 { font-size: 1.5rem; margin-bottom: 15px; color: var(--secondary); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

/* Marcas: carrusel sutil (marquee-like) */
.brands-grid {
  display: block;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  position: relative;
}

.brands-grid img { opacity: .8; }

/* Pista interna animada para el carrusel */
.brands-track {
  display: inline-flex;
  align-items: center;
  gap: 48px;
  animation: scroll-brands var(--scroll-duration, 28s) linear infinite;
  will-change: transform;
  flex: 0 0 auto;
  min-width: max-content;
  white-space: nowrap;
}

/* Pausa al pasar el cursor */
.brands-grid:hover .brands-track { animation-play-state: paused; }

.brand-logo {
  max-width: 180px;
  height: 44px;
  width: auto;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: all 0.3s ease;
  flex: 0 0 auto;
}

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

/* Inline SVG wordmarks */
.brand-logo-svg {
  height: 44px;
  width: auto;
  display: inline-block;
  opacity: .7;
  filter: grayscale(100%);
  transition: all .25s ease;
}
.brand-logo-svg:hover { opacity: 1; filter: grayscale(0%); }

@keyframes scroll-brands {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.brands-grid {
  position: relative;
}

/* Duplicar el contenido visualmente mediante CSS para loop infinito */
.brands-grid::after {
  content: attr(data-duplicate);
  /* Placeholder, no contenido real; se usa técnica de duplicación con JS opcional. */
}

/* Contacto */
.contact {
  background: linear-gradient(180deg, #f7f9ff 0%, #eef3fb 100%) !important;
}

.contact-form input,
.contact-form textarea {
  border: 1px solid rgba(11, 91, 211, 0.18) !important;
  box-shadow: 0 2px 10px rgba(11, 91, 211, 0.06) inset;
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  font-family: 'Roboto', sans-serif;
}

/* Footer */
footer {
  background: linear-gradient(180deg, #0a2342 0%, #071a31 100%) !important;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-links a { opacity: .9; }
.footer-links a:hover { opacity: 1; color: #fff; }

.footer-links { margin: 20px 0; }
.footer-links a { color: white; margin: 0 10px; text-decoration: none; }

.social-links { margin: 20px 0; }
.social-links a { color: white; font-size: 1.5rem; margin: 0 10px; transition: color 0.3s ease; }
.social-links a:hover { color: var(--accent); }

/* Contacto layout */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.contact-info h3,
.contact-form h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--secondary);
}

.contact-item { display: flex; align-items: flex-start; margin-bottom: 20px; }
.contact-icon { font-size: 1.5rem; color: var(--accent); margin-right: 15px; margin-top: 5px; }
.contact-form textarea { min-height: 150px; resize: vertical; }

/* Footer base */
footer { color: white; padding: 30px 0; text-align: center; }

/* Responsive ajustes */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .services { padding-top: 60px !important; }
  .brands-grid { gap: 24px !important; }
}

/* Utilidades */
/* No sobrescribir .container de Bootstrap para compatibilidad WP/Bootstrap */

/* Sombras sutiles a la navegación y tarjetas en móvil */
@media (max-width: 768px) {
  header { box-shadow: 0 6px 24px rgba(0,0,0,.18) !important; }
  .services { padding-top: 60px !important; }
}

/* Animaciones y transiciones suaves */
/* Keyframes */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); filter: blur(2px); }
  to   { opacity: 1; transform: translateY(0);   filter: blur(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes floatY {
  0% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(2px);
  transition: opacity .6s ease, transform .6s ease, filter .6s ease;
  will-change: opacity, transform, filter;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Transiciones sutiles globales */
a, .btn, .service-card, .brand-logo {
  transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease, color .25s ease, filter .25s ease;
}

/* Flotación sutil del call-to-action */
.hero .btn-gradient { animation: floatY 10s ease-in-out infinite; }

/* Carrusel de marcas (loop simple) */
/* (Compat) Si existiera .brands-loop anterior, mantener comportamiento */
.brands-loop { display: inline-flex; gap: 48px; animation: scroll-brands var(--scroll-duration, 28s) linear infinite; will-change: transform; }
.brands-loop:hover { animation-play-state: paused; }

/* Badge de marca (cuando no se cuente con logo) */
.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.06);
  color: #223;
  font-weight: 600;
  letter-spacing: .2px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  white-space: nowrap;
  opacity: .8;
  transition: opacity .25s ease, transform .25s ease, filter .25s ease;
  flex: 0 0 auto;
}

.brand-badge:hover { opacity: 1; transform: translateY(-1px); }

/* Accesibilidad: respetar preferencia de reducir movimiento (sin detener por completo el carrusel de marcas) */
@media (prefers-reduced-motion: reduce) {
  .reveal, .hero .btn-gradient { animation: none !important; transition: none !important; }
  .brands-track { animation-duration: 40s; }
}
