/* ============================================
   HEASA — Sitio corporativo estático
   Ingeniería eléctrica industrial · Puebla
   ============================================ */

:root {
  --navy: #1B2A4A;
  --accent: #F2C94C;
  --accent-hover: #e6bc3a;
  --white: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #e9ecef;
  --gray-200: #dee2e6;
  --text: #2d3748;
  --text-muted: #5a6578;
  --font-heading: "DM Sans", sans-serif;
  --font-body: "Source Sans 3", sans-serif;
  --shadow-sm: 0 1px 3px rgba(27, 42, 74, 0.08);
  --shadow-md: 0 4px 12px rgba(27, 42, 74, 0.1);
  --line: 1px solid var(--gray-200);
  --header-h: 72px;
}

html {
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}

/* ----- Header ----- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: var(--line);
  height: var(--header-h);
}
@media (max-width: 768px) {
  .site-header {
    height: auto;
    min-height: var(--header-h);
  }
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo-wrap {
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
}

.logo-img {
  display: block;
  height: 48px;
  width: auto;
  max-width: min(220px, 55vw);
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--navy);
}

.cta-header {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  color: var(--navy);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.cta-header:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* Hamburguesa: oculto en desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--navy);
  border-radius: 4px;
  transition: background 0.2s;
}
.nav-toggle:hover {
  background: rgba(27, 42, 74, 0.06);
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.site-header.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-header.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.site-header.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-panel {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* ----- Hero ----- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 3rem) 1.5rem 3rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--navy) url("assets/Gemini_Generated_Image_lvttvjlvttvjlvtt.png") center/cover no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 117, 152, 0.85);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  text-align: center;
}

.hero-legal {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 0.5rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.15;
  color: var(--white);
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
}

.hero-lead {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 2rem;
  line-height: 1.5;
}

.btn-hero {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  background: var(--accent);
  color: var(--navy);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-hero:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* ----- Section line (separador tipo cable/circuito) ----- */
.section-line {
  border: 0;
  height: 1px;
  background: var(--gray-200);
  margin: 0;
}

/* ----- Sections ----- */
.section {
  padding: 4.5rem 1.5rem;
  background: var(--white);
}

.section:nth-of-type(even) {
  background: var(--gray-50);
}

.container {
  max-width: 960px;
  margin: 0 auto;
}

.section h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  color: var(--navy);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
}

/* ----- About ----- */
.about-text {
  font-size: 1.05rem;
  line-height: 1.75;
}

.about-text p {
  margin: 0 0 1rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-blocks {
  display: grid;
  gap: 2rem;
  margin-top: 2.5rem;
}

.about-block h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
  margin: 0 0 0.5rem;
}

.about-block p {
  margin: 0;
  line-height: 1.7;
}

.clients-block {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: var(--line);
}

.clients-block h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
  margin: 0 0 0.5rem;
}

.clients-block p {
  margin: 0;
  line-height: 1.7;
}

/* ----- Certificaciones ----- */
.certs-intro {
  margin: 0 0 1.5rem;
  line-height: 1.7;
}

.certs-grid {
  display: grid;
  gap: 2rem;
  margin-top: 1rem;
}

.cert-block {
  background: var(--white);
  border: var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cert-block-inner {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 0;
  min-height: 0;
}

.cert-block-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  padding: 1rem;
}

.cert-block-img img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  display: block;
}

.cert-block-text {
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
}

.cert-block-text p {
  margin: 0;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .cert-block-inner {
    grid-template-columns: 1fr;
  }

  .cert-block-img {
    padding: 1.25rem;
  }

  .cert-block-img img {
    max-height: 180px;
  }

  .cert-block-text {
    padding: 1.25rem 1.5rem;
  }
}

/* ----- Servicios ----- */
.section-services {
  padding-bottom: 5rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
  margin-top: 2rem;
}

.service-card {
  background: var(--white);
  border: var(--line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.service-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.service-card-img {
  aspect-ratio: 16 / 10;
  background: var(--gray-100);
  overflow: hidden;
}

.service-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.service-card h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--navy);
  margin: 0;
  padding: 1rem 1.25rem 0.5rem;
  line-height: 1.35;
  flex: 1;
}

.btn-service {
  display: inline-block;
  margin: 0 1.25rem 1.25rem;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--navy);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-service:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* ----- Footer ----- */
.site-footer {
  padding: 2.5rem 1.5rem;
  background: #007598;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-legal {
  font-weight: 600;
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.footer-address {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.footer-contact,
.footer-tel {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.footer-copy {
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.65);
}

/* ----- WhatsApp flotante ----- */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: var(--white);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-float:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: nowrap;
    padding: 0.75rem 1rem;
    justify-content: space-between;
  }

  .logo-img {
    height: 40px;
    max-width: min(180px, 50vw);
  }

  .nav-toggle {
    display: flex;
    order: 2;
    margin-left: auto;
  }

  .nav-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 1rem 1rem;
    background: var(--white);
    border-bottom: var(--line);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0.2s ease, padding 0.2s ease;
  }

  .site-header.nav-open .nav-panel {
    max-height: 320px;
    opacity: 1;
    visibility: visible;
    padding: 0.75rem 1rem 1rem;
  }

  .nav-panel .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0 0;
  }

  .nav-panel .nav a {
    display: block;
    padding: 0.65rem 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(27, 42, 74, 0.08);
  }

  .nav-panel .nav a:last-of-type {
    border-bottom: none;
  }

  .nav-panel .cta-header {
    margin: 0.75rem 0 0;
    margin-left: 0;
    text-align: center;
    width: 100%;
  }

  .section {
    padding: 3rem 1rem;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

/* ----- Modal: Solicitar cotización ----- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal.modal-visible {
  opacity: 1;
  visibility: visible;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 42, 74, 0.6);
  cursor: pointer;
}
.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: auto;
}
.modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 12px 40px rgba(27, 42, 74, 0.2);
}
.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.modal-close:hover {
  color: var(--navy);
  background: rgba(0, 0, 0, 0.06);
}
.modal-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--navy);
}
.modal-text {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 0.95rem;
}
.modal-notice {
  margin: 0 0 1.25rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #007598;
  background: rgba(0, 117, 152, 0.1);
  border-left: 3px solid #007598;
  border-radius: 4px;
  line-height: 1.45;
}
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.btn-modal {
  display: block;
  text-align: center;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
.btn-modal-email {
  background: var(--navy);
  color: #fff;
  border: 2px solid var(--navy);
}
.btn-modal-email:hover {
  background: #0f1d33;
  color: #fff;
}
.btn-modal-whatsapp {
  background: #25d366;
  color: #fff;
  border: 2px solid #25d366;
}
.btn-modal-whatsapp:hover {
  background: #1da851;
  color: #fff;
}
