/* ============================================================
   MAGNO GROUP – MAIN STYLESHEET
   Paleta: Navy #0B1C3D | Purple #6B2FAB | Gradient accent
   Font:   Inter (body) + Barlow Condensed (display)
   ============================================================ */

/* ─── CUSTOM PROPERTIES ─────────────────────────────────── */
:root {
  /* Brand colors */
  --color-navy:         #0B1C3D;
  --color-navy-mid:     #122248;
  --color-navy-light:   #1A3060;
  --color-purple:       #480F7E;
  --color-purple-light: #5C26A2;
  --color-purple-dark:  #300C56;
  --color-accent:       #9B59F5;

  /* Gradients */
  --gradient-hero:      linear-gradient(135deg, #2E0A60 0%, #0B1C3D 60%, #061228 100%);
  --gradient-brand:     linear-gradient(135deg, var(--color-purple) 0%, var(--color-navy) 100%);
  --gradient-card:      linear-gradient(135deg, #1A3060 0%, #0D2050 100%);

  /* Neutrals */
  --color-white:        #FFFFFF;
  --color-off-white:    #F4F6FA;
  --color-gray-100:     #E8ECF4;
  --color-gray-200:     #C8D0E4;
  --color-gray-400:     #8494B8;
  --color-gray-600:     #4A5978;
  --color-text:         #1A2540;
  --color-text-muted:   #566485;

  /* Typography */
  --font-body:          'Montserrat', system-ui, -apple-system, sans-serif;
  --font-display:       'Montserrat', system-ui, -apple-system, sans-serif;

  --text-xs:    0.75rem;    /* 12px */
  --text-sm:    0.875rem;   /* 14px */
  --text-base:  1rem;       /* 16px */
  --text-lg:    1.125rem;   /* 18px */
  --text-xl:    1.25rem;    /* 20px */
  --text-2xl:   1.5rem;     /* 24px */
  --text-3xl:   1.875rem;   /* 30px */
  --text-4xl:   2.25rem;    /* 36px */
  --text-5xl:   3rem;       /* 48px */
  --text-6xl:   3.75rem;    /* 60px */
  --text-7xl:   4.5rem;     /* 72px */

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --container-max: 1200px;
  --container-pad: 1.5rem;

  /* Radii */
  --radius-sm:  0.375rem;
  --radius-md:  0.75rem;
  --radius-lg:  1rem;
  --radius-xl:  1.5rem;
  --radius-2xl: 2rem;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.16), 0 4px 12px rgba(0,0,0,.08);
  --shadow-brand: 0 8px 32px rgba(107, 47, 171, .35);

  /* Transitions */
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
  --transition-slow: 0.4s cubic-bezier(.4,0,.2,1);

  /* Nav height */
  --nav-h: 72px;
}

/* ─── RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 8px);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font: inherit; }
input, select, textarea { font: inherit; }
address { font-style: normal; }

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ─── UTILITY ─────────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ─── TYPOGRAPHY HELPERS ──────────────────────────────────── */
.section-eyebrow {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-purple-light);
  margin-bottom: var(--space-3);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--color-navy);
}

.section-description {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 56ch;
  margin-top: var(--space-4);
  line-height: 1.7;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header .section-description {
  margin-inline: auto;
}

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.875rem 2rem;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition);
  border: 2px solid transparent;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.06);
  opacity: 0;
  transition: opacity var(--transition);
}
.btn:hover::after { opacity: 1; }

.btn-primary {
  background: var(--gradient-brand);
  color: var(--color-white);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(107,47,171,.45);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255,255,255,.4);
}
.btn-outline:hover {
  border-color: var(--color-white);
  background: rgba(255,255,255,.08);
}

.btn-full { width: 100%; }

/* ─── LOGO ────────────────────────────────────────────────── */
.nav-logo {
  display: flex;
  align-items: center;
  line-height: 1;
  transition: opacity var(--transition);
  flex-shrink: 0;
}
.nav-logo:hover { opacity: .85; }

/* Logo SVG image */
.logo-img {
  display: block;
  height: 38px;
  width: auto;
  max-width: none;
}
.logo-img--footer {
  height: 40px;
}

/* Legacy text spans (kept for section eyebrows) */
.logo-slashes { color: var(--color-purple-light); }
.logo-name { color: var(--color-white); margin-inline: 0.05em; }

/* ─── NAV HEADER ──────────────────────────────────────────── */
.nav-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: transparent;
  transition: box-shadow var(--transition-slow);
}

/* El blur se aplica en ::before y NO en el elemento padre.
   backdrop-filter directo en el padre cambia el containing block
   de hijos con position:fixed (como .nav-menu), rompiéndoles la posición. */
.nav-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: transparent;
  transition: background var(--transition-slow), backdrop-filter var(--transition-slow);
}

.nav-header.scrolled {
  box-shadow: 0 1px 0 rgba(255,255,255,.06), var(--shadow-md);
}

.nav-header.scrolled::before {
  background: rgba(11, 28, 61, .95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}

.nav-link {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(255,255,255,.82);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  letter-spacing: 0.02em;
}
.nav-link:hover, .nav-link.active {
  color: var(--color-white);
  background: rgba(255,255,255,.08);
}

.nav-cta {
  background: var(--gradient-brand);
  color: var(--color-white) !important;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-5) !important;
  box-shadow: var(--shadow-brand);
  margin-left: var(--space-3);
}
.nav-cta:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.08) !important;
  box-shadow: 0 6px 20px rgba(107,47,171,.4);
  border: 1px solid rgba(255,255,255,.2);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  background: none;
  border: none;
  color: var(--color-white);
}
.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── HERO ────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  z-index: 0;
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(107,47,171,.35) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 20% 80%, rgba(155,89,245,.15) 0%, transparent 50%);
}

/* Animated mesh grid overlay */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 50%, black 40%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--nav-h) + var(--space-12));
  padding-bottom: var(--space-16);
  max-width: 800px;
}

.hero-eyebrow {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(155,89,245,.9);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-5xl), 8vw, var(--text-7xl));
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--color-white);
  margin-bottom: var(--space-6);
  text-wrap: balance;
}

.hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--color-accent) 0%, #C084FC 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(var(--text-lg), 2vw, var(--text-xl));
  color: rgba(255,255,255,.72);
  max-width: 55ch;
  line-height: 1.7;
  margin-bottom: var(--space-8);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}

.hero-tagline {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.tagline-divider {
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.15);
  max-width: 60px;
}

.tagline-text {
  font-size: var(--text-sm);
  font-style: italic;
  color: rgba(255,255,255,.55);
  letter-spacing: 0.01em;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.scroll-dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: .4; }
  50% { transform: translateY(8px); opacity: 1; }
}

/* ─── STATS BAR ───────────────────────────────────────────── */
.stats-bar {
  background: var(--color-navy);
  padding: var(--space-8) 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.stats-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.stat-number {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 900;
  color: var(--color-white);
  line-height: 1;
  background: linear-gradient(135deg, var(--color-white) 0%, rgba(155,89,245,.9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-gray-400);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,.1);
}

/* ─── SERVICES ────────────────────────────────────────────── */
.services {
  padding: var(--space-24) 0;
  background-color: var(--color-off-white);
  background-image: radial-gradient(rgba(107,47,171,.07) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}

.service-block {
  background: var(--color-white);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-gray-100);
  transition: box-shadow var(--transition-slow);
}
.service-block:hover { box-shadow: var(--shadow-md); }
.service-block:last-child { margin-bottom: 0; }

.service-block--alt {
  background: var(--color-navy);
  border-color: rgba(255,255,255,.06);
}
.service-block--alt .service-block-header .service-category-label { color: var(--color-accent); }
.service-block--alt .service-block-title { color: var(--color-white); }
.service-block--alt .service-block-description { color: rgba(255,255,255,.7); }
.service-block--alt .service-card {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.1);
}
.service-block--alt .service-card-title { color: var(--color-white); }
.service-block--alt .service-card-desc { color: rgba(255,255,255,.6); }
.service-block--alt .service-list li { color: rgba(255,255,255,.75); }
.service-block--alt .service-list li::before { background: var(--color-accent); }

.service-block-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.service-block-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  color: var(--color-white);
  box-shadow: var(--shadow-brand);
}
.service-block-icon svg { width: 28px; height: 28px; }

.service-category-label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-purple);
  margin-bottom: var(--space-1);
}

.service-block-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl));
  font-weight: 800;
  color: var(--color-navy);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.service-block-description {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 72ch;
  line-height: 1.7;
  margin-bottom: var(--space-8);
}

.service-block-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  line-height: 1.6;
  max-width: 58ch;
}
.service-block--alt .service-block-subtitle { color: rgba(255,255,255,.65); }

.service-block > .service-list {
  margin-top: var(--space-6);
}

/* ── Service block decorative photo backgrounds ── */
#servicios-legales {
  background:
    linear-gradient(rgba(255,255,255,0.86), rgba(255,255,255,0.86)),
    image-set(
      url('../assets/services/legales.webp?v=2') type('image/webp'),
      url('../assets/services/legales.jpg?v=2')  type('image/jpeg')
    ) center / cover no-repeat;
}
#gestion-urbana {
  background:
    linear-gradient(rgba(11,28,61,0.84), rgba(11,28,61,0.84)),
    image-set(
      url('../assets/services/gestion-urbana.webp?v=2') type('image/webp'),
      url('../assets/services/gestion-urbana.jpg?v=2')  type('image/jpeg')
    ) center / cover no-repeat;
}
#servicios-especializados {
  background:
    linear-gradient(rgba(255,255,255,0.86), rgba(255,255,255,0.86)),
    image-set(
      url('../assets/services/especializados.webp?v=2') type('image/webp'),
      url('../assets/services/especializados.jpg?v=2')  type('image/jpeg')
    ) center / cover no-repeat;
}

.service-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
}

.service-cards-grid--single {
  grid-template-columns: 1fr;
}

.service-card {
  background: var(--color-off-white);
  border: 1px solid var(--color-gray-100);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color var(--transition), transform var(--transition);
}
.service-card:hover {
  border-color: var(--color-purple-light);
  transform: translateY(-2px);
}

.service-card--wide {
  max-width: none;
}

.service-card-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-navy);
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.service-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.service-list--cols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-2) var(--space-6);
}

.service-list li {
  position: relative;
  padding-left: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.service-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-purple-light);
}

/* ─── ABOUT ───────────────────────────────────────────────── */
.about {
  padding: var(--space-24) 0;
  background-color: var(--color-white);
  background-image:
    linear-gradient(rgba(107,47,171,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(107,47,171,.04) 1px, transparent 1px);
  background-size: 32px 32px;
  overflow: hidden;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.about-content .section-eyebrow { color: var(--color-purple); }

.about-content .section-title { color: var(--color-navy); }

.about-text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-top: var(--space-5);
}
.about-text strong { color: var(--color-navy); font-weight: 600; }

.about-values {
  margin-top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.value-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.value-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(107,47,171,.1) 0%, rgba(11,28,61,.06) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-purple);
  border: 1px solid rgba(107,47,171,.15);
}
.value-icon svg { width: 20px; height: 20px; }

.value-title {
  display: block;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: var(--space-1);
}

.value-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* About Visual Side */
.about-visual {
  position: relative;
  min-height: 480px;
}

.about-card {
  position: absolute;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  color: var(--color-white);
}

.about-card--1 {
  top: 0;
  right: 0;
  width: 85%;
  background: var(--gradient-brand);
  box-shadow: var(--shadow-brand);
  z-index: 2;
}

.about-card--2 {
  bottom: 0;
  left: 0;
  width: 60%;
  background: var(--color-navy);
  border: 1px solid rgba(255,255,255,.08);
  z-index: 3;
  box-shadow: var(--shadow-lg);
}

.about-quote {
  font-size: var(--text-base);
  font-style: italic;
  line-height: 1.7;
  color: rgba(255,255,255,.9);
}

.about-stat-big {
  font-family: var(--font-display);
  font-size: var(--text-6xl);
  font-weight: 900;
  color: var(--color-white);
  line-height: 1;
  margin-bottom: var(--space-2);
  background: linear-gradient(135deg, var(--color-white) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-stat-label {
  font-size: var(--text-sm);
  color: var(--color-gray-400);
  line-height: 1.5;
}

.about-gradient-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(107,47,171,.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ─── CLIENTS ─────────────────────────────────────────────── */
.clients {
  padding: var(--space-24) 0;
  background: var(--color-navy);
  overflow: hidden;
}

.clients .section-eyebrow { color: rgba(155,89,245,.9); }
.clients .section-title { color: var(--color-white); }
.clients .section-description { color: rgba(255,255,255,.6); }

/* ─── CLIENTS CAROUSEL ────────────────────────────────────── */
.clients-carousel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-12);
  overflow: hidden;
}

.carousel-row {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 7%, black 93%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 7%, black 93%, transparent 100%);
}

.carousel-track {
  display: flex;
  gap: var(--space-3);
  width: max-content;
  animation: carousel-ltr 30s linear infinite;
  will-change: transform;
}

.carousel-row--reverse .carousel-track {
  animation: carousel-rtl 30s linear infinite;
}

.carousel-row:hover .carousel-track {
  animation-play-state: paused;
}

@keyframes carousel-ltr {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes carousel-rtl {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

.client-item {
  flex-shrink: 0;
  width: 200px;
  height: 100px;
  background: #ffffff;
  isolation: isolate;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-md);
  padding: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.carousel-row:hover .client-item:hover {
  border-color: rgba(107,47,171,.5);
  box-shadow: 0 0 0 2px rgba(107,47,171,.25);
}

.client-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(255,255,255,.65);
  text-align: center;
  letter-spacing: 0.02em;
  transition: color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.carousel-row:hover .client-item:hover .client-name { color: var(--color-white); }

.client-logo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  opacity: 0.85;
  transition: opacity var(--transition), transform var(--transition);
}
/* Logos con fondo oscuro o contenido blanco sobre transparente: se invierten
   para que el fondo quede blanco y multiply lo elimine */
.client-logo--dark-bg {
  filter: invert(1);
}
/* Logos con mucho espacio en blanco interno: se escalan para llenar la tarjeta */
.client-logo--xl {
  transform: scale(1.5);
}
.carousel-row:hover .client-item:hover .client-logo {
  opacity: 1;
  transform: scale(1.04);
}
.carousel-row:hover .client-item:hover .client-logo--xl {
  transform: scale(1.55);
}

.clients-cta {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

.clients-cta p {
  font-size: var(--text-lg);
  color: rgba(255,255,255,.7);
}

/* ─── CONTACT ─────────────────────────────────────────────── */
.contact {
  padding: var(--space-24) 0 0;
  background-color: var(--color-off-white);
  background-image: radial-gradient(rgba(107,47,171,.07) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-16);
  align-items: start;
  padding-bottom: var(--space-20);
}

.contact-info .section-eyebrow { color: var(--color-purple); }
.contact-info .section-title { color: var(--color-navy); }

.contact-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-top: var(--space-5);
  margin-bottom: var(--space-8);
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  transition: background var(--transition);
  color: var(--color-text);
}
.contact-item:hover { background: rgba(107,47,171,.06); }

.contact-item-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(107,47,171,.1) 0%, rgba(11,28,61,.06) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-purple);
  border: 1px solid rgba(107,47,171,.15);
}
.contact-item-icon svg { width: 20px; height: 20px; }
.contact-item-icon--whatsapp { color: #25D366; background: rgba(37,211,102,.08); border-color: rgba(37,211,102,.2); }

.contact-item-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.contact-item-value {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-navy);
}
.contact-item-value--address {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Form */
.contact-form-wrapper {
  background: var(--color-white);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-gray-100);
}

.contact-form { display: flex; flex-direction: column; gap: var(--space-5); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.form-group { display: flex; flex-direction: column; gap: var(--space-2); }

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-navy);
  letter-spacing: 0.01em;
}
.form-label span { color: var(--color-purple); }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-gray-200);
  background: var(--color-off-white);
  color: var(--color-text);
  font-size: var(--text-base);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--color-gray-400); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-purple-light);
  background: var(--color-white);
  box-shadow: 0 0 0 3px rgba(107,47,171,.12);
}

.form-input.error,
.form-textarea.error {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238494B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

.form-error {
  font-size: var(--text-xs);
  color: #DC2626;
  font-weight: 500;
}

.form-privacy {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.5;
  margin-top: var(--space-2);
}

/* Form success state */
.form-success {
  text-align: center;
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.form-success-icon {
  width: 64px;
  height: 64px;
  color: #16A34A;
}
.form-success-icon svg { width: 100%; height: 100%; }

.form-success h3 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-navy);
}

.form-success p {
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Map */
.map-wrapper {
  overflow: hidden;
  border-top: 1px solid var(--color-gray-100);
}
.map-wrapper iframe {
  display: block;
  filter: grayscale(20%);
}

/* ─── FOOTER ──────────────────────────────────────────────── */
.footer {
  background: var(--color-navy);
  color: rgba(255,255,255,.7);
  padding-top: var(--space-16);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--space-8);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* footer-logo uses logo-img--footer for sizing */

.footer-tagline {
  font-size: var(--text-base);
  color: rgba(255,255,255,.6);
  margin-top: var(--space-4);
  font-style: italic;
}

.footer-sub {
  font-size: var(--text-sm);
  color: rgba(255,255,255,.4);
  margin-top: var(--space-2);
  line-height: 1.6;
}

.footer-nav-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-white);
  margin-bottom: var(--space-4);
}

.footer-nav ul { display: flex; flex-direction: column; gap: var(--space-3); }

.footer-nav a,
.footer-contact a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,.6);
  transition: color var(--transition);
}
.footer-nav a:hover,
.footer-contact a:hover { color: var(--color-white); }

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer-contact p,
.footer-contact a { font-size: var(--text-sm); }

.footer-address {
  font-size: var(--text-sm);
  color: rgba(255,255,255,.5);
  line-height: 1.7;
  margin-top: var(--space-2);
}

.footer-bottom {
  background: rgba(0,0,0,.2);
  padding: var(--space-4) 0;
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  color: rgba(255,255,255,.4);
}

.footer-bottom a {
  color: rgba(255,255,255,.4);
  transition: color var(--transition);
}
.footer-bottom a:hover { color: rgba(255,255,255,.7); }

.footer-credit {
  font-size: var(--text-xs);
  color: rgba(255,255,255,.22);
  letter-spacing: 0.03em;
}
.footer-credit a {
  color: rgba(255,255,255,.3);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.12);
  padding-bottom: 1px;
  transition: color var(--transition), border-color var(--transition);
}
.footer-credit a:hover {
  color: rgba(255,255,255,.55);
  border-color: rgba(255,255,255,.3);
}

/* ─── WHATSAPP FAB ────────────────────────────────────────── */
.whatsapp-fab {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 900;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.45);
  transition: transform var(--transition), box-shadow var(--transition);
}
.whatsapp-fab svg { width: 28px; height: 28px; }
.whatsapp-fab:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 32px rgba(37,211,102,.55);
}

/* ─── ANIMATIONS ──────────────────────────────────────────── */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s cubic-bezier(.4,0,.2,1), transform 0.65s cubic-bezier(.4,0,.2,1);
}

[data-animate="fade-right"] { transform: translateX(-24px); }
[data-animate="fade-left"]  { transform: translateX(24px); }

[data-animate].visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-visual { order: -1; }

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

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  :root {
    --nav-h: 64px;
    --container-pad: 1.25rem;
  }

  /* Mobile nav */
  .nav-toggle { display: flex; }

  /* Fondo sólido en el header cuando el menú está abierto — via ::before
     para no romper el position:fixed del nav-menu */
  .nav-header:has(.nav-menu.open) { box-shadow: none; }
  .nav-header:has(.nav-menu.open)::before {
    background: rgba(11, 28, 61, .98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav-menu {
    position: fixed;
    inset: 0;
    top: var(--nav-h);
    flex-direction: column;
    align-items: stretch;
    background: rgba(11, 28, 61, .98);
    padding: var(--space-6) var(--container-pad);
    gap: var(--space-2);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    overflow-y: auto;
    z-index: 999;
  }

  .nav-menu.open { transform: translateX(0); }

  .nav-link {
    font-size: var(--text-lg);
    padding: var(--space-4) var(--space-4);
    border-radius: var(--radius-md);
  }

  .nav-cta {
    margin-left: 0;
    text-align: center;
    padding: var(--space-4) !important;
  }

  /* Hero */
  .hero-title { font-size: clamp(var(--text-4xl), 10vw, var(--text-5xl)); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  /* Stats */
  .stats-grid { gap: var(--space-5); }
  .stat-divider { display: none; }

  /* Services */
  .services { padding: var(--space-16) 0; }
  .service-block { padding: var(--space-6); }
  .service-block-header { flex-direction: column; gap: var(--space-3); }
  .service-cards-grid { grid-template-columns: 1fr; }
  .service-list--cols { grid-template-columns: 1fr; }

  /* About */
  .about { padding: var(--space-16) 0; }
  .about-visual {
    min-height: unset;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
  }
  .about-card {
    position: static;
    width: 100% !important;
  }
  .about-gradient-bg { display: none; }

  /* Clients */
  .clients { padding: var(--space-16) 0; }
  .client-item { width: 170px; }
  .carousel-row {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
  }

  /* Contact */
  .contact { padding: var(--space-16) 0 0; }
  .contact-grid { padding-bottom: var(--space-12); }
  .form-row { grid-template-columns: 1fr; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom-content { flex-direction: column; gap: var(--space-2); text-align: center; }
}

@media (max-width: 480px) {
  .hero-content { padding-top: calc(var(--nav-h) + var(--space-8)); }
  .stats-grid { gap: var(--space-6); flex-direction: column; }
  .client-item { width: 150px; height: 85px; padding: 6px; }
  .contact-form-wrapper { padding: var(--space-5); }
}

/* ─── PRINT ───────────────────────────────────────────────── */
@media print {
  .nav-header, .whatsapp-fab, .hero-scroll-indicator { display: none; }
  .hero { min-height: auto; padding: var(--space-8) 0; }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* ─── REDUCED MOTION ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  [data-animate] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
