/* ============================================================
   ROLANDO FARIÑAS | Defensa Legal — Design System
   fmdefensalegal.es
   ============================================================ */

/* 1. GOOGLE FONTS
============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Inter:wght@400;500;600;700&display=swap');


/* 2. CSS VARIABLES
============================================================ */
:root {
  --navy:        #1B2F5E;
  --navy-dark:   #0D1F42;
  --navy-mid:    #243d78;
  --gold:        #C9A84C;
  --gold-dark:   #a88737;
  --gold-light:  #e8c97a;
  --gold-text:   #7a5f1f;  /* AA-compliant para texto sobre blanco — ratio 6.3:1 */
  --white:       #FFFFFF;
  --off-white:   #F5F7FA;
  --card-bg:     #FEFEFE;
  --text:        #1A1A2E;
  --text-mid:    #3D4461;
  --text-light:  #5A6478;   /* WCAG AA — ratio 5.5:1 sobre off-white */
  --border:      #DDE3EF;
  --border-light:#ECF0F9;
  --success:     #16A34A;
  --error:       #DC2626;

  --font-display: 'Playfair Display', 'Playfair Display Fallback', Georgia, serif;
  --font-body:    'Inter', 'Inter Fallback', system-ui, sans-serif;

  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  20px;
  --radius-xl:  32px;

  --shadow-sm:  0 1px 4px rgba(27,47,94,.08);
  --shadow:     0 4px 24px rgba(27,47,94,.12);
  --shadow-lg:  0 12px 48px rgba(27,47,94,.18);
  --shadow-xl:  0 24px 80px rgba(27,47,94,.22);

  --transition: 0.25s ease;

  --container:  1200px;
  --section-y:  80px;
}


/* 3. RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a  { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }


/* 4. TYPOGRAPHY
============================================================ */
/* Fuentes fallback con métricas ajustadas para evitar CLS al cargar Google Fonts.
   Mientras Inter/Playfair se descargan, Arial/Georgia se renderizan con dimensiones
   muy similares — al hacer el swap no hay layout shift. */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial'), local('Helvetica');
  ascent-override: 90.20%;
  descent-override: 22.48%;
  line-gap-override: 0.00%;
  size-adjust: 107.40%;
}
@font-face {
  font-family: 'Playfair Display Fallback';
  src: local('Georgia'), local('Times New Roman'), local('serif');
  ascent-override: 95.00%;
  descent-override: 25.00%;
  line-gap-override: 0.00%;
  size-adjust: 105.00%;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--navy);
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 700; }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 600; }

p  { line-height: 1.7; }

.lead {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.75;
  color: var(--text-mid);
}

.text-gold { color: var(--gold); }
.text-navy { color: var(--navy); }
.text-white { color: var(--white); }
.text-light { color: var(--text-light); }
.text-center { text-align: center; }

strong { font-weight: 600; }


/* 5. LAYOUT
============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow { max-width: 800px; }
.container--wide   { max-width: 1400px; }

section { position: relative; }

.section-pad { padding: var(--section-y) 0; }
.section-pad-sm { padding: 48px 0; }

.grid { display: grid; gap: 32px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }


/* 6. SECTION HEADERS
============================================================ */
.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header .kicker {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-text);  /* AA-compliant */
  margin-bottom: 12px;
}

/* Kicker sobre fondos navy/oscuros mantiene el dorado original */
.page-hero .kicker,
.section-pad[style*="background"][style*="navy"] .kicker,
section[style*="rgba(13,31,66"] .kicker,
section[style*="rgba(27,47,94"] .kicker {
  color: var(--gold);
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-mid);
  font-size: 1.05rem;
}

.divider {
  width: 56px;
  height: 3px;
  background: var(--gold);
  margin: 16px auto 0;
  border-radius: 2px;
}


/* 7. BUTTONS
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy-dark);
  box-shadow: 0 4px 16px rgba(201,168,76,.35);
}
.btn-primary:hover {
  background: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201,168,76,.45);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,.6);
}
.btn-secondary:hover {
  background: rgba(255,255,255,.12);
  border-color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
}

.btn-outline-gold {
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
}
.btn-outline-gold:hover {
  background: var(--gold);
  color: var(--navy-dark);
}

.btn-lg {
  padding: 17px 36px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.85rem;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}


/* 8. NAVIGATION
============================================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  padding: 20px 0;
  transition: background var(--transition), padding var(--transition), box-shadow var(--transition);
}

.site-nav.scrolled {
  background: var(--navy-dark);
  padding: 12px 0;
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-logo {
  margin-left: -56px;
}
.nav-logo img {
  height: 72px;
  width: auto;
  display: block;
  /* Logo a colores nativos sobre fondo blanco para máxima visibilidad */
  background: var(--white);
  border-radius: 10px;
  padding: 6px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
@media (max-width: 640px) {
  .nav-logo { margin-left: -22px; }
  .nav-logo img { height: 56px; padding: 5px 10px; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.85);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
}

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

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  /* transform unificado: centrado horizontal + slide-up oculto */
  transform: translateX(-50%) translateY(-8px);
}

/* Puente invisible que cubre los 8px de aire entre el <a> padre y el menú,
   manteniendo el :hover continuo cuando el cursor cruza el gap */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 10px 16px;
  color: var(--text) !important;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-dropdown-menu a:hover {
  background: var(--off-white) !important;
  color: var(--navy) !important;
}

.nav-dropdown-menu a span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 400;
  margin-top: 2px;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-phone {
  color: var(--gold-light);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-phone:hover { color: var(--gold); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  z-index: 910;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.nav-mobile {
  display: none;
  flex-direction: column;
  position: fixed;
  inset: 0;
  background: var(--navy-dark);
  padding: 100px 32px 40px;
  z-index: 899;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.nav-mobile.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.nav-mobile a {
  color: rgba(255,255,255,.8);
  font-size: 1.2rem;
  font-weight: 600;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  transition: color var(--transition);
}

.nav-mobile a:hover { color: var(--gold); }

.nav-mobile .nav-mobile-sub {
  display: flex;
  flex-direction: column;
  padding-left: 16px;
  border-left: 2px solid var(--gold);
  margin: 8px 0;
}

.nav-mobile .nav-mobile-sub a {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  padding: 10px 0;
  color: rgba(255,255,255,.85);
}

.nav-mobile .nav-mobile-sub a:hover {
  color: var(--gold);
  padding-left: 6px;
  transition: padding-left .2s ease, color .2s ease;
}

.nav-mobile-phone {
  margin-top: 32px;
  padding: 20px;
  background: rgba(255,255,255,.06);
  border-radius: var(--radius);
  text-align: center;
}

.nav-mobile-phone a {
  color: var(--gold) !important;
  font-size: 1.3rem !important;
  border: none !important;
  padding: 0 !important;
}


/* 9. HERO
============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(145deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-mid) 100%);
  position: relative;
  overflow: hidden;
  padding: 120px 0 80px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 50%, rgba(201,168,76,.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 10% 80%, rgba(255,255,255,.04) 0%, transparent 60%);
  pointer-events: none;
}

/* Subtle wave motif */
.hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--white);
  clip-path: ellipse(56% 100% at 50% 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 64px;
  align-items: center;
}

/* Hero con <img> real (mejora LCP — sustituye background-image) */
.hero-bg-img {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 50%;
  max-width: 700px;
  object-fit: contain;
  object-position: right center;
  z-index: 0;
  pointer-events: none;
}

.hero-overlay-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(95deg, rgba(13,31,66,.96) 0%, rgba(13,31,66,.90) 35%, rgba(13,31,66,.45) 62%, rgba(13,31,66,.10) 100%);
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 1199px) {
  .hero-bg-img {
    width: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
  }
  .hero-overlay-grad {
    background: linear-gradient(rgba(13,31,66,.86), rgba(13,31,66,.78));
  }
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(201,168,76,.15);
  border: 1px solid rgba(201,168,76,.3);
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 20px;
  line-height: 1.15;
}

.hero h1 em {
  font-style: normal;
  color: var(--gold);
}

.hero-sub {
  color: rgba(255,255,255,.75);
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 48px;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}

.hero-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.65);
  font-size: 0.85rem;
}

.hero-trust-item strong {
  color: var(--white);
  font-weight: 600;
}

.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--gold);
  font-size: 0.9rem;
}

/* Hero form card */
.hero-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
}

.hero-card h3 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.hero-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 24px;
}


/* 10. TRUST BAR
============================================================ */
.trust-bar {
  background: var(--navy-dark);
  padding: 20px 0;
}

.trust-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.7);
  font-size: 0.88rem;
}

.trust-item strong {
  color: var(--white);
  font-weight: 700;
}

.trust-sep {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,.15);
}


/* 11. SERVICE CARDS
============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;  /* mobile-first: una columna */
  gap: 28px;
  max-width: 480px;
  margin: 0 auto;
}

@media (min-width: 760px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);  /* tablet: dos columnas */
    max-width: 760px;
  }
}

@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);  /* desktop: tres columnas */
    max-width: none;
  }
}

.service-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.service-card:hover::after { transform: scaleX(1); }

.service-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.service-icon svg {
  width: 28px;
  height: 28px;
  fill: var(--gold);
}

.service-card h3 {
  margin-bottom: 12px;
  font-size: 1.25rem;
}

.service-card p {
  color: var(--text-mid);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.tag {
  background: var(--off-white);
  color: var(--text-mid);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

.service-card .link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.9rem;
  transition: gap var(--transition), color var(--transition);
}

.service-card:hover .link-arrow { gap: 10px; color: var(--gold-dark); }


/* 12. WHY US SECTION
============================================================ */
.why-section { background: var(--off-white); }

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

.why-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--white);
  padding: 28px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  transition: box-shadow var(--transition);
}

.why-item:hover { box-shadow: var(--shadow); }

.why-num {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold);
  flex-shrink: 0;
}

.why-item h4,
.why-item .why-title { margin-bottom: 6px; font-size: 1rem; font-family: var(--font-display); font-weight: 700; color: var(--navy); }
.why-item p  { color: var(--text-mid); font-size: 0.9rem; margin: 0; }


/* 13. ABOUT SNIPPET
============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 80px;
  align-items: center;
}

.about-photo {
  position: relative;
}

.about-photo-frame {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(145deg, var(--navy), var(--navy-mid));
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;  /* preserva la cara (parte superior del retrato) */
}

.about-photo-placeholder {
  text-align: center;
  color: rgba(255,255,255,.4);
}

.about-photo-placeholder svg {
  width: 80px;
  height: 80px;
  fill: rgba(255,255,255,.3);
  margin-bottom: 12px;
}

.about-badge {
  position: absolute;
  bottom: -20px;
  right: -20px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.about-badge strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--navy);
  line-height: 1;
}

.about-badge span {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.about-content .kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-text);  /* AA-compliant — ratio 6.3:1 sobre blanco */
  margin-bottom: 12px;
}

.about-content h2 { margin-bottom: 20px; }
.about-content p  { color: var(--text-mid); margin-bottom: 16px; }

.credentials {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 28px 0;
}

.credential-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--text-mid);
}

.credential-item svg {
  width: 18px;
  height: 18px;
  fill: var(--gold);
  flex-shrink: 0;
}


/* 14. PROCESS
============================================================ */
.process-section { background: var(--navy-dark); }
.process-section .section-header h2 { color: var(--white); }
.process-section .section-header p  { color: rgba(255,255,255,.65); }

.process-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  position: relative;
}

.process-steps::before {
  content: '';
  position: absolute;
  top: 36px;
  left: calc(100% / 6);
  right: calc(100% / 6);
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,.4) 20%, rgba(201,168,76,.4) 80%, transparent);
}

.step-card {
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-num {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy-dark);
}

.step-card h3 { color: var(--white); font-size: 1.15rem; margin-bottom: 10px; }
.step-card p  { color: rgba(255,255,255,.6); font-size: 0.9rem; }


/* 15. TESTIMONIALS
============================================================ */
.testimonials-section { background: var(--off-white); }

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

.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  position: relative;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 16px;
  left: 28px;
  font-family: var(--font-display);
  font-size: 5rem;
  line-height: 1;
  color: var(--gold);
  opacity: 0.25;
}

.testimonial-stars { margin-bottom: 16px; }

.testimonial-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-mid);
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.author-info strong { display: block; font-size: 0.9rem; color: var(--navy); }
.author-info span   { font-size: 0.8rem; color: var(--text-light); }

.google-badge {
  text-align: center;
  margin-top: 48px;
}

.google-badge-inner {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 28px;
  box-shadow: var(--shadow-sm);
}

.google-badge-inner .stars { font-size: 1.1rem; }
.google-badge-text strong { display: block; font-size: 1rem; color: var(--navy); }
.google-badge-text span   { font-size: 0.82rem; color: var(--text-light); }


/* 16. FAQ
============================================================ */
.faq-list { max-width: 760px; margin: 0 auto; }

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  transition: color var(--transition);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
}

.faq-question:hover { color: var(--gold-dark); }

.faq-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.faq-icon svg {
  width: 14px;
  height: 14px;
  fill: var(--text-light);
  transition: transform var(--transition);
}

.faq-item.open .faq-icon {
  background: var(--gold);
  border-color: var(--gold);
}

.faq-item.open .faq-icon svg {
  fill: var(--navy-dark);
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding var(--transition);
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding-bottom: 20px;
}

.faq-answer p {
  color: var(--text-mid);
  font-size: 0.95rem;
  line-height: 1.75;
}


/* 17. CTA BANNER
============================================================ */
.cta-section {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  overflow: hidden;
  position: relative;
}

.cta-section::before {
  content: '';
  position: absolute;
  right: -10%;
  top: -50%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  border: 80px solid rgba(201,168,76,.06);
  pointer-events: none;
}

.cta-inner {
  text-align: center;
  position: relative;
  z-index: 1;
}

.cta-inner h2 { color: var(--white); margin-bottom: 16px; }
.cta-inner p  { color: rgba(255,255,255,.7); max-width: 540px; margin: 0 auto 36px; font-size: 1.05rem; }

.cta-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}


/* 18. FORMS
============================================================ */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 7px;
}

input:not([type="checkbox"]):not([type="radio"]), textarea, select {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

input:not([type="checkbox"]):not([type="radio"]):focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,47,94,.1);
}

input::placeholder, textarea::placeholder { color: var(--text-light); }
textarea { resize: vertical; min-height: 110px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7590' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  margin: 2px 0 0;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--navy);
  appearance: auto;
  -webkit-appearance: auto;
  flex-shrink: 0;
}

.form-check label {
  font-size: 0.82rem;
  color: var(--text-light);
  font-weight: 400;
  margin: 0;
  line-height: 1.5;
  cursor: pointer;
}

.form-check a { color: var(--navy); text-decoration: underline; }

.form-msg {
  display: none;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 16px;
}

.form-msg.success {
  display: block;
  background: #dcfce7;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.form-msg.error {
  display: block;
  background: #fee2e2;
  color: var(--error);
  border: 1px solid #fecaca;
}

/* Error states */
input.invalid, textarea.invalid, select.invalid {
  border-color: var(--error);
}

.field-error {
  font-size: 0.78rem;
  color: var(--error);
  margin-top: 4px;
}


/* 19. FOOTER
============================================================ */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,.7);
  padding: 64px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 280px 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.footer-logo img {
  height: 52px;
  width: auto;
  filter: brightness(0) invert(1);
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.social-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.social-btn:hover { background: rgba(255,255,255,.12); }

.social-btn svg {
  width: 18px;
  height: 18px;
  fill: rgba(255,255,255,.7);
}

.footer-col h3,
.footer-col h4 {
  color: var(--white);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 18px;
  font-family: var(--font-body);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 0.88rem;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--gold); }

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  margin-bottom: 12px;
  line-height: 1.5;
}

.footer-contact-item svg {
  width: 16px;
  height: 16px;
  fill: var(--gold);
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-bottom {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p, .footer-bottom a {
  font-size: 0.82rem;
  color: rgba(255,255,255,.75);  /* AA-compliant ratio ≥4.5:1 sobre navy-dark */
}

.footer-bottom a:hover { color: var(--gold-light); }

.footer-legal-links {
  display: flex;
  gap: 20px;
}


/* 20. COOKIE BANNER — Modal centrado (RGPD / AEPD 2024)
============================================================ */
.cookie-banner {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(13, 31, 66, .65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity .35s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* IMPORTANTE: 'hidden' = display:none (no afecta LCP, sale del render).
   'fading' = sigue en flow pero invisible (para animación de salida). */
.cookie-banner.hidden { display: none; }
.cookie-banner.fading {
  opacity: 0;
  pointer-events: none;
}

.cookie-banner > .container {
  width: 100%;
  max-width: 540px;
  padding: 0;
  margin: 0;
}

.cookie-inner {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: scale(1);
  transition: transform .35s ease;
}

.cookie-banner.fading .cookie-inner {
  transform: scale(.95);
}

.cookie-inner::before {
  content: '🍪';
  font-size: 2rem;
  line-height: 1;
  text-align: center;
}

.cookie-inner p {
  font-size: 0.95rem;
  color: var(--navy);
  line-height: 1.6;
  margin: 0;
  text-align: center;
}

.cookie-inner a { color: var(--navy); text-decoration: underline; }

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

/* AEPD 2024: los tres botones con misma jerarquía visual. */
.btn-cookie-accept,
.btn-cookie-decline,
.btn-cookie-config {
  font-weight: 700;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: all var(--transition);
  font-family: var(--font-body);
  cursor: pointer;
  border: 1.5px solid var(--navy);
  flex: 1 1 130px;
  min-width: 120px;
  max-width: 170px;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-cookie-accept {
  background: var(--navy);
  color: var(--white);
}

.btn-cookie-decline {
  background: var(--white);
  color: var(--navy);
}

.btn-cookie-config {
  background: var(--white);
  color: var(--navy);
  border-color: rgba(27,47,94,.35);
}

.btn-cookie-accept:hover { background: var(--navy-dark); border-color: var(--navy-dark); }
.btn-cookie-decline:hover { background: var(--navy); color: var(--white); }
.btn-cookie-config:hover { background: var(--off-white, #f3f4f8); border-color: var(--navy); }

@media (max-width: 480px) {
  .cookie-inner { padding: 24px 20px; }
  .btn-cookie-accept,
  .btn-cookie-decline,
  .btn-cookie-config { flex-basis: 100%; max-width: 100%; }
}


/* Botón flotante para revocar consentimiento (RGPD art. 7.3 / AEPD 2024).
   Posicionado a la derecha del chatbot (bottom-left), con ligera separación.
   El chatbot ocupa aprox. bottom: 24px, left: 24px, 60×60. */
.cookie-reopen-btn {
  position: fixed;
  bottom: 32px;
  left: 100px;
  z-index: 9985;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  border: 1.5px solid var(--gold);
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.cookie-reopen-btn:hover {
  background: var(--navy-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}

.cookie-reopen-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .cookie-reopen-btn {
    width: 40px;
    height: 40px;
    bottom: 28px;
    left: 88px;
  }
}


/* Botón "Revocar consentimiento" dentro de /politica-cookies/ */
.btn-revoke-cookies {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--navy);
  color: var(--white);
  border: 2px solid var(--navy);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-body);
  margin-top: 8px;
  transition: all var(--transition);
}

.btn-revoke-cookies:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-dark);
}


/* 21. AREA HERO (interior pages)
============================================================ */
.page-hero {
  background: linear-gradient(145deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-mid) 100%);
  padding: 160px 0 80px;
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--white);
  clip-path: ellipse(60% 100% at 50% 100%);
  z-index: 3;
}

/* Hero con <img> real (mejora LCP en landings) */
.page-hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}
.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(27,47,94,.78), rgba(13,31,66,.84));
  z-index: 1;
  pointer-events: none;
}
.page-hero--with-img > .container {
  position: relative;
  z-index: 2;
}

/* Article hero (blog posts) — mismo patrón que page-hero */
.article-hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}
.article-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.article-hero--with-img > .container {
  position: relative;
  z-index: 2;
}

.page-hero-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: rgba(255,255,255,.5);
  margin-bottom: 20px;
}

.page-hero-breadcrumb a {
  color: rgba(255,255,255,.5);
  transition: color var(--transition);
}

.page-hero-breadcrumb a:hover { color: var(--gold); }

.page-hero-breadcrumb span { color: rgba(255,255,255,.3); }

.page-hero h1 { color: var(--white); margin-bottom: 16px; }

.page-hero .lead { color: rgba(255,255,255,.72); max-width: 600px; }

.page-hero-actions { margin-top: 32px; }

.page-hero-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.page-hero-icon div {
  width: 80px;
  height: 80px;
  background: rgba(201,168,76,.15);
  border: 2px solid rgba(201,168,76,.3);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-hero-icon div svg {
  width: 40px;
  height: 40px;
  fill: var(--gold);
}


/* 22. SERVICE LIST (interior pages)
============================================================ */
.services-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.service-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: all var(--transition);
}

.service-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.service-item-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.service-item-icon svg {
  width: 22px;
  height: 22px;
  fill: var(--gold);
}

.service-item h4 { margin-bottom: 6px; font-size: 1rem; }
.service-item p  { color: var(--text-mid); font-size: 0.88rem; margin: 0; line-height: 1.6; }


/* 23. CONTACT PAGE
============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 64px;
  align-items: start;
}

.contact-info-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.contact-info-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info-icon svg {
  width: 22px;
  height: 22px;
  fill: var(--gold);
}

.contact-info-text strong { display: block; font-size: 0.88rem; color: var(--text-light); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.contact-info-text a, .contact-info-text p { font-size: 1rem; color: var(--navy); font-weight: 600; }

.form-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 100px;
}

.form-card h3 { margin-bottom: 6px; }
.form-card > p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 28px; }

.calendly-section { background: var(--off-white); }
.calendly-widget {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}


/* 24. ABOUT PAGE
============================================================ */
.about-full-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 80px;
  align-items: start;
}


/* 25. LEGAL PAGES
============================================================ */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0;
}

.legal-content h2 {
  font-size: 1.4rem;
  margin: 40px 0 14px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.legal-content h2:first-of-type {
  border-top: none;
  margin-top: 0;
}

.legal-content h3 {
  font-size: 1.1rem;
  margin: 24px 0 10px;
}

.legal-content p { color: var(--text-mid); margin-bottom: 14px; }
.legal-content ul { margin: 0 0 16px 20px; }
.legal-content ul li { color: var(--text-mid); margin-bottom: 6px; list-style: disc; }
.legal-content a { color: var(--navy); text-decoration: underline; }
.legal-content table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 0.9rem; }
.legal-content th, .legal-content td { padding: 10px 14px; border: 1px solid var(--border); text-align: left; }
.legal-content th { background: var(--off-white); font-weight: 600; color: var(--navy); }


/* 26. 404 PAGE
============================================================ */
.not-found {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--off-white);
  padding: 80px 24px;
}

.not-found-num {
  font-family: var(--font-display);
  font-size: clamp(6rem, 18vw, 12rem);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 3px var(--border);
  line-height: 1;
  margin-bottom: 16px;
}

.not-found h1 { margin-bottom: 16px; }
.not-found p  { color: var(--text-mid); margin-bottom: 36px; }

.not-found-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.not-found-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}
.not-found-links a {
  color: var(--navy);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.not-found-links a:hover { color: var(--gold-dark); }


/* 27. UTILITIES
============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.bg-navy     { background: var(--navy); }
.bg-navy-dark{ background: var(--navy-dark); }
.bg-off-white{ background: var(--off-white); }
.bg-white    { background: var(--white); }

.mt-8  { margin-top:  8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom:  8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* Alert / notice */
.alert-box {
  background: linear-gradient(135deg, rgba(201,168,76,.08), rgba(201,168,76,.12));
  border: 1px solid rgba(201,168,76,.3);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
}

.alert-box p { color: var(--text-mid); font-size: 0.95rem; margin: 0; }
.alert-box strong { color: var(--navy); }


/* 28. ANIMATIONS
============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.anim-fade-up {
  animation: fadeInUp 0.6s ease forwards;
}

.anim-float { animation: float 4s ease-in-out infinite; }


/* 29. MEDIA QUERIES
============================================================ */
@media (max-width: 1199px) {
  .hero-inner {
    grid-template-columns: 1fr;
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
  }

  .hero-card { display: none; }
  .hero-actions { justify-content: center; }
  .hero-trust { justify-content: center; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-photo-frame { aspect-ratio: 3/4; max-width: 360px; margin: 0 auto; }
  .about-badge { right: 0; bottom: -10px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }

  .contact-grid { grid-template-columns: 1fr; }
  .form-card { position: static; }

  .about-full-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --section-y: 60px; }

  .testimonials-grid{ grid-template-columns: repeat(2, 1fr); }
  .process-steps    { grid-template-columns: 1fr; gap: 24px; }
  .process-steps::before { display: none; }
  .services-list    { grid-template-columns: 1fr; }
  .why-grid         { grid-template-columns: 1fr; }

  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 639px) {
  :root { --section-y: 48px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }

  .trust-bar-inner { gap: 16px; }
  .trust-sep { display: none; }

  .cta-actions { flex-direction: column; align-items: center; }
  .hero-actions { flex-direction: column; align-items: center; }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-legal-links { justify-content: center; }

  .form-card { padding: 28px 20px; }
  .btn-lg { width: 100%; justify-content: center; }

  .page-hero { padding: 140px 0 64px; }
}

/* (services-grid responsive ya gestionado en mobile-first arriba) */


/* ============================================================
   CASOS REALES MARQUEE (LABORAL) — animación CSS continua, pausa en hover
============================================================ */
.casos-marquee {
  overflow: hidden;
  position: relative;
  max-width: 1300px;
  margin: 0 auto;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 94%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 94%, transparent 100%);
}

.casos-marquee-track {
  display: flex;
  gap: 24px;
  width: max-content;
  animation: casos-marquee-slide 70s linear infinite;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .casos-marquee-track { animation: none; }
}

.caso-card {
  flex: 0 0 360px;
  width: 360px;
  background: var(--off-white);
  border-radius: 14px;
  padding: 28px 26px;
  border-top: 3px solid var(--gold);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.caso-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(27,47,94,.10);
}
.caso-card .caso-tag {
  display: inline-block;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 10px;
}
.caso-card p {
  color: var(--text-mid);
  line-height: 1.7;
  font-style: italic;
  margin: 0;
  font-size: .92rem;
}

/* Loop infinito perfecto: N cards × 360 + N gaps × 24 px.
   Cada sección de "Casos reales" usa data-cards="N" para elegir su keyframe. */
@keyframes casos-marquee-slide {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-2304px, 0, 0); } /* 6 cards (Laboral) */
}
@keyframes casos-marquee-slide-2 {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-768px, 0, 0); }  /* 2 × (360+24) */
}
@keyframes casos-marquee-slide-3 {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-1152px, 0, 0); } /* 3 × (360+24) */
}
@keyframes casos-marquee-slide-4 {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-1536px, 0, 0); } /* 4 × (360+24) */
}
@keyframes casos-marquee-slide-5 {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-1920px, 0, 0); } /* 5 × (360+24) */
}

.casos-marquee[data-cards="2"] .casos-marquee-track {
  animation: casos-marquee-slide-2 32s linear infinite;
}
.casos-marquee[data-cards="3"] .casos-marquee-track {
  animation: casos-marquee-slide-3 42s linear infinite;
}
.casos-marquee[data-cards="4"] .casos-marquee-track {
  animation: casos-marquee-slide-4 54s linear infinite;
}
.casos-marquee[data-cards="5"] .casos-marquee-track {
  animation: casos-marquee-slide-5 65s linear infinite;
}

@media (max-width: 640px) {
  .caso-card { flex-basis: 280px; width: 280px; }
  @keyframes casos-marquee-slide {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-1824px, 0, 0); } /* 6 × (280+24) */
  }
  @keyframes casos-marquee-slide-2 {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-608px, 0, 0); }  /* 2 × (280+24) */
  }
  @keyframes casos-marquee-slide-3 {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-912px, 0, 0); }  /* 3 × (280+24) */
  }
  @keyframes casos-marquee-slide-4 {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-1216px, 0, 0); } /* 4 × (280+24) */
  }
  @keyframes casos-marquee-slide-5 {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-1520px, 0, 0); } /* 5 × (280+24) */
  }
}


/* ============================================================
   REVIEWS MARQUEE — animación CSS continua, pausa en hover
============================================================ */
.reviews-marquee {
  overflow: hidden;
  position: relative;
  /* Fade en los bordes para que las cards entren/salgan suavemente */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 94%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 94%, transparent 100%);
}

.reviews-marquee-track {
  display: flex;
  gap: 24px;
  width: max-content;
  animation: reviews-marquee-slide 80s linear infinite;
  will-change: transform;
}

.reviews-marquee:hover .reviews-marquee-track {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .reviews-marquee-track { animation: none; }
}

/* Cada card en el marquee: ancho fijo + altura uniforme */
.review-card.review-card--marquee {
  flex: 0 0 360px;
  width: 360px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 2px 12px rgba(27,47,94,.05);
  min-height: 280px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.review-card.review-card--marquee:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(27,47,94,.12);
}
.review-card.review-card--marquee p {
  color: var(--text-mid);
  font-size: .92rem;
  line-height: 1.6;
  margin: 0;
}

/* Loop infinito perfecto:
   12 cards (6+6 dup) × 360px + 11 gaps × 24px = 4584px total.
   Punto de loop = 6 cards + 6 gaps = 6×360 + 6×24 = 2304px.
   Al desplazar -2304px, la card 7 (clon de card 1) ocupa la posición original
   de card 1 → loop visualmente continuo. */
@keyframes reviews-marquee-slide {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-2304px, 0, 0); }
}

/* Móvil: cards más estrechas y velocidad ajustada */
@media (max-width: 640px) {
  .review-card.review-card--marquee { flex-basis: 280px; width: 280px; }
  @keyframes reviews-marquee-slide {
    from { transform: translate3d(0, 0, 0); }
    /* 6×280 + 6×24 = 1824px */
    to   { transform: translate3d(-1824px, 0, 0); }
  }
}


/* ============================================================
   HERO HOME — variante texto a la izquierda + foto sin recorte
============================================================ */
.hero--left-text {
  background-color: var(--navy) !important;
}
@media (max-width: 1199px) {
  /* Heros antiguos (sin <img> real) — mantienen fondo CSS para compatibilidad */
  .hero--left-text:not(.hero--with-img) {
    background:
      linear-gradient(rgba(13,31,66,.86), rgba(13,31,66,.78)),
      url('/assets/img/FOTO%201.webp') center/cover no-repeat,
      var(--navy) !important;
  }
  .hero--left-text .hero-inner {
    text-align: center !important;
    justify-items: center !important;
    margin: 0 auto !important;
    max-width: 720px !important;
  }
  .hero--left-text .hero-content { max-width: 100% !important; }
  .hero--left-text .hero-actions { justify-content: center !important; }
  .hero--left-text .hero-trust   { justify-content: center !important; }
  .hero--left-text .hero-kicker  { justify-content: center !important; }
}


/* ============================================================
   CHATBOT TOGGLE (BLOQUE 7) — anillo dorado
============================================================ */
#rf-toggle {
  box-shadow: 0 0 0 3px var(--gold), 0 4px 20px rgba(27,47,94,0.4) !important;
  transition: box-shadow .2s ease, background .2s ease;
}
#rf-toggle:hover {
  box-shadow: 0 0 0 4px var(--gold), 0 6px 24px rgba(27,47,94,0.5) !important;
}


/* ============================================================
   GRIDS RESPONSIVE NUEVOS (BLOQUE 4 + BLOQUE 9 + v1.2)
============================================================ */
@media (max-width: 899px) {
  .principios-grid { grid-template-columns: 1fr !important; }
  .familia-grid    { grid-template-columns: 1fr !important; }
  .contratos-grid  { grid-template-columns: 1fr !important; }
  .trabajamos-grid { grid-template-columns: 1fr !important; }
  .detenido-grid   { grid-template-columns: 1fr !important; }
  .defender-grid   { grid-template-columns: 1fr !important; }
  .cripto-imgs     { grid-template-columns: 1fr !important; }
  /* v1.2 */
  .situacion-grid  { grid-template-columns: 1fr !important; }
  .reclama-grid    { grid-template-columns: 1fr !important; }
  .agenda-grid     { grid-template-columns: 1fr !important; }
  .casos-grid      { grid-template-columns: 1fr !important; }
  .cta-final-data  { grid-template-columns: 1fr !important; gap: 18px !important; }
}

/* ============================================================
   NORMALIZACIÓN ALTURA CARDS DE SERVICIOS (v1.2 — C.3, D.2, E.1)
============================================================ */
.laboral-card,
.civil-card,
.penal-card {
  min-height: 220px;
  align-items: flex-start;
}
.laboral-card > div:last-child,
.civil-card > div:last-child,
.penal-card > div:last-child {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   CHATBOT AVATAR (v1.2 — H.2: logo en lugar de "RF")
============================================================ */
.rf-av {
  overflow: hidden;
  background: #fff !important;
  padding: 0 !important;
}
.rf-av img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   Botón flotante de WhatsApp (esquina inferior derecha)
   Tracking: id="whatsapp-floating-button" + data-event + data-page
   El chatbot se posiciona en la esquina inferior izquierda
   ============================================================ */
#whatsapp-floating-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease;
  animation: whatsapp-pulse 3s ease-in-out infinite;
}
#whatsapp-floating-button:hover {
  transform: scale(1.1);
  animation-play-state: paused;
}
#whatsapp-floating-button:focus-visible {
  outline: 2px solid #C9A84C;
  outline-offset: 3px;
}
#whatsapp-floating-button svg {
  display: block;
  width: 26px;
  height: 26px;
}
@keyframes whatsapp-pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
  50%      { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 0 8px rgba(37, 211, 102, 0.3); }
}
@media (max-width: 420px) {
  #whatsapp-floating-button {
    bottom: 16px;
    right: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #whatsapp-floating-button {
    animation: none;
  }
}
