/* ─── CNC Industrial — Shared Stylesheet ─── */

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

:root {
  /* Palette */
  --orange:       #0077FF;
  --orange-h:     #005fd4;
  --orange-light: #00A6D6;
  --orange-bg:    #EFF6FF;
  --orange-muted: #DBEAFE;

  --navy:         #0B1F33;
  --navy-2:       #162d4a;
  --navy-3:       #1e3f61;

  --gray-50:  #F4F6F8;
  --gray-100: #EAEFF4;
  --gray-200: #D1D9E2;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-700: #374151;
  --gray-900: #111827;

  --white: #ffffff;
  --text:  #111827;
  --muted: #6B7280;
  --border: #D1D9E2;

  --radius:    10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);

  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --max-w: 1160px;
}

html { scroll-behavior: smooth; overflow-x: hidden; overflow-x: clip; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; overflow-x: clip;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--orange); border-radius: 3px; }

/* ─── Layout ─── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; }

/* ─── Typography helpers ─── */
.label {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
  background: var(--orange-bg);
  border: 1px solid var(--orange-muted);
  border-radius: 99px;
  padding: 5px 14px;
  margin-bottom: 18px;
}

.h1 {
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--navy);
}
.h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--navy);
}
.h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
}
.lead {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--muted);
  max-width: 540px;
  margin-top: 14px;
}
.accent { color: var(--orange); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 13px 26px;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s, color 0.18s;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,119,255,0.28);
}
.btn-primary:hover {
  background: var(--orange-h);
  box-shadow: 0 8px 24px rgba(0,119,255,0.38);
}

.btn-cta {
  background: var(--orange-light);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,166,214,0.3);
}
.btn-cta:hover {
  background: #0090ba;
  box-shadow: 0 8px 24px rgba(0,166,214,0.4);
}

.btn-outline {
  background: transparent;
  color: var(--orange);
  border: 1.5px solid var(--orange);
}
.btn-outline:hover {
  background: var(--orange-bg);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  background: var(--gray-100);
  border-color: var(--gray-200);
}

.btn-white {
  background: #fff;
  color: var(--orange);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.btn-white:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.btn svg { width: 17px; height: 17px; fill: currentColor; flex-shrink: 0; }
.btn-lg { padding: 15px 32px; font-size: 1rem; }

/* ─── NAV ─── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: 68px;
  display: flex;
  align-items: center;
  background: #fff;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(11,31,51,0.08);
  transition: box-shadow 0.3s;
}
.nav.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,0.4); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-logo-mark {
  width: 36px; height: 36px;
  background: var(--orange);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.nav-logo-mark svg { width: 20px; height: 20px; fill: #fff; }
.nav-logo-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.nav-logo-name span { color: var(--orange-light); }
.nav-logo-img {
  height: 62px;
  width: auto;
  display: block;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  padding: 4px 8px;
}
.map-embed {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 32px;
  box-shadow: var(--shadow);
}
.map-embed iframe {
  display: block;
  width: 100%;
  border: 0;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}
.nav-menu a {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(11,31,51,0.65);
  padding: 7px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-menu a:hover { color: var(--navy); background: rgba(11,31,51,0.06); }
.nav-menu a.active { color: var(--orange-light); font-weight: 600; }
.nav-menu .nav-cta a {
  background: var(--orange-light);
  color: #fff;
  padding: 8px 18px;
}
.nav-menu .nav-cta a:hover { background: #0090ba; color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--navy); border-radius: 2px;
  transition: 0.3s;
}

/* Mobile nav drawer */
.nav-drawer {
  display: none;
  position: fixed;
  top: 68px; left: 0; right: 0;
  background: #fff;
  border-bottom: 1px solid rgba(11,31,51,0.08);
  padding: 16px 40px 28px;
  z-index: 199;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.nav-drawer a {
  display: block;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(11,31,51,0.8);
  padding: 12px 0;
  border-bottom: 1px solid rgba(11,31,51,0.08);
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer .btn { width: calc(100% + 52px); justify-content: center; margin: 16px -26px 0; padding: 13px 26px; border-bottom: none; }

/* ─── PAGE HERO (inner pages) ─── */
.page-hero {
  padding-top: 68px;
  background: var(--navy);
  color: #fff;
  padding-bottom: 0;
}
.page-hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 64px 24px 56px;
}
.page-hero .label { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.15); color: var(--orange-light); }
.page-hero .h1 { color: #fff; }
.page-hero .lead { color: rgba(255,255,255,0.65); }

.page-hero-wave {
  display: block;
  width: 100%;
  height: 48px;
  background: var(--white);
  clip-path: ellipse(55% 100% at 50% 100%);
}

/* Fondo fotográfico para encabezados y CTA: definir --bg-sm / --bg-md / --bg-lg en el elemento */
.page-hero.has-photo, .cta-dark.has-photo {
  position: relative;
  background-color: var(--navy);
  background-image: var(--bg-lg);
  background-size: cover;
  background-position: var(--bg-pos, center);
  background-repeat: no-repeat;
  isolation: isolate;
}
.page-hero.has-photo::before, .cta-dark.has-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to right, rgba(10,15,30,0.92) 0%, rgba(10,15,30,0.78) 45%, rgba(10,15,30,0.5) 100%);
}
div.cta-dark.has-photo::before { background: radial-gradient(ellipse 60% 75% at center, rgba(10,15,30,0.9) 0%, rgba(10,15,30,0.7) 60%, rgba(10,15,30,0.45) 100%); }
.page-hero-wave { position: relative; }
@media (max-width: 1024px) { .page-hero.has-photo, .cta-dark.has-photo { background-image: var(--bg-md); } }
@media (max-width: 640px) {
  .page-hero.has-photo, .cta-dark.has-photo { background-image: var(--bg-sm); }
  .page-hero.has-photo::before { background: rgba(10,15,30,0.8); }
}

/* ─── SECTION DIVIDERS ─── */
.section-alt { background: var(--gray-50); }
.section-dark {
  background: var(--navy);
  color: #fff;
}
.section-dark .h2 { color: #fff; }
.section-dark .lead { color: rgba(255,255,255,0.6); }

/* ─── CARDS ─── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--orange-muted);
}

.card-icon {
  width: 52px; height: 52px;
  background: var(--orange-bg);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.card-icon svg { width: 26px; height: 26px; fill: var(--orange); }

/* ─── STAT ITEMS ─── */
.stat-num {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--orange);
  letter-spacing: -0.04em;
  line-height: 1;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 500;
}

/* ─── DIVIDER ─── */
.divider {
  width: 48px; height: 3px;
  background: var(--orange);
  border-radius: 2px;
  margin: 20px 0;
}

/* ─── FORMS ─── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 7px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--gray-50);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--navy);
  font-family: var(--font);
  font-size: 0.94rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  appearance: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--gray-400); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--orange);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0,119,255,0.12);
}
.form-group textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }

/* ─── FOOTER ─── */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 64px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}
.footer-brand .nav-logo-name { color: #fff; }
.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.5);
  margin-top: 16px;
  max-width: 280px;
}
.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  margin-bottom: 18px;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a {
  text-decoration: none;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.5);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--orange-light); }
.footer-legal { display: inline-flex; gap: 18px; margin-left: 18px; }
.footer-legal a { color: rgba(255,255,255,0.55); text-decoration: none; }
.footer-legal a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.35);
}
.footer-iso {
  display: flex;
  align-items: center;
  gap: 8px;
}
.iso-pill {
  background: rgba(0,166,214,0.2);
  border: 1px solid rgba(0,166,214,0.4);
  color: var(--orange-light);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: #fff;
  border: 1px solid #d4edda;
  border-left: 4px solid #28a745;
  border-radius: 10px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #155724;
  box-shadow: var(--shadow-lg);
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), opacity 0.35s;
  z-index: 999;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg { width: 18px; height: 18px; fill: #28a745; flex-shrink: 0; }

/* ─── Fade-in animations ─── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ─── CTA DARK ─── */
.cta-dark {
  background: var(--navy);
  padding: 80px 0;
}
.cta-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  padding: 0 24px;
}
.cta-dark .h2 { color: #fff; }
.cta-dark .lead { color: rgba(255,255,255,0.55); margin: 14px auto 36px; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 640px) {
  .cta-actions { flex-direction: column; align-items: center; }
  .cta-actions .btn { width: 100%; max-width: 320px; justify-content: center; }
}

/* ─── Page-specific layout grids ─── */
.services-hdr {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: end;
  margin-bottom: 8px;
}
.services-hdr-cta {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}
.historia-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .services-hdr { grid-template-columns: 1fr; }
  .services-hdr-cta { justify-content: flex-start; }
  .historia-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 640px) {
  section { padding: 64px 0; }
  .nav-menu { display: none; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
  .footer-legal { display: flex; justify-content: center; margin: 8px 0 0; }
  .map-embed {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 100%;
  }
  .map-embed iframe { height: 300px; }
}
