/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Montserrat', system-ui, sans-serif;
  color: #666;
  background-color: #fff;
  line-height: 1.6;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== ACTIVE NAV INDICATOR ===== */
.main-nav li a.active-nav {
  position: relative;
}
.main-nav li a.active-nav::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: #C9A961;
}

/* ===== HEADER ===== */
#masthead {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: #0A1F3D;
  height: 72px;
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center;
  height: 100%; padding: 0 20px; gap: 15px;
}
.logo { flex-shrink: 0; }
.logo img { height: 40px; width: auto; }
.main-nav { flex: 1; display: flex; justify-content: flex-end; }
.main-nav ul {
  display: flex; align-items: center; list-style: none; gap: 0;
}
.main-nav li a {
  color: #fff; font-size: 13px; padding: 10px 10px;
  transition: color .3s; font-weight: 600; white-space: nowrap;
}
/* Header controls (dark mode + language) */
.header-controls {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: 5px;
}
.dark-mode-toggle {
  background: none; border: 1px solid rgba(255,255,255,.3); color: #fff;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  transition: all .3s;
}
.dark-mode-toggle:hover { border-color: #C9A961; color: #C9A961; }
.lang-toggle {
  display: flex; border: 1px solid rgba(255,255,255,.3); border-radius: 4px; overflow: hidden;
}
.lang-toggle button {
  background: none; border: none; color: rgba(255,255,255,.6);
  padding: 4px 8px; font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .3s;
}
.lang-toggle button.active {
  background: rgba(255,255,255,.15); color: #fff;
}
.lang-toggle button:hover { color: #C9A961; }
.main-nav li a:hover { color: #C9A961; }
.nav-btn-outline {
  background: #fff !important; color: #0A1F3D !important;
  padding: 6px 14px !important; border-radius: 6px;
  font-weight: 600 !important; margin-right: 8px;
}
.nav-btn-outline:hover { background: #e8e8e8 !important; }
.nav-btn-cta {
  background: #C9A961 !important; color: #fff !important;
  padding: 6px 14px !important; border-radius: 6px;
  font-weight: 600 !important; margin-left: 8px;
}
.nav-btn-cta:hover { background: #b8954a !important; }

/* Dropdown menus */
.has-dropdown { position: relative; }
.has-dropdown > a::after { content: ' \25BE'; font-size: 10px; }
.dropdown {
  visibility: hidden; opacity: 0; position: absolute; top: 100%; left: 0;
  background: #0A1F3D; min-width: 220px; padding: 8px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.3); border-radius: 0 0 4px 4px;
  z-index: 1001; flex-direction: column !important; display: flex;
  transition: opacity .15s ease, visibility .15s ease;
  pointer-events: none;
}
.dropdown li { width: 100%; }
.dropdown li a {
  display: block !important; padding: 10px 20px !important;
  font-size: 13px !important; white-space: nowrap;
}
.dropdown li a:hover { background: rgba(201, 169, 97,.15); color: #C9A961; }
.has-dropdown:hover > .dropdown { visibility: visible; opacity: 1; pointer-events: auto; }

.mobile-toggle { display: none; background: none; border: none; cursor: pointer; }
.mobile-toggle span {
  display: block; width: 25px; height: 3px; background: #fff;
  margin: 5px 0; transition: .3s;
}

/* ===== HERO SLIDER ===== */
.hero-slider {
  position: relative; width: 100%; height: 500px;
  margin-top: 72px; overflow: hidden;
}
.slide {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity .8s ease;
}
.slide.active { opacity: 1; }
.slide-bg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover; background-position: center;
}
.slide-content {
  position: absolute; left: 80px; top: 50%; transform: translateY(-50%);
  background: rgba(10, 31, 61,.75); padding: 40px 50px; max-width: 550px;
  color: #fff;
}
.slide-accent { width: 60px; height: 4px; background: #C9A961; margin-bottom: 15px; }
.slide-content h2 { font-size: 42px; font-weight: 700; margin-bottom: 15px; letter-spacing: 2px; }
.slide-content p { font-size: 16px; line-height: 1.6; margin-bottom: 20px; color: #ddd; }
.btn-cta {
  display: inline-block; background: #C9A961; color: #fff;
  padding: 12px 28px; font-size: 14px; font-weight: 600;
  border: none; border-radius: 6px; cursor: pointer;
  transition: background .3s, transform .3s, box-shadow .3s; letter-spacing: 1px;
}
.btn-cta:hover { background: #b8954a; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(201, 169, 97, 0.3); }
a:focus, button:focus { outline: none; }
a:focus-visible, button:focus-visible { outline: 2px solid #C9A961; outline-offset: 2px; }
.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.3); color: #fff; border: none;
  font-size: 28px; padding: 15px 18px; cursor: pointer;
  z-index: 10; transition: background .3s;
}
.slider-arrow:hover { background: rgba(0,0,0,.6); }
.slider-arrow.prev { left: 0; }
.slider-arrow.next { right: 0; }

/* ===== TRANSPORT BAR ===== */
.transport-bar { background: #f5f5f5; padding: 30px 0; }
.transport-grid {
  display: flex; justify-content: center;
  text-align: center; gap: 100px; flex-wrap: wrap;
}
.transport-item { min-width: 120px; transition: all 0.3s ease; }
.transport-item:hover { transform: scale(1.05); }
.transport-item:hover i { color: #C9A961; }
.transport-item i { font-size: 48px; color: #0A1F3D; margin-bottom: 10px; display: block; transition: color 0.3s ease; }
.transport-item span { font-size: 16px; color: #0A1F3D; font-weight: 600; }

/* ===== NOSOTROS ===== */
.nosotros { padding: 80px 0; }
.nosotros-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.section-accent { width: 60px; height: 4px; background: #C9A961; margin-bottom: 15px; }
.nosotros-text h2 {
  font-size: 36px; color: #0A1F3D; font-weight: 400;
  letter-spacing: 3px; margin-bottom: 20px;
}
.nosotros-text p { margin-bottom: 15px; font-size: 15px; }
.link-more {
  color: #666; font-weight: 400; font-size: 14px;
  text-transform: uppercase; letter-spacing: 1px;
  display: inline-flex; align-items: center; gap: 8px;
}
.link-more:hover { color: #C9A961; }
.link-more::after { content: '\2192'; }
.nosotros-image img { border-radius: 4px; width: 100%; transition: all 0.3s ease; }
.nosotros-image img:hover { transform: scale(1.02); }
.servicio-img img { transition: all 0.3s ease; }
.servicio-img img:hover { transform: scale(1.02); }

/* ===== FEATURES ===== */
.features { background: #f8f9fb; padding: 60px 0; }
.features-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 30px; text-align: center;
}
.feature-item { transition: all 0.3s ease; }
.feature-item:hover { transform: translateY(-4px); }
.feature-item img { width: 80px; height: 80px; margin: 0 auto 15px; }
.feature-item p { color: #0A1F3D; font-size: 16px; font-weight: 400; }

/* ===== STATS COUNTER ===== */
.stats-counter { background: #0A1F3D; padding: 70px 0; }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 30px; text-align: center;
}
.stat-number {
  font-size: 56px; font-weight: 700; color: #fff;
  line-height: 1; margin-bottom: 10px;
}
.stat-prefix { color: #C9A961; }
.stat-label { color: #a0b0c0; font-size: 16px; font-weight: 400; }

/* ===== ANIMATE ON SCROLL ===== */
[data-animate] {
  opacity: 0;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
[data-animate="fade-up"] {
  transform: translateY(30px);
}
[data-animate="fade-in"] {
  transform: none;
}
[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== SERVICIOS ===== */
.servicios { padding: 80px 0; background: #0A1F3D; }
.servicios .container { display: grid; grid-template-columns: 1fr 3fr; gap: 30px; align-items: start; }
.servicios-header { max-width: 100%; margin-bottom: 0; }
.servicios-header .section-accent { background: #C9A961; }
.servicios-header h2 {
  font-size: 36px; color: #fff; font-weight: 400;
  letter-spacing: 3px; margin-bottom: 15px;
}
.servicios-header p { font-size: 15px; color: rgba(255,255,255,.7); }
.servicios-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.servicio-card {
  background: #fff; border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.06); transition: transform .3s, box-shadow .3s, border-color .3s;
  border: 1px solid transparent;
}
.servicio-card:hover { transform: translateY(-6px); box-shadow: 0 12px 28px rgba(0,0,0,0.12); border-color: #C9A961; }
.servicio-img img { width: 100%; height: 180px; object-fit: cover; }
.servicio-body { padding: 25px; }
.servicio-body h3 { font-size: 18px; color: #0A1F3D; margin-bottom: 12px; font-weight: 700; }
.servicio-body p { font-size: 14px; margin-bottom: 15px; line-height: 1.6; color: #666; }
.servicio-body a { color: #0A1F3D; font-weight: 600; font-size: 14px; }
.servicio-body a:hover { color: #C9A961; }

/* ===== BANNER CTA ===== */
.banner-cta {
  position: relative; padding: 80px 0;
  background: linear-gradient(135deg, #2c3e6b 0%, #8a9ab5 50%, #b0bec5 100%);
  text-align: center; color: #fff;
}
.banner-overlay {
  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 100 100"><polygon points="0,100 50,60 100,100" fill="rgba(255,255,255,0.05)"/></svg>') center/cover;
}
.banner-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.banner-content h2 { font-size: 28px; font-weight: 700; margin-bottom: 15px; }
.banner-content p { font-size: 16px; margin-bottom: 25px; }

/* ===== NOTICIAS ===== */
.noticias { padding: 80px 0; background: #fff; }
.noticias h2 {
  font-size: 36px; color: #0A1F3D; font-weight: 400;
  letter-spacing: 3px; margin-bottom: 40px;
}
.noticias-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.noticia-card {
  border-radius: 8px; transition: all 0.3s ease;
}
.noticia-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.noticia-card h3 { font-size: 18px; color: #0A1F3D; font-weight: 700; margin-bottom: 12px; }
.noticia-card p { font-size: 14px; margin-bottom: 15px; line-height: 1.5; }
.noticia-card .date { display: block; font-size: 13px; color: #767676; margin-bottom: 10px; }
.noticia-card a { color: #0A1F3D; font-weight: 600; font-size: 13px; letter-spacing: 1px; }
.noticia-card a:hover { color: #C9A961; }

/* ===== CERTIFICACIONES ===== */
.certificaciones { padding: 80px 0; background: #f5f7fa; }
.certificaciones .section-accent { margin-bottom: 15px; }
.certificaciones h2 {
  font-size: 36px; color: #0A1F3D; font-weight: 400;
  letter-spacing: 3px; margin-bottom: 40px;
}
.cert-content { display: grid; grid-template-columns: 1fr 3fr; gap: 40px; align-items: start; }
.cert-logos { display: flex; gap: 15px; align-items: center; }
.cert-logos img { height: 100px; width: auto; }
.cert-text p { font-size: 15px; margin-bottom: 15px; }

/* ===== FOOTER ===== */
footer { background: #0A1F3D; color: #fff; padding: 60px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
.footer-logo { height: 50px; margin-bottom: 20px; }
.footer-about p { font-size: 14px; color: #aab; line-height: 1.6; }
.footer-col h4 { font-size: 14px; font-weight: 700; margin-bottom: 15px; letter-spacing: 1px; }
.footer-col p { font-size: 14px; color: #aab; margin-bottom: 5px; }
.footer-col i { margin-right: 8px; color: #C9A961; }
.social-links { display: flex; gap: 15px; }
.social-links a {
  color: #C9A961; font-size: 18px; transition: all .3s;
}
.social-links a:hover { transform: translateY(-3px); background: #C9A961; color: #fff; }
.footer-bottom {
  margin-top: 40px; padding: 20px 0;
  border-top: 2px solid #C9A961;
}
.footer-bottom p { font-size: 13px; color: #aab; }

/* ===== WHATSAPP BUTTON ===== */
.whatsapp-btn {
  position: fixed; bottom: 25px; right: 25px; z-index: 999;
  display: flex; align-items: center; gap: 10px;
  background: #25D366; color: #fff; padding: 12px 20px;
  border-radius: 50px; font-size: 15px; font-weight: 600;
  box-shadow: 0 4px 15px rgba(0,0,0,.2);
  transition: transform .3s;
}
.whatsapp-btn:hover { transform: scale(1.05); }
.whatsapp-btn i { font-size: 22px; }

/* ===== TESTIMONIOS CAROUSEL ===== */
.testimonios {
  padding: 80px 0;
  background: #f9f9f9;
  text-align: center;
}
.testimonios-title {
  font-size: 36px;
  color: #0A1F3D;
  font-weight: 400;
  letter-spacing: 3px;
  margin-bottom: 50px;
}
.testimonios-carousel {
  max-width: 750px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}
.testimonios-track {
  position: relative;
  min-height: 260px;
}
.testimonio-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}
.testimonio-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
}
.testimonio-quote-icon {
  font-size: 42px;
  color: #C9A961;
  margin-bottom: 20px;
  display: block;
}
.testimonio-text {
  font-size: 18px;
  font-style: italic;
  color: #555;
  line-height: 1.8;
  margin-bottom: 25px;
}
.testimonio-author {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.testimonio-name {
  font-size: 16px;
  font-weight: 700;
  color: #0A1F3D;
}
.testimonio-role {
  font-size: 14px;
  color: #666;
}
.testimonios-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}
.testimonios-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, border-color 0.3s;
}
.testimonios-dots .dot.active {
  background: #C9A961;
  border-color: #C9A961;
  box-shadow: 0 0 8px rgba(201, 169, 97, 0.4);
}
.testimonios-dots .dot:hover {
  border-color: #C9A961;
}

/* ===== SCREEN READER ONLY ===== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.sr-only:focus { position: fixed !important; top: 10px; left: 10px; z-index: 10000; background: #fff; color: #0A1F3D; padding: 10px 20px; font-size: 16px; text-decoration: none; border: 2px solid #C9A961; border-radius: 4px; clip: auto !important; width: auto !important; height: auto !important; overflow: visible !important; margin: 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1280px) {
  .main-nav li a { font-size: 12px; padding: 10px 7px; }
  .nav-btn-outline { padding: 5px 10px !important; font-size: 12px !important; }
  .nav-btn-cta { padding: 5px 12px !important; font-size: 12px !important; }
  .header-controls { gap: 5px; }
  .lang-toggle button { padding: 3px 6px; font-size: 10px; }
  .dark-mode-toggle { width: 28px; height: 28px; font-size: 12px; }
}
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .logo { flex-shrink: 1; min-width: 0; }
  .logo img { max-width: 100%; height: auto; max-height: 40px; }
  .header-controls { margin-left: auto; margin-right: 0; flex-shrink: 0; }
  .mobile-toggle { display: block; flex-shrink: 0; color: #fff; }
  .main-nav.active {
    display: block; position: absolute; top: 72px; left: 0; right: 0;
    background: #0A1F3D; padding: 20px; max-height: 80vh; overflow-y: auto;
  }
  .main-nav.active ul { flex-direction: column; gap: 5px; }
  .main-nav.active li a { display: block; padding: 12px 15px; }
  /* Mobile dropdown: hide by default, show on .active */
  .main-nav.active .dropdown {
    display: none !important; position: static !important;
    visibility: visible !important; opacity: 1 !important;
    pointer-events: auto !important; box-shadow: none;
    background: rgba(255,255,255,.05); min-width: auto;
    padding: 0; flex-direction: column !important;
  }
  .main-nav.active .has-dropdown.active .dropdown {
    display: flex !important;
  }
  .main-nav.active .dropdown li a {
    padding-left: 30px !important; font-size: 13px !important;
  }
  .main-nav.active .has-dropdown > a::after {
    float: right; transition: transform .3s;
  }
  .main-nav.active .has-dropdown.active > a::after {
    transform: rotate(180deg);
  }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nosotros-grid { grid-template-columns: 1fr; }
  .servicios .container { grid-template-columns: 1fr; }
  .servicios-cards { grid-template-columns: 1fr; }
  .cert-content { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .noticias-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .slide-content { left: 30px; padding: 30px; max-width: 90%; }
  /* Page hero responsive for subpages */
  .page-hero { padding: 45px 0; }
  .page-hero h1 { font-size: 34px; letter-spacing: 2px; }
}
@media (max-width: 640px) {
  .hero-slider { height: 350px; }
  .slide-content { left: 15px; right: 15px; max-width: calc(100% - 30px); padding: 25px; }
  .slide-content h2 { font-size: 24px; letter-spacing: 1px; }
  .slide-content p { font-size: 14px; margin-bottom: 15px; }
  .btn-cta { padding: 10px 20px; font-size: 13px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-number { font-size: 40px; }
  .stats-counter { padding: 50px 0; }
  .transport-grid { gap: 30px; }
  .transport-item i { font-size: 36px; }
  .transport-item span { font-size: 14px; }
  .features-grid { grid-template-columns: 1fr; }
  .noticias-grid { grid-template-columns: 1fr; }
  .servicios-cards { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cert-logos { flex-direction: column; align-items: center; }
  .nosotros-text h2 { font-size: 28px; }
  .servicios-header h2 { font-size: 28px; }
  .noticias h2 { font-size: 28px; }
  .certificaciones h2 { font-size: 28px; }
  .testimonios { padding: 50px 0; }
  .testimonios-title { font-size: 24px; letter-spacing: 1px; margin-bottom: 30px; }
  .testimonio-text { font-size: 15px; }
  .testimonios-carousel { max-width: 100%; }
  .banner-content h2 { font-size: 22px; }
  .banner-content p { font-size: 14px; }
  .banner-cta { padding: 50px 0; }
  .nosotros { padding: 50px 0; }
  .servicios { padding: 50px 0; }
  .noticias { padding: 50px 0; }
  .certificaciones { padding: 50px 0; }
  /* Page hero responsive for subpages */
  .page-hero { padding: 35px 0; }
  .page-hero h1 { font-size: 26px; letter-spacing: 1px; }
  /* WhatsApp button - text hidden on small screens */
  .whatsapp-btn span { display: none; }
  .whatsapp-btn { padding: 14px; border-radius: 50%; }
  .whatsapp-btn i { font-size: 24px; }
}

/* ===== PRINT STYLES ===== */
@media print {
  /* Hide non-essential elements */
  #masthead, .mobile-toggle, .whatsapp-btn, .dark-mode-toggle, .lang-toggle,
  .slider-arrow, .hero-slider, .transport-bar, .banner-cta, .testimonios,
  .footer-bottom, .social-links, .chatbot-widget, .chatbot-btn,
  .chatbot-panel, .chatbot-toggle, .chatbot-badge { display: none !important; }

  /* Reset backgrounds and colors for ink saving */
  body { color: #000 !important; background: #fff !important; font-size: 12pt; }
  footer { background: #fff !important; color: #000 !important; padding: 20px 0 !important; }
  .footer-col h4 { color: #000 !important; }
  .footer-col p, .footer-about p { color: #333 !important; }
  .stats-counter { background: #fff !important; }
  .stat-number { color: #0A1F3D !important; }
  .stat-label { color: #555 !important; }
  .servicios { background: #fff !important; }
  .servicios-header h2, .servicios-header p { color: #000 !important; }

  /* Ensure links are visible */
  a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  a[href^="#"]::after, a[href^="javascript"]::after { content: ""; }
  a[href^="mailto:"]::after, a[href^="tel:"]::after { content: ""; }
  nav a[href]::after { content: ""; }

  /* Page breaks */
  h2, h3 { page-break-after: avoid; }
  .servicio-card, .noticia-card, .team-card { page-break-inside: avoid; }

  /* Responsive grids become single column */
  .nosotros-grid, .features-grid, .servicios-cards, .noticias-grid,
  .footer-grid, .cert-content, .stats-grid, .contact-grid, .offices-map-layout {
    display: block !important;
  }

  /* Images */
  img { max-width: 100% !important; }
  .nosotros-image img, .servicio-img img { max-height: 200px; object-fit: contain; }

  /* Staff table */
  .staff-table { font-size: 10pt; }
  .staff-table thead th { background: #ddd !important; color: #000 !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
