/* ==========================================================================
   GMARC ABOGADOS — Design System
   Estilo: Mixto (serif editorial en títulos + sans en cuerpo)
   ========================================================================== */

/* ---------- 1. Tokens de diseño ---------- */
:root {
  /* Color de marca */
  --burdeo:        #701318;   /* acento de marca / CTA (del logo) */
  --burdeo-dark:   #4E0C10;   /* hover / estados activos */
  --burdeo-soft:   #f3e8e9;   /* fondos sutiles de acento */

  /* Neutros */
  --tinta:         #1a1a1a;   /* texto principal */
  --grafito:       #54564f;   /* texto secundario */
  --grafito-soft:  #7a7d75;
  --verde-prof:    #2f362b;   /* footer / detalles (oliva del sitio original) */
  --marfil:        #f7f5f1;   /* fondos de sección */
  --blanco:        #ffffff;
  --linea:         #e4e1d9;   /* bordes y divisores */
  --dorado:        #b89b5e;   /* acento premium muy puntual */

  /* Tipografía */
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans:  "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Escala de espaciado (base 8px) */
  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2rem;
  --sp-5: 3rem;
  --sp-6: 4rem;
  --sp-7: 6rem;

  /* Estructura */
  --max-w: 1140px;
  --radius: 4px;
  --shadow-sm: 0 1px 3px rgba(26,26,26,.08), 0 1px 2px rgba(26,26,26,.06);
  --shadow-md: 0 8px 30px rgba(26,26,26,.10);
  --transition: 180ms ease;
}

/* ---------- 2. Reset y base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--tinta);
  background: var(--blanco);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--burdeo); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--burdeo-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--tinta);
  margin: 0 0 var(--sp-2);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p { margin: 0 0 var(--sp-2); }

/* ---------- 3. Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-3);
}

.section { padding-block: var(--sp-7); }
.section--tight { padding-block: var(--sp-6); }
.section--marfil { background: var(--marfil); }

.section-head { max-width: 720px; margin-bottom: var(--sp-5); }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--burdeo);
  margin-bottom: var(--sp-1);
}

.lead { font-size: 1.2rem; color: var(--grafito); }

.divider {
  width: 56px; height: 3px; border: 0;
  background: var(--burdeo);
  margin: var(--sp-2) 0 0;
}
.section-head--center .divider { margin-inline: auto; }

/* ---------- 4. Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--burdeo);
  cursor: pointer;
  transition: all var(--transition);
}
.btn--primary { background: var(--burdeo); color: #fff; }
.btn--primary:hover { background: var(--burdeo-dark); border-color: var(--burdeo-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--burdeo); }
.btn--ghost:hover { background: var(--burdeo); color: #fff; }
.btn--light { border-color: rgba(255,255,255,.5); color: #fff; background: transparent; }
.btn--light:hover { background: #fff; color: var(--burdeo); border-color: #fff; }

/* ---------- 5. Header / Navegación ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linea);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 76px;
}
.nav__logo img { height: 52px; width: auto; }
.nav__menu {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  list-style: none;
  margin: 0; padding: 0;
}
.nav__menu a {
  font-family: var(--font-sans);
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--tinta);
  padding: 0.4rem 0;
  position: relative;
}
.nav__menu a::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px; background: var(--burdeo);
  transition: width var(--transition);
}
.nav__menu a:hover, .nav__menu a[aria-current="page"] { color: var(--burdeo); }
.nav__menu a:hover::after, .nav__menu a[aria-current="page"]::after { width: 100%; }
.nav__cta { margin-left: var(--sp-1); }

/* El botón de Contacto siempre con texto blanco (gana a .nav__menu a) */
.nav__menu a.btn--primary,
.nav__menu a.btn--primary:hover,
.nav__menu a.btn--primary[aria-current="page"] { color: #fff; }
.nav__menu a.btn::after { display: none; }

.nav__toggle {
  display: none;
  background: none; border: 0; cursor: pointer;
  padding: 0.5rem; color: var(--tinta);
}
.nav__toggle svg { width: 28px; height: 28px; }

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(46,12,16,.94) 0%, rgba(26,18,15,.78) 50%, rgba(20,16,14,.60) 100%),
    var(--hero-img, url("../img/banner1.jpg")) center/cover no-repeat;
}
/* Viñeta inferior sutil para dar profundidad y disimular baja resolución */
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(to top, rgba(20,12,12,.55), transparent 45%);
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; }
.hero__inner {
  min-height: 540px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: var(--sp-7);
  max-width: 760px;
}
.hero h1 { color: #fff; margin-bottom: var(--sp-3); }
.hero .eyebrow { color: var(--dorado); }
.hero__lead { font-size: 1.25rem; color: rgba(255,255,255,.92); max-width: 600px; margin-bottom: var(--sp-4); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* Hero interno (páginas secundarias) */
.page-hero {
  color: #fff;
  background:
    linear-gradient(120deg, rgba(46,12,16,.94) 0%, rgba(26,18,15,.82) 60%, rgba(20,16,14,.66) 100%),
    var(--hero-img, url("../img/banner2.jpg")) center 30%/cover no-repeat;
}
.page-hero__inner { padding-block: var(--sp-6); }
.page-hero h1 { color: #fff; margin-bottom: var(--sp-1); }
.page-hero .eyebrow { color: var(--dorado); }
.breadcrumb { font-size: 0.9rem; color: rgba(255,255,255,.8); }
.breadcrumb a { color: rgba(255,255,255,.8); }
.breadcrumb a:hover { color: #fff; }

/* ---------- 7. Grid / tarjetas ---------- */
.grid { display: grid; gap: var(--sp-4); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: var(--radius);
  padding: var(--sp-4);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.card__icon {
  width: 48px; height: 48px;
  color: var(--burdeo);
  margin-bottom: var(--sp-2);
}
.card__icon svg { width: 100%; height: 100%; }
.card h3 { margin-bottom: var(--sp-1); }
.card p { color: var(--grafito); margin-bottom: var(--sp-2); }
.card__link {
  font-weight: 600; font-size: 0.95rem;
  display: inline-flex; align-items: center; gap: .35rem;
}
.card__link::after { content: "→"; transition: transform var(--transition); }
.card:hover .card__link::after { transform: translateX(4px); }

/* Tarjeta de área destacada (2 servicios principales) */
.service {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: var(--verde-prof);
}
.service__bg {
  position: absolute; inset: 0;
  object-fit: cover; width: 100%; height: 100%;
  z-index: 0; filter: saturate(.9);
}
.service::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(20,12,12,.9) 10%, rgba(20,12,12,.25));
}
.service__body { position: relative; z-index: 2; padding: var(--sp-4); }
.service__body h3 { color: #fff; }
.service__body p { color: rgba(255,255,255,.85); margin-bottom: var(--sp-2); }

/* ---------- 8. Bloques media + texto ---------- */
.media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
  align-items: center;
}
.media__img img { border-radius: var(--radius); box-shadow: var(--shadow-md); width: 100%; }
.media--reverse .media__img { order: 2; }

/* Lista de especialidades */
.spec-list { list-style: none; margin: 0; padding: 0; }
.spec-list > li {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--linea);
}
.spec-list > li:last-child { border-bottom: 0; }
.spec-list h3 { color: var(--burdeo); font-size: 1.2rem; margin-bottom: 0.3rem; }
.spec-list p { color: var(--grafito); margin: 0; }

/* ---------- 9. Galería ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.gallery img { border-radius: var(--radius); aspect-ratio: 16/10; object-fit: cover; width: 100%; }

/* ---------- 10. Stats / cifras ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); text-align: center; }
.stat__num { font-family: var(--font-serif); font-size: clamp(2.2rem,4vw,3rem); color: var(--burdeo); line-height: 1; }
.stat__label { font-size: 0.95rem; color: var(--grafito); margin-top: 0.4rem; }

/* ---------- 11. Clientes ---------- */
.clients-note { color: var(--grafito); }

/* Grilla de logos de clientes — sin bordes, centrados, grayscale → color en hover.
   Las celdas vacías de la última fila quedan transparentes (sin fondo de color). */
.client-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-1);
  align-items: center;
  justify-items: center;
}
.client-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 150px;
  padding: var(--sp-2);
}
.client-grid img {
  max-height: 115px;
  max-width: 100%;          /* nunca más ancho que su celda → sin scroll horizontal */
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.6;
  transition: filter var(--transition), opacity var(--transition);
}
.client-grid a:hover img { filter: grayscale(0); opacity: 1; }

/* ---------- 12. Equipo ---------- */
.team-card { text-align: center; }
.team-card img { border-radius: var(--radius); aspect-ratio: 3/4; object-fit: cover; width: 100%; margin-bottom: var(--sp-2); }
.team-card h3 { margin-bottom: 0.15rem; }
.team-card .role { color: var(--burdeo); font-weight: 600; font-size: 0.95rem; }

/* Profesional único (staff con una sola persona) */
.team-solo {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--sp-6);
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
}
.team-solo__img img { border-radius: var(--radius); aspect-ratio: 3/4; object-fit: cover; width: 100%; box-shadow: var(--shadow-md); }
.team-solo__body h3 { margin-bottom: 0.15rem; }
.team-solo__body .role { color: var(--burdeo); font-weight: 600; font-size: 1rem; margin-bottom: var(--sp-2); }
.team-solo__body p { color: var(--grafito); margin: 0; }
.team-solo__mail {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--sp-3);
  padding: 0.5rem 1rem;
  border: 1px solid var(--linea);
  border-radius: var(--radius);
  color: var(--burdeo);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s;
}
.team-solo__mail svg { width: 18px; height: 18px; }
.team-solo__mail:hover { background: var(--marfil); border-color: var(--burdeo); }
@media (max-width: 640px) {
  .team-solo { grid-template-columns: 1fr; text-align: center; max-width: 340px; gap: var(--sp-4); }
  .team-solo__mail { justify-content: center; }
}

/* ---------- 13. CTA banda ---------- */
.cta-band {
  background: var(--verde-prof);
  color: #fff;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.85); max-width: 620px; margin-inline: auto; }
.cta-band .hero__actions { justify-content: center; margin-top: var(--sp-3); }

/* ---------- 14. Formulario de contacto ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: var(--sp-6); align-items: start; }
.info-list { list-style: none; margin: var(--sp-3) 0 0; padding: 0; }
.info-list li { display: flex; gap: var(--sp-2); padding: var(--sp-2) 0; border-bottom: 1px solid var(--linea); }
.info-list .ic { color: var(--burdeo); flex: 0 0 24px; }
.info-list .ic svg { width: 24px; height: 24px; }
.info-list strong { display: block; font-family: var(--font-serif); }
.info-list span, .info-list a { color: var(--grafito); }

.form { background: var(--marfil); border: 1px solid var(--linea); border-radius: var(--radius); padding: var(--sp-4); }
.field { margin-bottom: var(--sp-3); }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.4rem; }
.field input, .field textarea {
  width: 100%;
  font-family: var(--font-sans); font-size: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1.5px solid var(--linea);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field textarea:focus {
  outline: 0; border-color: var(--burdeo);
  box-shadow: 0 0 0 3px var(--burdeo-soft);
}
.field textarea { resize: vertical; min-height: 130px; }

/* Honeypot: fuera de pantalla y del flujo, invisible para humanos. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Mensaje de error de validación del formulario. */
.form-error {
  background: var(--burdeo-soft);
  border: 1px solid var(--burdeo);
  color: var(--burdeo-dark);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: var(--sp-3);
  font-size: 0.92rem;
}
.form-error p { margin: 0.15rem 0; }

/* ---------- 15. Mapa ---------- */
.map-embed { border: 0; width: 100%; height: 420px; border-radius: var(--radius); }

/* ---------- 16. Footer ---------- */
.site-footer { background: var(--verde-prof); color: rgba(255,255,255,.78); }
.site-footer .container { padding-block: var(--sp-6); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--sp-5); }
.site-footer h4 { color: #fff; font-family: var(--font-serif); font-size: 1.1rem; margin-bottom: var(--sp-2); }
.site-footer a { color: rgba(255,255,255,.78); }
.site-footer a:hover { color: #fff; }
.footer-brand img { height: 64px; width: auto; margin-bottom: var(--sp-3); filter: brightness(0) invert(1); opacity: .95; }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { margin-bottom: 0.6rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.14);
  text-align: center;
  font-size: 0.85rem;
  padding: var(--sp-3);
  color: rgba(255,255,255,.55);
}

/* ---------- 17. WhatsApp flotante ---------- */
.whatsapp-float {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 200;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #25D366;
  display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  transition: transform var(--transition);
}
.whatsapp-float:hover { transform: scale(1.07); }
.whatsapp-float svg { width: 32px; height: 32px; fill: #fff; }

/* ---------- 18. Utilidades ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ---------- 19. Responsive ---------- */
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
}

@media (max-width: 820px) {
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    position: fixed;
    inset: 76px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--linea);
    padding: var(--sp-2) var(--sp-3) var(--sp-3);
    box-shadow: var(--shadow-md);
    transform: translateY(-120%);
    transition: transform 240ms ease;
  }
  .nav__menu.is-open { transform: translateY(0); }
  .nav__menu li { border-bottom: 1px solid var(--linea); }
  .nav__menu a { display: block; padding: 0.9rem 0; }
  .nav__menu a::after { display: none; }
  .nav__cta { margin: var(--sp-2) 0 0; }
  .nav__cta .btn { width: 100%; justify-content: center; }

  .grid--2, .grid--3, .media, .contact-grid { grid-template-columns: 1fr; }
  .media__img { order: -1 !important; }
  .media { gap: var(--sp-4); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .client-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding-block: var(--sp-6); }
  .hero__inner { min-height: 440px; }
}

@media (max-width: 480px) {
  .grid--4, .stats, .gallery { grid-template-columns: 1fr; }
  .hero__actions .btn, .cta-band .btn { width: 100%; justify-content: center; }
}
