/* ==========================================================================
   MCD Desarrollos — estilos
   ========================================================================== */

/* Tokens
   ========================================================================== */
:root {
  --navy: #172b36;
  --navy-2: #20394a;
  --steel: #2f5468;
  --copper: #b06f48;
  --copper-2: #9a5c38;
  --sand: #cbb79c;
  --cream: #f2efe8;
  --paper: #fbfaf7;
  --ink: #1c2a33;
  --muted: #5b6770;
  --line: #ddd6ca;
  --cream-75: rgba(242, 239, 232, .75);
  --shade: rgba(10, 20, 26, .85);

  --radius: 4px;
  --max: 1180px;
  --gutter: 24px;
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 4px); }

body {
  font-family: Raleway, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body:has(.lightbox[open]) { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { list-style: none; }

h1, h2, h3 { line-height: 1.12; font-weight: 800; color: var(--navy); }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); margin: .4rem 0 1rem; }

section { padding: 96px 0; }

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Utilidades de layout y tipografía
   ========================================================================== */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--copper);
}

.rule { width: 72px; height: 4px; background: var(--copper); margin: 0 0 1.6rem; }

.lead { font-size: 1.12rem; color: var(--muted); max-width: 640px; }

.tag {
  display: inline-block;
  margin-bottom: 8px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--copper);
}

.badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  padding: 6px 12px;
  border-radius: 40px;
  background: var(--copper);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  pointer-events: none;
}

/* Botones
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: 0;
  border-radius: var(--radius);
  background: var(--copper);
  color: #fff;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.6;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.btn:hover { background: var(--copper-2); transform: translateY(-1px); }

.btn-ghost { background: transparent; border: 2px solid currentColor; color: var(--navy); }
.btn-ghost:hover { background: rgba(23, 43, 54, .06); }

/* Encabezado y navegación
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: rgba(251, 250, 247, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-color: var(--line); }

.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.nav-logo img { height: 38px; width: auto; }

.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a:not(.btn) {
  position: relative;
  font-weight: 600;
  font-size: .95rem;
  color: var(--navy);
  text-decoration: none;
}
.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--copper);
  transition: width .2s;
}
.nav-links a:not(.btn):hover::after,
.nav-links a.is-active::after { width: 100%; }
.nav-links .btn { padding: 10px 18px; }

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  cursor: pointer;
}
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  position: relative;
  width: 24px;
  height: 2px;
  background: var(--navy);
  transition: background .2s, top .2s, transform .2s;
}
.menu-toggle span::before,
.menu-toggle span::after { content: ""; position: absolute; left: 0; }
.menu-toggle span::before { top: -7px; }
.menu-toggle span::after { top: 7px; }
.nav-open .menu-toggle span { background: transparent; }
.nav-open .menu-toggle span::before { top: 0; transform: rotate(45deg); }
.nav-open .menu-toggle span::after { top: 0; transform: rotate(-45deg); }

/* Hero
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  min-height: 100vh;
  padding: 0;
  background: var(--sand);
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 56px 72px max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}
.hero-text .eyebrow { color: var(--navy); opacity: .75; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin: 18px 0 22px; letter-spacing: -.01em; }
.hero p { max-width: 480px; margin-bottom: 34px; font-size: 1.15rem; color: var(--navy-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-img { position: relative; overflow: hidden; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-img .badge { top: calc(var(--header-h) + 20px); left: 28px; }
.hero-img figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 60px 28px 22px;
  background: linear-gradient(transparent, rgba(10, 20, 26, .75));
  color: #fff;
  font-size: .92rem;
}

/* Franja de destacados
   ========================================================================== */
.strip { padding: 34px 0; background: var(--navy); color: var(--cream); }
.strip .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.strip strong { display: block; margin-bottom: 2px; color: var(--copper); font-size: 1.05rem; font-weight: 800; }
.strip span { font-size: .92rem; opacity: .85; }

/* Novedades
   ========================================================================== */
#novedades { background: var(--cream); }

.news { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; margin-top: 44px; }
.news-side { display: grid; gap: 28px; }

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 0 var(--line);
}
.card-media { position: relative; overflow: hidden; aspect-ratio: 16 / 10; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 24px 26px 28px; }
.card h3 { margin-bottom: 8px; font-size: 1.25rem; }
.card p { color: var(--muted); font-size: .97rem; }

.news-main .card-media { aspect-ratio: 4 / 3; }
.news-main h3 { font-size: 1.6rem; }
.news-side .card { flex-direction: row; }
.news-side .card-media { flex-shrink: 0; width: 42%; aspect-ratio: auto; }

/* Nosotros
   ========================================================================== */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.about-img { position: relative; }
.about-img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.about-img::before {
  content: "";
  position: absolute;
  inset: -14px auto auto -14px;
  width: 55%;
  height: 55%;
  border-top: 4px solid var(--steel);
  border-left: 4px solid var(--steel);
}

.pillars { display: grid; gap: 14px; margin-top: 28px; }
.pillars li { position: relative; padding-left: 22px; font-weight: 700; color: var(--navy); }
.pillars li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 10px;
  height: 10px;
  background: var(--copper);
}

.team-head { margin-top: 96px; }
.team { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; }
.member { padding: 22px 22px 26px; border-left: 5px solid var(--steel); background: #fff; box-shadow: 0 1px 0 var(--line); }
.member-num { color: var(--copper); font-weight: 800; font-size: 1.6rem; }
.member h3 { margin: 4px 0 10px; font-size: 1.05rem; }
.member p { color: var(--muted); font-size: .92rem; }
.member-quote { display: flex; align-items: center; border: 0; background: var(--navy); }
.member-quote p { color: var(--cream); font-size: 1.3rem; font-weight: 700; line-height: 1.3; }

.values {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-top: 80px;
  padding-top: 56px;
  border-top: 1px solid var(--line);
}
.values h3 {
  margin-bottom: 8px;
  padding-left: 12px;
  border-left: 3px solid var(--copper);
  font-size: .8rem;
  line-height: 1.4;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.values p { padding-left: 15px; color: var(--muted); font-size: .95rem; }

/* Servicios
   ========================================================================== */
#servicios { background: var(--navy); color: var(--cream); }
#servicios h2, #servicios h3 { color: #fff; }
#servicios .lead { color: var(--cream-75); }

.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 48px;
  background: rgba(255, 255, 255, .08);
}
.service { padding: 36px 34px; background: var(--navy); transition: background .25s; }
.service:hover { background: var(--navy-2); }
.service-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 20px;
  border: 2px solid var(--copper);
  color: var(--copper);
}
.service h3 { margin-bottom: 10px; font-size: 1.35rem; }
.service p { color: var(--cream-75); }

.how { display: grid; grid-template-columns: 1fr 1.3fr; gap: 56px; align-items: start; margin-top: 88px; }
.how h3 { margin-top: 10px; font-size: 2rem; }

.steps { counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  font-weight: 600;
}
.steps li::before { content: counter(step, decimal-leading-zero); color: var(--copper); font-size: 1.8rem; font-weight: 800; }

.callout {
  margin-top: 24px;
  padding: 6px 0 6px 20px;
  border-left: 4px solid var(--copper);
  color: var(--copper);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
}

/* Proyectos
   ========================================================================== */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 32px 0 30px; }
.filters button {
  padding: 9px 18px;
  border: 1.5px solid var(--line);
  border-radius: 40px;
  background: #fff;
  color: var(--navy);
  font-family: inherit;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.filters button:hover,
.filters button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 260px; gap: 16px; }

.proj { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--navy); }
.proj[hidden] { display: none; }
.proj.tall { grid-row: span 2; }
.proj.wide { grid-column: span 2; }
.proj img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s, opacity .3s; }
.proj img.focus-low { object-position: center 60%; }
.proj:hover img { transform: scale(1.05); opacity: .85; }

.proj-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 48px 20px 18px;
  background: linear-gradient(transparent, var(--shade));
  color: #fff;
}
.proj-caption small {
  display: block;
  color: var(--sand);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.proj-caption h3 { margin-top: 3px; color: #fff; font-size: 1.05rem; font-weight: 700; line-height: 1.3; }

/* Botón invisible que cubre la tarjeta (lo inserta main.js) */
.proj-zoom { position: absolute; inset: 0; z-index: 2; border: 0; background: none; cursor: zoom-in; }
.proj-zoom:focus-visible { outline-offset: -3px; }

/* Lightbox (<dialog>) */
.lightbox {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 24px;
  border: 0;
  background: rgba(8, 16, 21, .94);
}
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: min(1100px, 100%); max-height: 80vh; object-fit: contain; border-radius: var(--radius); }
.lightbox p { max-width: 700px; color: var(--cream); text-align: center; }
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
}

/* Contacto
   ========================================================================== */
#contacto { position: relative; overflow: hidden; background: var(--navy-2); color: var(--cream); }
#contacto h2 { color: #fff; }
#contacto .lead { color: rgba(242, 239, 232, .8); }

.contact { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: start; }

.channels { display: grid; gap: 22px; margin-top: 36px; }
.channel {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .05);
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
.channel:hover { background: rgba(255, 255, 255, .1); border-color: var(--copper); }
.channel-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--copper);
  color: #fff;
}
.channel small {
  display: block;
  color: var(--sand);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.channel strong { color: #fff; font-size: 1.2rem; }

.quote-form { padding: 34px; border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.quote-form h3 { margin-bottom: 6px; font-size: 1.4rem; }
.quote-form > p { margin-bottom: 20px; color: var(--muted); font-size: .93rem; }
.quote-form label { display: block; margin: 14px 0 6px; color: var(--navy); font-weight: 700; font-size: .85rem; }
.quote-form :is(input, select, textarea) {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
}
.quote-form :is(input, select, textarea):focus { outline: none; border-color: var(--copper); }
.quote-form textarea { min-height: 110px; resize: vertical; }
.quote-form .btn { justify-content: center; width: 100%; margin-top: 20px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Pie de página
   ========================================================================== */
.site-footer { padding: 44px 0; background: var(--navy); color: rgba(242, 239, 232, .7); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.site-footer img { height: 40px; width: auto; }
.site-footer em { color: var(--sand); }

/* Botón flotante de WhatsApp
   ========================================================================== */
.wa-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  transition: transform .2s;
}
.wa-float:hover { transform: scale(1.08); }

/* Animación de entrada (solo con JS activo)
   ========================================================================== */
.reveal { transition: transform .7s; }
.js .reveal:not(.is-visible) { transform: translateY(16px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal:not(.is-visible) { transform: none; }
}

/* Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .nav-links {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }
  .nav-open .nav-links { display: flex; }
  .nav-links a:not(.btn) { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav-links .btn { justify-content: center; width: 100%; margin-top: 16px; }
  .menu-toggle { display: flex; }

  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-text { padding: 120px var(--gutter) 56px; }
  .hero-img { height: 62vw; min-height: 280px; }
  .hero-img .badge { top: 16px; left: 16px; }

  .strip .wrap { grid-template-columns: repeat(2, 1fr); }
  .news { grid-template-columns: 1fr; }
  .about, .how, .contact { grid-template-columns: 1fr; gap: 44px; }
  .team { grid-template-columns: repeat(2, 1fr); }
  .member-quote { grid-column: span 2; }
  .values { grid-template-columns: repeat(2, 1fr); }
  .services { grid-template-columns: repeat(2, 1fr); }

  .gallery { grid-template-columns: repeat(2, 1fr); }
  .proj.wide, .proj.full-md { grid-column: span 2; }
  .proj.full-md { grid-row: span 1; }
}

@media (max-width: 620px) {
  :root { --gutter: 16px; }

  section { padding: 72px 0; }
  .hero-text { padding: 110px var(--gutter) 48px; }
  .strip .wrap { gap: 18px; }
  .news-side .card { flex-direction: column; }
  .news-side .card-media { width: 100%; aspect-ratio: 16 / 10; }
  .team, .values, .services { grid-template-columns: 1fr; }
  .member-quote { grid-column: auto; }
  .service { padding: 30px 22px; }
  .about-img::before { inset: -10px auto auto -6px; }

  .gallery { grid-template-columns: 1fr; grid-auto-rows: 300px; }
  .proj.tall { grid-row: span 1; }
  .proj.wide, .proj.full-md { grid-column: span 1; }

  .quote-form { padding: 24px 18px; }
  .row2 { grid-template-columns: 1fr; }
}
