/* ==========================================================================
   Zenit Ing - hoja de estilos

   1. Variables y base
   2. Componentes generales (botones, listas, títulos)
   3. Encabezado y navegación
   4. Portadas (inicio y páginas internas)
   5. Secciones del inicio
   6. Servicios
   7. Mantenimiento
   8. Obras
   9. Contacto
   10. Llamado a la acción y pie de página
   11. Responsive
   ========================================================================== */

/* 1. Variables y base
   ========================================================================== */

:root {
  --green-deep: #04331a;
  --green-dark: #0b5a2a;
  --sun: #f8a51b;
  --sun-light: #ffc933;
  --green: #1f7a24;
  --blue: #0a5a94;
  --ink: #16291d;
  --muted: #55665b;
  --sand: #f2f6ee;
  --line: #dde5d8;
  --white: #fff;
  --error: #b3261e;
  --whatsapp: #1e9e5a;

  --radius: 8px;
  --header-height: 84px;
  --font-title: Rubik, system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 17px/1.65 var(--font-body);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.55em;
  font-family: var(--font-title);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.01em;
}

h1 { font-size: 60px; font-weight: 700; }
h2 { font-size: 38px; }
h3 { font-size: 21px; }

p {
  margin: 0 0 1em;
}

a {
  color: inherit;
  text-decoration: none;
}

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

svg {
  flex: none;
  width: 1em;
  height: 1em;
}

:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 2px;
}

.container {
  width: min(1200px, 100% - 48px);
  margin-inline: auto;
}

.container--narrow {
  max-width: 780px;
}

/* 2. Componentes generales
   ========================================================================== */

.section {
  padding: 92px 0;
}

.section--sand {
  background: var(--sand);
}

.section--dark {
  padding: 92px 0;
  background: var(--green-deep);
  color: var(--white);
}

.section--dark p {
  color: #dcebdf;
}

.section--center {
  text-align: center;
}

.section--center .container--narrow {
  margin-bottom: 46px;
}

.section-title {
  margin-bottom: 44px;
  text-align: center;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 34px;
}

.section-head h2 {
  margin: 0;
}

.section-head a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font: 500 17px var(--font-title);
}

.lead {
  color: var(--muted);
  font-size: 19px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--sun-light);
  font: 600 14px var(--font-title);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eyebrow--dark {
  color: var(--green);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border: 0;
  border-radius: var(--radius);
  background: var(--sun);
  color: var(--green-deep);
  font: 600 17px var(--font-title);
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover {
  background: var(--sun-light);
}

.btn--ghost {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--white);
  color: var(--white);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn--outline {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--green-deep);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.photo {
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
}

.photo--tall {
  aspect-ratio: 4 / 5;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.split--start {
  align-items: start;
}

.checklist {
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 9px;
}

.checklist svg {
  margin-top: 3px;
  color: #e8920c;
  font-size: 22px;
  stroke-width: 2.4;
}

.section--dark .checklist svg {
  color: var(--sun-light);
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.card {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 0 0 1px var(--line);
}

.card img {
  height: 200px;
}

.card-body {
  padding: 20px 22px 8px;
}

.card p {
  color: var(--muted);
  font-size: 16px;
}

/* Foto con pie superpuesto: se usa en Obras recientes y en la grilla de Obras */
.project {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.project figcaption {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 44px 18px 15px;
  background: linear-gradient(transparent, rgba(4, 51, 26, 0.86));
  color: var(--white);
  font-size: 15px;
}

.project figcaption b {
  font: 500 17px var(--font-title);
}

.project figcaption span {
  color: var(--sun-light);
  white-space: nowrap;
}

/* Foto con aviso: .media envuelve la imagen para poder apoyar las notas encima */
.media {
  position: relative;
  display: block;
  overflow: hidden;
}

.media.photo {
  border-radius: var(--radius);
}

.card .media {
  height: 200px;
}

/* Aviso "Imagen ilustrativa": chico y discreto a propósito */
.img-note {
  position: absolute;
  right: 6px;
  bottom: 4px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.78);
  font: 400 9px/1.2 var(--font-body);
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.project .img-note {
  top: 5px;
  bottom: auto;
}

/* 3. Encabezado y navegación
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  overflow-x: clip;
  background: var(--green-deep);
  /* Separa el bloque blanco del logo cuando abajo hay una sección blanca */
  box-shadow: 0 2px 10px rgba(4, 51, 26, 0.18);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--header-height);
}

.logo {
  flex: none;
}

.logo img {
  width: auto;
  height: 52px;
}

/* El encabezado es verde y el logo tiene fondo blanco: va sobre un bloque
   blanco que llega al borde izquierdo de la pantalla y termina en diagonal */
.site-header .logo {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  align-self: stretch;
  padding-right: 46px;
}

.site-header .logo::before {
  content: "";
  position: absolute;
  inset: 0 0 0 -100vw;
  z-index: -1;
  background: var(--white);
  clip-path: polygon(0 0, 100% 0, calc(100% - 30px) 100%, 0 100%);
}

/* El logo tiene letras oscuras: sobre fondo oscuro va en una placa blanca */
.logo--light {
  display: inline-block;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--white);
}

.main-nav {
  display: flex;
  gap: 30px;
  margin-left: auto;
  color: var(--white);
  font: 500 16px var(--font-title);
}

.main-nav a {
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  border-color: var(--sun);
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 99px;
  background: var(--whatsapp);
  color: var(--white);
  font: 500 16px var(--font-title);
  white-space: nowrap;
}

.header-contacts {
  display: flex;
  gap: 8px;
}

.btn-whatsapp svg {
  font-size: 21px;
}

/* El botón del menú solo se muestra en pantallas chicas (ver Responsive) */
.nav-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--white);
  font-size: 30px;
  cursor: pointer;
}

.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--whatsapp);
  box-shadow: 0 6px 18px rgba(4, 51, 26, 0.3);
  color: var(--white);
  font-size: 32px;
}

/* 4. Portadas
   La imagen de fondo es un <img class="cover-image"> y el degradado va en
   ::before, así cada portada solo cambia la foto en el HTML.
   ========================================================================== */

.hero,
.page-hero,
.cta {
  position: relative;
  overflow: hidden;
  color: var(--white);
}

.hero::before,
.page-hero::before,
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(4, 51, 26, 0.96) 0%, rgba(4, 51, 26, 0.8) 50%, rgba(11, 90, 42, 0.32) 100%);
}

.cover-image {
  position: absolute;
  inset: 0;
}

.hero .container,
.page-hero .container,
.cta .container {
  position: relative;
  z-index: 2;
}

.hero {
  padding: 130px 0 140px;
}

.hero h1 {
  max-width: 680px;
}

.hero p {
  max-width: 540px;
  font-size: 20px;
}

.page-hero {
  padding: 92px 0;
}

.page-hero h1 {
  max-width: 700px;
  font-size: 50px;
}

.page-hero p {
  max-width: 520px;
  margin: 0;
  font-size: 19px;
}

/* 5. Secciones del inicio
   ========================================================================== */

.stats {
  padding: 36px 0;
  background: var(--green-deep);
  color: var(--white);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stats-grid b {
  display: block;
  color: var(--sun-light);
  font: 600 36px var(--font-title);
}

.stats-grid span {
  color: #cfe3d3;
  font-size: 16px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 16px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--green-dark);
  font: 500 16px var(--font-title);
}

.tile span {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--green-deep);
  color: var(--sun-light);
  font-size: 52px;
  transition: background 0.15s;
}

.tile:hover span {
  background: var(--green-dark);
}

.steps {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 0 0 22px 62px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sun);
  color: var(--green-deep);
  font: 600 19px var(--font-title);
}

.steps b {
  display: block;
  font: 600 19px var(--font-title);
}

.steps span {
  color: var(--muted);
}

/* 6. Servicios
   ========================================================================== */

.service-list {
  display: grid;
  gap: 80px;
}

.service {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.service--reverse .media {
  order: 2;
}

.service p {
  color: var(--muted);
}

.service-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  border-radius: 6px;
  background: var(--green-deep);
  color: var(--sun-light);
  font-size: 33px;
}

/* 7. Mantenimiento
   ========================================================================== */

.faq details {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.faq summary {
  font: 500 18px var(--font-title);
  cursor: pointer;
}

.faq details p {
  margin: 8px 0 0;
  color: var(--muted);
}

/* 8. Obras
   ========================================================================== */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.filter {
  padding: 8px 18px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: 500 15px var(--font-title);
  cursor: pointer;
}

.filter[aria-pressed="true"] {
  background: var(--green-deep);
  color: var(--white);
}

/* dense rellena los huecos que dejan las fotos grandes al filtrar */
.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 270px;
  grid-auto-flow: dense;
  gap: 20px;
}

.project--wide {
  grid-column: span 2;
}

.project--tall {
  grid-row: span 2;
}

.values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 26px;
}

.values b {
  display: block;
  color: var(--sun-light);
  font: 600 24px var(--font-title);
}

.values span {
  display: block;
  color: #cfe3d3;
  font-size: 15px;
  line-height: 1.4;
}

/* 9. Contacto
   ========================================================================== */

.contact-form {
  display: grid;
  gap: 18px;
}

.contact-form h2 {
  margin: 0;
}

.contact-form .btn {
  justify-self: start;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  display: grid;
  gap: 6px;
  font: 500 15px var(--font-title);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #c3cdbf;
  border-radius: 6px;
  background: var(--white);
  font: 400 16px var(--font-body);
}

.field [aria-invalid="true"] {
  border-color: var(--error);
}

.field-error {
  color: var(--error);
  font: 400 14px var(--font-body);
}

.field-help {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.field-help a {
  color: var(--blue);
  text-decoration: underline;
}

.form-status {
  margin: 0;
  color: var(--green);
  font-weight: 600;
}

.form-privacy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.form-privacy a {
  color: var(--blue);
  text-decoration: underline;
}

.contact-aside {
  display: grid;
  gap: 26px;
}

.contact-list {
  display: grid;
  gap: 15px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 14px;
}

.contact-list svg {
  color: var(--green);
  font-size: 26px;
}

.contact-list b {
  display: block;
  font: 600 16px var(--font-title);
}

/* 10. Llamado a la acción y pie de página
   ========================================================================== */

.cta {
  padding: 74px 0;
}

.cta .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 36px;
}

.cta h2 {
  margin-bottom: 0.3em;
}

.cta p {
  max-width: 600px;
  margin: 0;
}

.site-footer {
  padding: 60px 0 26px;
  background: var(--green-deep);
  color: #cfe3d3;
  font-size: 15px;
}

.site-footer h4 {
  color: var(--white);
  font-size: 16px;
}

.site-footer .logo {
  margin-bottom: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 36px;
}

.footer-legal {
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid #1f5a36;
  color: #a9c7b1;
  font-size: 14px;
}

.footer-legal a {
  color: inherit;
  text-decoration: underline;
}

.legal-text {
  max-width: 760px;
}

.legal-text h2 {
  margin: 1.6em 0 0.5em;
  font-size: 22px;
}

.legal-text a {
  color: var(--blue);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.legal-date {
  color: var(--muted);
}

.credits-note {
  max-width: 760px;
  margin: 0 auto 32px;
  color: var(--muted);
  text-align: center;
}

.credits-scroll {
  overflow-x: auto;
}

.credits-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 15px;
}

.credits-table th,
.credits-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.credits-table a {
  text-decoration: underline;
}

/* 11. Responsive
   ========================================================================== */

/* Pantallas medianas: los dos teléfonos necesitan más lugar en el encabezado */
@media (max-width: 1320px) {
  .header-bar {
    gap: 16px;
  }

  .main-nav {
    gap: 16px;
    font-size: 15px;
  }

  .btn-whatsapp {
    padding: 8px 12px;
    font-size: 14px;
  }
}

@media (max-width: 1080px) {
  .header-bar,
  .main-nav {
    gap: 12px;
  }

  .main-nav {
    font-size: 14px;
  }

  .btn-whatsapp {
    padding: 7px 10px;
    font-size: 13px;
  }
}

/* Tablet: el menú pasa a desplegable */
@media (max-width: 1000px) {
  .nav-toggle {
    display: grid;
  }

  .header-contacts {
    margin-left: auto;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 8px 24px 16px;
    background: var(--green-deep);
    box-shadow: 0 10px 20px rgba(4, 51, 26, 0.3);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    padding: 12px 0;
    border-bottom: 1px solid #1f5a36;
  }

  .main-nav a[aria-current="page"] {
    border-color: #1f5a36;
    color: var(--sun-light);
  }

  .tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cards,
  .projects,
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .split,
  .service {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .service--reverse .media {
    order: 0;
  }
}

/* Tablet angosta: los teléfonos se achican para entrar junto al logo */
@media (max-width: 720px) {
  .header-contacts {
    gap: 4px;
  }

  .btn-whatsapp {
    gap: 4px;
    padding: 6px 7px;
    font-size: 12px;
  }
}

/* Celular */
@media (max-width: 640px) {
  :root {
    --header-height: 68px;
  }

  body {
    font-size: 16px;
  }

  .container {
    width: calc(100% - 32px);
  }

  h1,
  .page-hero h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 29px;
  }

  .header-bar {
    gap: 8px;
  }

  .logo img {
    height: 40px;
  }

  .site-header .logo {
    padding-right: 32px;
  }

  /* En celular el número no entra: queda solo el ícono */
  .btn-whatsapp {
    padding: 9px;
    font-size: 0;
  }

  .btn-whatsapp + .btn-whatsapp {
    display: none;
  }

  /* El texto ocupa todo el ancho, así que el fondo se oscurece parejo */
  .hero::before,
  .page-hero::before,
  .cta::before {
    background: rgba(4, 51, 26, 0.68);
  }

  .hero {
    padding: 70px 0 76px;
  }

  .hero p,
  .page-hero p {
    font-size: 17px;
  }

  .page-hero {
    padding: 60px 0;
  }

  .section,
  .section--dark {
    padding: 60px 0;
  }

  .btn {
    padding: 14px 20px;
    font-size: 16px;
  }

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

  .stats-grid b {
    font-size: 27px;
  }

  .tiles {
    gap: 8px;
  }

  .tile {
    font-size: 11.5px;
  }

  .tile span {
    font-size: 34px;
  }

  .cards,
  .projects,
  .form-grid,
  .values,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .projects {
    grid-auto-rows: 230px;
  }

  .project--wide {
    grid-column: auto;
  }

  .project--tall {
    grid-row: auto;
  }

  .section-head {
    flex-direction: column;
    gap: 8px;
  }

  .cta .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .service-list {
    gap: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .tile span {
    transition: none;
  }
}
