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

:root {
  --blue:       #1A4A8A;
  --blue-light: #2562b8;
  --navy:       #0d1f3c;
  --navy-soft:  #122a4d;
  --steel:      #8faec8;
  --offwhite:   #f2f5f8;
  --white:      #ffffff;
  --text-dim:   #b0c4d8;
  --placeholder: #ffb020;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Barlow', sans-serif;
  background-color: var(--navy);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    -55deg,
    transparent,
    transparent 60px,
    rgba(26, 74, 138, 0.07) 60px,
    rgba(26, 74, 138, 0.07) 61px
  );
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: -120px;
  right: -120px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(37, 98, 184, 0.28) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── PLACEHOLDER HIGHLIGHT ── */
.placeholder {
  color: var(--placeholder);
  border: 1px dashed var(--placeholder);
  border-radius: 4px;
  padding: 1px 6px;
  font-style: italic;
  background: rgba(255, 176, 32, 0.08);
}

/* ── HEADER / NAV ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 31, 60, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(37, 98, 184, 0.25);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1080px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-brand img {
  height: 40px;
  width: auto;
}

.nav-brand-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.14em;
  color: var(--white);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(37, 98, 184, 0.45);
  border-radius: 6px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  position: relative;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 9px;
  right: 9px;
  height: 2px;
  background: var(--white);
  transition: transform 0.2s;
}

.nav-toggle span { top: 20px; }
.nav-toggle span::before { top: -8px; }
.nav-toggle span::after { top: 8px; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--steel);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--white); }

@media (max-width: 800px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    /* Column + wrap + max-height:0 would spill items into sideways columns. */
    flex-wrap: nowrap;
    gap: 0;
    background: var(--navy-soft);
    border-bottom: 1px solid rgba(37, 98, 184, 0.25);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.open { max-height: 640px; }
  .nav-links li { border-top: 1px solid rgba(37, 98, 184, 0.15); }
  .nav-links a { display: block; padding: 14px 24px; font-size: 0.92rem; }
}

/* ── HERO ── */
.hero {
  position: relative;
  z-index: 1;
  padding: 90px 0 70px;
  text-align: center;
}

.hero .brand-logo {
  max-height: 130px;
  max-width: 260px;
  margin-bottom: 14px;
}

.brand-rif {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--steel);
  letter-spacing: 0.1em;
  opacity: 0.75;
  margin-bottom: 20px;
}

.divider {
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-light), var(--steel));
  border-radius: 2px;
  margin: 0 auto 32px;
}

.headline {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.05;
  color: var(--white);
  margin-bottom: 14px;
}

.headline span { color: var(--blue-light); }

.subhead {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  font-weight: 500;
  color: var(--steel);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.body-text {
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  font-weight: 400;
  line-height: 1.75;
  color: var(--text-dim);
  max-width: 680px;
  margin: 0 auto;
}

.btn {
  display: inline-block;
  margin-top: 36px;
  padding: 14px 32px;
  border-radius: 8px;
  background: var(--blue-light);
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.2s;
}

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

/* ── SECTIONS ── */
.section {
  position: relative;
  z-index: 1;
  padding: 70px 0;
  border-top: 1px solid rgba(37, 98, 184, 0.18);
}

.section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: var(--white);
  margin-bottom: 10px;
}

.section-kicker {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 18px;
}

.section-lead {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 48px;
  color: var(--text-dim);
  line-height: 1.7;
}

.section-lead a {
  color: var(--blue-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.section-lead a:hover { color: var(--white); }

/* ── Nosotros: mission/vision cards ── */
.mv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(37, 98, 184, 0.3);
  border-radius: 12px;
  padding: 32px 28px;
}

.card h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 14px;
}

.card p { color: var(--text-dim); line-height: 1.7; font-size: 0.95rem; }

.values-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.values-list li {
  background: rgba(37,98,184,0.1);
  border: 1px solid rgba(37,98,184,0.25);
  border-radius: 10px;
  padding: 18px 20px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--offwhite);
  text-align: center;
}

/* ── Clients ── */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.client-card {
  background: var(--white);
  border-radius: 10px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  border: 1px solid rgba(37,98,184,0.2);
}

.client-card img {
  display: block;
  max-width: 100%;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ── History timeline ── */
.timeline {
  position: relative;
  max-width: 760px;
  margin: 40px auto 0;
  padding-left: 28px;
  border-left: 2px solid rgba(37, 98, 184, 0.35);
}

.timeline-item { position: relative; padding-bottom: 36px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -34px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue-light);
  border: 2px solid var(--navy);
}

.timeline-year {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--blue-light);
  margin-bottom: 6px;
}

.timeline-item p { color: var(--text-dim); line-height: 1.7; }

/* ── Our Work / gallery ── */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin-top: 40px;
}

.work-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(37,98,184,0.3);
  border-radius: 12px;
  overflow: hidden;
}

.work-card .work-img {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, rgba(37,98,184,0.25), rgba(13,31,60,0.6));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--steel);
  font-size: 0.85rem;
  text-align: center;
  padding: 12px;
  overflow: hidden;
}

/* Images fill the 4:3 frame by cropping, never by stretching. */
.work-card .work-img:has(img) { padding: 0; }

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

.work-card .work-body { padding: 18px 20px; }
.work-card h3 { font-size: 1rem; margin-bottom: 6px; color: var(--white); }
.work-card p { font-size: 0.88rem; color: var(--text-dim); line-height: 1.6; }

/* ── Contact ── */
.contact-card {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  border: 1px solid rgba(37, 98, 184, 0.35);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(8px);
  padding: 36px 40px;
}

.contact-card h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 24px;
}

.contact-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.97rem;
  color: var(--offwhite);
}

.contact-list li .icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  fill: var(--blue-light);
  margin-top: 1px;
}

.contact-list a { color: var(--blue-light); text-decoration: none; transition: color 0.2s; word-break: break-word; }
.contact-list a:hover { color: var(--white); }

.social-wrap { display: flex; justify-content: center; gap: 20px; margin-top: 32px; }

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(37,98,184,0.45);
  background: rgba(37,98,184,0.12);
  color: var(--steel);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.social-link:hover {
  background: var(--blue-light);
  border-color: var(--blue-light);
  color: var(--white);
  transform: translateY(-3px);
}

.social-link svg { width: 18px; height: 18px; fill: currentColor; }

/* ── Footer ── */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 32px 0;
  text-align: center;
  border-top: 1px solid rgba(37, 98, 184, 0.18);
}

.footer-note {
  font-size: 0.78rem;
  color: rgba(176,196,216,0.55);
  letter-spacing: 0.04em;
}

@media (max-width: 480px) {
  .contact-card { padding: 28px 24px; }
  .card { padding: 26px 22px; }
}


/* ══════════════ GRUPO ENRIVA ══════════════ */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.group-card h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 4px;
}

.group-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 10px;
}

.group-place {
  font-size: 0.9rem;
  color: var(--steel);
  margin-bottom: 20px;
}

.tick-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.tick-list li {
  position: relative;
  padding-left: 22px;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.tick-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--blue-light);
}

/* ══════════════ SERVICIOS ══════════════ */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.service-card { padding: 26px 24px; }

.service-card h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(37, 98, 184, 0.3);
}

/* ══════════════ CAPACIDADES TÉCNICAS ══════════════ */
/* Tables may exceed the container; they scroll inside their own wrapper. */
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(37, 98, 184, 0.3);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  -webkit-overflow-scrolling: touch;
}

.spec-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.spec-table th,
.spec-table td {
  text-align: left;
  vertical-align: top;
  padding: 16px 18px;
  line-height: 1.55;
  border-bottom: 1px solid rgba(37, 98, 184, 0.18);
}

.spec-table thead th {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-light);
  background: rgba(37, 98, 184, 0.14);
  white-space: nowrap;
}

.spec-table tbody th {
  font-weight: 600;
  color: var(--white);
}

.spec-table tbody td { color: var(--text-dim); }
.spec-table tbody tr:last-child th,
.spec-table tbody tr:last-child td { border-bottom: 0; }
.spec-table tbody tr:hover th,
.spec-table tbody tr:hover td { background: rgba(37, 98, 184, 0.07); }

/* ══════════════ PRODUCTOS / MARCAS ══════════════ */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.brand-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(37, 98, 184, 0.3);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand-logo-wrap {
  background: var(--white);
  border-radius: 8px;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.brand-logo-wrap img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* A square logo with its own baked-in background reads better filling the box. */
.brand-logo-wrap--square { padding: 0; overflow: hidden; }
.brand-logo-wrap--square img { height: 100%; width: auto; max-width: none; }

.brand-logo-wrap--text { background: rgba(37, 98, 184, 0.16); }

.brand-wordmark {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--steel);
}

.brand-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}

.brand-card p {
  font-size: 0.89rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin-top: -4px;
}

.consumables-card { margin-top: 24px; }

/* ══════════════ INDUSTRIAS ══════════════ */
.industry-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.industry-list li {
  background: rgba(37, 98, 184, 0.1);
  border: 1px solid rgba(37, 98, 184, 0.28);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--offwhite);
}

/* ══════════════ TESTIMONIOS ══════════════ */
.testimonial {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}

.testimonial-quote {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(37, 98, 184, 0.3);
  border-left: 3px solid var(--blue-light);
  border-radius: 12px;
  padding: 30px 32px;
}

.testimonial-quote p {
  color: var(--offwhite);
  line-height: 1.75;
  font-size: 0.97rem;
  margin-bottom: 16px;
}

.testimonial-attr {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(37, 98, 184, 0.25);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.6;
}

.testimonial-attr span { font-weight: 400; color: var(--steel); }

.testimonial-doc figcaption {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--steel);
  text-align: center;
}

.testimonial-doc a {
  display: block;
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(37, 98, 184, 0.3);
  transition: transform 0.2s, border-color 0.2s;
}

.testimonial-doc a:hover {
  transform: translateY(-3px);
  border-color: var(--blue-light);
}

/* The letter is a portrait scan; show it whole, never cropped or stretched. */
.testimonial-doc img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 738 / 1014;
  object-fit: contain;
}

@media (max-width: 760px) {
  .testimonial { grid-template-columns: 1fr; }
  .testimonial-doc { max-width: 340px; margin: 0 auto; }
}

/* ══════════════ GALERÍA ══════════════ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.gallery-item {
  position: relative;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(37, 98, 184, 0.3);
  background: rgba(13, 31, 60, 0.6);
  cursor: zoom-in;
  transition: transform 0.2s, border-color 0.2s;
}

.gallery-item:hover,
.gallery-item:focus-visible {
  transform: translateY(-3px);
  border-color: var(--blue-light);
  outline: none;
}

/* Every tile is a 4:3 frame; images crop to fill it rather than distort. */
.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  object-fit: cover;
  object-position: center;
}

.gallery-item figcaption {
  padding: 12px 14px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-dim);
}

/* ══════════════ LIGHTBOX ══════════════ */
/* The flex display below would otherwise defeat the `hidden` attribute. */
.lightbox[hidden] { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 15, 30, 0.94);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
}

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Bounded by both axes so the image scales down without ever stretching. */
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-caption {
  font-size: 0.9rem;
  color: var(--offwhite);
  text-align: center;
  max-width: 640px;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(37, 98, 184, 0.18);
  border: 1px solid rgba(37, 98, 184, 0.5);
  color: var(--white);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.lightbox-close:hover,
.lightbox-nav:hover { background: var(--blue-light); border-color: var(--blue-light); }

.lightbox-close { top: 18px; right: 18px; font-size: 2rem; }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

@media (max-width: 600px) {
  .lightbox { padding: 72px 12px; }
  .lightbox-prev { left: 12px; bottom: 16px; top: auto; }
  .lightbox-next { right: 12px; bottom: 16px; top: auto; }
}

@media (max-width: 480px) {
  .brand-logo-wrap { height: 74px; }
  .spec-table { font-size: 0.85rem; }
  .testimonial-quote { padding: 24px 22px; }
}
