/* =========================================
   VARIABLES GLOBALES
   ========================================= */
:root {
  --red: #a71930;
  --red-dark: #821227;
  --red-accent: #d92847;
  --red-soft: #e88898;
  --dark: #17191d;
  --dark-2: #202226;
  --dark-3: #26282c;
  --muted: #596068;
  --line: #e3e5e7;
  --soft: #f5f6f6;
}

/* =========================================
   RESET Y BASE
   ========================================= */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--dark);
  font-family: Arial, Helvetica, sans-serif;
  background: #fff;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { max-width: 100%; }
.container { width: min(1160px, calc(100% - 48px)); margin: auto; }

/* =========================================
   HEADER
   ========================================= */
header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
.brand { display: block; flex-shrink: 0; }
.brand img { display: block; width: 255px; height: auto; }
nav { display: flex; align-items: center; gap: 34px; }
nav a {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
nav a:hover, nav a:focus-visible { color: var(--red); }
.nav-contact { background: var(--red); color: #fff; padding: 13px 21px; }
.nav-contact:hover, .nav-contact:focus-visible { color: #fff; background: var(--red-dark); }
.menu-button {
  display: none;
  background: none;
  border: 0;
  padding: 10px;
  color: var(--dark);
}

/* =========================================
   TIPOGRAFÍA GLOBAL
   ========================================= */
h1, h2, h3, p { margin-top: 0; }
.section-label {
  font-size: 13px;
  letter-spacing: 0.16em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 18px;
}
.intro h2, .section-heading h2, .contact h2 {
  font: normal clamp(33px, 3.5vw, 49px) / 1.17 Georgia, serif;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}

/* =========================================
   HERO
   ========================================= */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 550px;
  display: flex;
  align-items: center;
  background: linear-gradient(110deg, #f7f7f7 0%, #f7f7f7 55%, #eceeef 55%, #f5f6f6 100%);
}
.hero::after {
  content: "";
  position: absolute;
  right: -8%;
  top: 0;
  width: 43%;
  height: 100%;
  background: var(--red);
  clip-path: polygon(33% 0, 100% 0, 100% 100%, 0 100%);
  opacity: 0.97;
}
.hero::before {
  content: "";
  position: absolute;
  right: 19%;
  top: 0;
  width: 8%;
  height: 100%;
  background: var(--dark-2);
  transform: skew(-25deg);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 90px 0 96px;
  max-width: 1160px;
}
.eyebrow {
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 13px;
}
.eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--red);
}
.hero h1 {
  font: normal clamp(42px, 5vw, 70px) / 1.08 Georgia, 'Times New Roman', serif;
  letter-spacing: -0.035em;
  max-width: 700px;
  margin: 25px 0 24px;
}
.hero h1 em { font-style: normal; color: var(--red); }
.hero p {
  font-size: 20px;
  color: #41464b;
  max-width: 550px;
  margin-bottom: 34px;
}
.button {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  background: var(--red);
  color: #fff;
  padding: 16px 22px;
  font-size: 14px;
  font-weight: 700;
}
.button:hover, .button:focus-visible { background: var(--red-dark); }
.button span { font-size: 20px; font-weight: 400; line-height: 1; }

/* =========================================
   SECCIÓN EMPRESA
   ========================================= */
.intro { padding: 86px 0; }
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10%;
  align-items: start;
}
.intro p { color: var(--muted); font-size: 17px; }
.stat {
  display: flex;
  gap: 25px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 26px;
  margin-top: 20px;
}
.stat strong {
  font: normal 70px / 1 Georgia, serif;
  color: var(--red);
  letter-spacing: -0.07em;
}
.stat span {
  font-size: 16px;
  font-weight: 700;
  max-width: 170px;
  line-height: 1.3;
}

/* =========================================
   SECCIÓN SERVICIOS
   ========================================= */
.service { background: var(--dark); color: #fff; padding: 88px 0; }
.service-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8%;
  align-items: center;
}
.service .section-label { color: var(--red-soft); }
.service h2 {
  font: normal clamp(35px, 3.7vw, 52px) / 1.13 Georgia, serif;
  letter-spacing: -0.025em;
  margin: 0;
}
.service-card {
  border-left: 4px solid var(--red-accent);
  background: var(--dark-3);
  padding: 36px 40px;
}
.service-card .number {
  color: #d77e8d;
  font-size: 14px;
  letter-spacing: 0.16em;
  font-weight: 800;
}
.service-card h3 {
  font: normal 28px / 1.2 Georgia, serif;
  margin: 15px 0;
}
.service-card p { color: #d0d2d5; font-size: 17px; margin: 0; }

/* =========================================
   SECCIÓN CERTIFICACIONES
   ========================================= */
.certs { padding: 88px 0 100px; }
.section-heading { max-width: 700px; }
.section-heading p { font-size: 17px; color: var(--muted); }

.cert-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.cert-card {
  border: 1px solid var(--line);
  padding: 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 245px;
}
.cert-photo {
  height: 120px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.cert-photo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}
.cert-card h3 {
  font: normal 20px / 1.3 Georgia, serif;
  margin: 0;
}

/* Fila del sello SAE */
.sae-row {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  padding: 21px 27px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.cert-photo--sae {
  width: 72px;
  height: 72px;
}
.sae-row h3 {
  font: normal 22px Georgia, serif;
  margin: 0;
}

.cert-note { color: var(--muted); font-size: 16px; margin: 25px 0 0; }
.text-link {
  color: var(--red);
  font-size: 14px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.text-link:hover { text-decoration: underline; }

/* =========================================
   SECCIÓN MEDIOAMBIENTE
   ========================================= */
.environment { padding: 88px 0; background: #fff; }
.env-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.env-card {
  background: var(--soft);
  border-top: 3px solid var(--red);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.25s ease, background 0.25s ease;
}
.env-card:hover {
  transform: translateY(-4px);
  background: #eef0f1;
}
.env-card .number {
  color: var(--red);
  font-size: 12px;
  letter-spacing: 0.16em;
  font-weight: 800;
}
.env-card h3 {
  font: normal 22px / 1.25 Georgia, serif;
  margin: 4px 0 6px;
  color: var(--dark);
}
.env-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}
.env-note {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* =========================================
   SECCIÓN CONTACTO
   ========================================= */
.contact { background: #f3f4f4; padding: 76px 0; }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9%;
  align-items: start;
}
.contact p { font-size: 17px; color: var(--muted); }
.details { border-top: 1px solid #d7dadd; }
.detail {
  padding: 18px 0;
  border-bottom: 1px solid #d7dadd;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 15px;
}
.detail b {
  font-size: 13px;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.detail a { text-decoration: underline; text-underline-offset: 3px; }

/* =========================================
   FOOTER
   ========================================= */
footer {
  background: #fff;
  padding: 27px 0;
  color: #646970;
  font-size: 13px;
}
.footer-inner { display: flex; justify-content: space-between; gap: 20px; }
.footer-inner strong { color: var(--dark); }

/* =========================================
   RESPONSIVE — TABLET (≤800px)
   ========================================= */
@media (max-width: 800px) {
  .header-inner { min-height: 88px; }
  .brand img { width: 205px; }
  .menu-button { display: block; }
  nav {
    display: none;
    position: absolute;
    top: 88px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 22px 24px 28px;
    box-shadow: 0 16px 25px #0002;
    flex-direction: column;
    align-items: stretch;
    gap: 19px;
  }
  nav.open { display: flex; }
  .nav-contact { text-align: center; }
  .hero { min-height: auto; }
  .hero::after { width: 28%; right: -16%; opacity: 0.9; }
  .hero::before { display: none; }
  .hero-content { padding: 88px 0; }
  .hero h1 { max-width: 650px; }
  .hero p { max-width: 500px; }
  .intro-grid, .service-grid, .contact-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .intro, .service, .certs, .environment { padding: 67px 0; }
  .cert-grid { grid-template-columns: 1fr 1fr; }
  .env-grid { grid-template-columns: 1fr 1fr; }
  .contact { padding: 65px 0; }
}

/* =========================================
   RESPONSIVE — MÓVIL (≤520px)
   ========================================= */
@media (max-width: 520px) {
  .container { width: min(100% - 36px, 1160px); }
  .hero { background: #f6f6f6; }
  .hero::after {
    width: 100%;
    height: 7px;
    right: 0;
    top: auto;
    bottom: 0;
    clip-path: none;
  }
  .hero-content { padding: 70px 0 76px; }
  .hero h1 { font-size: 42px; }
  .hero p { font-size: 17px; }
  .stat strong { font-size: 58px; }
  .service-card { padding: 28px; }
  .cert-grid { grid-template-columns: 1fr; }
  .cert-card { min-height: 225px; padding: 22px; }
  .env-grid { grid-template-columns: 1fr; }
  .env-card { padding: 26px 24px; }
  .footer-inner { display: block; }
  .footer-inner span { display: block; margin-top: 7px; }
  .detail { grid-template-columns: 1fr; gap: 4px; }
}

/* =========================================
   ACCESIBILIDAD — REDUCED MOTION
   ========================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .env-card { transition: none; }
}