/* IESPRO Website — base, animations & responsive layer
   The page markup keeps the design's inline styles for pixel fidelity;
   this file adds global resets, keyframes, focus/interaction states,
   the mobile navigation and responsive breakpoints. */

html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: #1a1a1a;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
a { color: #d32326; text-decoration: none; }
a:hover { color: #8b151a; }
img { max-width: 100%; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; }
}

/* Form field focus */
.cf-input:focus { border-color: #d32326 !important; }
.cf-input.cf-error { border-color: #d32326 !important; background: #fff6f6 !important; }

/* Keyboard focus visibility */
.service-card:focus-visible,
a:focus-visible,
button:focus-visible { outline: 2px solid #d32326; outline-offset: 3px; }

/* Mobile navigation toggle — hidden on desktop */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  line-height: 0;
}

/* ---------- Service detail modal ---------- */
.service-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #fff;
  overflow-y: auto;
  display: none;
}
.service-modal.open { display: block; animation: fadeUp 0.35s ease-out; }
body.modal-open { overflow: hidden; }

/* ============================================================
   RESPONSIVE
   Overrides use !important to win over the design's inline styles.
   ============================================================ */

/* Tablet / small desktop */
@media (max-width: 1024px) {
  .values-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; }
}

/* Tablet portrait */
@media (max-width: 900px) {
  .site-nav { padding: 0 20px !important; }
  .nav-toggle { display: inline-flex !important; }

  .nav-links {
    position: fixed !important;
    top: 72px; left: 0; right: 0;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
    padding: 12px 20px 20px !important;
    transform: translateY(-140%);
    transition: transform 0.3s ease;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 14px 4px !important; border-bottom: 1px solid #f2f2f2; }
  .nav-links a:last-child { border-bottom: none; text-align: center; margin-top: 8px; }

  .hero { padding: 110px 24px 90px !important; }
  .hero-grid { grid-template-columns: 1fr !important; gap: 48px !important; }
  .hero-visual { order: -1; }
  .hero-title { font-size: 40px !important; }
  .hero-stats-wrap { position: static !important; margin-top: 48px; padding: 24px 24px !important; }
  .hero-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 24px !important; }

  .section-pad { padding-left: 24px !important; padding-right: 24px !important; padding-top: 80px !important; padding-bottom: 80px !important; }
  .section-title { font-size: 34px !important; }

  .about-grid { grid-template-columns: 1fr !important; }
  .services-grid { grid-template-columns: 1fr 1fr !important; }
  .clientes-grid { grid-template-columns: 1fr !important; }
  .contact-grid { grid-template-columns: 1fr !important; gap: 48px !important; }
}

/* Phones */
@media (max-width: 560px) {
  .values-grid { grid-template-columns: 1fr 1fr !important; }
  .services-grid { grid-template-columns: 1fr !important; }
  .footer-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .footer-bottom { flex-direction: column !important; gap: 12px !important; text-align: center; }
  .hero-title { font-size: 32px !important; }
  .hero-cta { flex-direction: column !important; align-items: stretch !important; }
  .hero-cta a { justify-content: center; }
  .section-title { font-size: 28px !important; }
}
