/* ============================================
   Mejores Agencias de Marketing Digital — Design tokens
   ============================================ */
:root {
  /* Marca */
  --accent: #4b1d8f;
  --accent-dark: #2e1065;
  --accent-mid: #8a61d2;
  --footer-bg: #3b1677;
  --footer-muted: #e2d8f7;

  /* Texto */
  --ink-900: #1f1a2e;
  --ink-700: #3a3350;
  --ink-600: #4a4460;
  --ink-500: #5e5873;
  --ink-400: #6b6580;

  /* Superficies y bordes */
  --bg: #ffffff;
  --tint-50: #fbfafe;
  --tint-100: #faf8fe;
  --tint-200: #f6f2fd;
  --tint-300: #f4f1fb;
  --tint-400: #f1ecfa;
  --tint-500: #eee8fa;
  --border: #ece8f5;
  --border-soft: #f1eef7;
  --border-strong: #e4dbf6;
  --border-hover: #cdbdee;
  --line-deco: #dcd1f2;

  /* Ranking */
  --gold: #f2c94c;
  --gold-dark: #d9a91f;
  --silver: #d3d6de;
  --bronze: #d4915f;

  /* Sombras */
  --shadow-sm: 0 2px 10px rgba(46, 16, 101, 0.04);
  --shadow-header: 0 6px 24px rgba(46, 16, 101, 0.08);
  --shadow-hover: 0 12px 26px rgba(75, 29, 143, 0.12);
  --shadow-accent: 0 8px 18px rgba(75, 29, 143, 0.22);

  /* Radios */
  --radius-sm: 12px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  /* Layout */
  --container: 1120px;
  --gutter: 24px;
  --section-gap: 28px;

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  font-family: 'Montserrat', system-ui, sans-serif;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-dark);
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
p {
  margin: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
  color: #fff;
}

main {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

/* ============================================
   Componentes compartidos
   ============================================ */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.soft {
  background: var(--tint-300);
  border-radius: var(--radius-xl);
}

/* Oculto sin display:none para que <use> pueda referenciar los símbolos */
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Íconos del sprite: el color se hereda con currentColor */
.icon {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--tint-400);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.section-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-accent);
  transition: transform 0.3s ease;
}

section:hover .section-icon {
  transform: rotate(-6deg);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-title {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-title em {
  font-style: normal;
  color: var(--accent);
}

.lead {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-500);
}

.lead strong {
  color: var(--accent);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--tint-400);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border: 0;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn .icon {
  transition: translate 0.3s ease;
}

.btn:hover .icon {
  translate: 3px 0;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 22px rgba(75, 29, 143, 0.28);
}

.btn-outline {
  background: var(--bg);
  color: var(--accent);
  border: 1.5px solid #d9cef0;
}

.btn-outline:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px) scale(1.03);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  transition: gap 0.2s ease;
}

.link-arrow:hover {
  gap: 10px;
  color: var(--accent);
}

.btn:focus-visible,
.link-arrow:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-pill);
}

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky;
  top: 12px;
  z-index: 20;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-radius: 16px;
  box-shadow: var(--shadow-header);
}

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

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1.5px solid var(--ink-900);
  color: var(--ink-900);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s ease;
}

.header-bar:hover .logo-mark {
  transform: rotate(-12deg) scale(1.08);
}

.logo-mark .icon {
  stroke-width: 1.8;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-name {
  font-size: 16px;
  font-weight: 800;
}

.logo-tagline {
  font-size: 11.5px;
  color: var(--ink-400);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 44px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero h1 {
  font-size: 36px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.hero-media {
  display: flex;
  justify-content: center;
}

.hero-art {
  width: 100%;
  max-width: 340px;
  transition: transform 0.5s ease;
}

.hero:hover .hero-art {
  transform: scale(1.04);
}

/* ============================================
   Stats
   ============================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 26px;
  border-right: 1px solid var(--border);
  transition: background 0.25s ease;
}

.stat:last-child {
  border-right: 0;
}

.stat:hover {
  background: var(--tint-100);
}

.stat:hover .ico {
  transform: scale(1.12);
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
}

.stat-label {
  font-size: 14px;
  color: var(--ink-500);
}

/* ============================================
   Ranking
   ============================================ */
.ranking {
  padding: 32px 28px 20px;
}

.ranking .section-head {
  margin-bottom: 20px;
  padding: 0 4px;
}

.rank-head,
.rank-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1.1fr) minmax(0, 1.3fr) minmax(0, 1.7fr) minmax(0, 1.6fr) 96px 36px;
  align-items: center;
  gap: 12px;
}

.rank-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-700);
}

.rank-row {
  width: 100%;
  padding: 16px;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-row:hover {
  background: var(--tint-100);
  transform: scale(1.01);
  box-shadow: 0 6px 18px rgba(75, 29, 143, 0.08);
}

.rank-row:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.rank-row.is-open {
  background: var(--tint-200);
}

.rank-name {
  font-size: 15px;
  font-weight: 800;
}

.rank-cell {
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-600);
}

.rank-label {
  display: none;
}

.rank-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-900);
}

.rank-rating .icon {
  fill: var(--gold);
  stroke: var(--gold-dark);
  stroke-width: 1.2;
}

.medal {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-400);
}

.medal--gold {
  background: var(--gold);
  color: #3a2a00;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.medal--silver {
  background: var(--silver);
  color: #2f3340;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.medal--bronze {
  background: var(--bronze);
  color: #3b1e08;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.rank-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tint-400);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background 0.2s ease;
}

.rank-row.is-open .rank-toggle {
  transform: rotate(180deg);
  background: var(--accent);
  color: #fff;
}

/* Ficha desplegable */
.agency-panel {
  padding: 8px 16px 28px;
  animation: drop 0.35s ease both;
}

.agency-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--tint-50);
}

.agency-intro {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
}

.agency-about {
  flex: 1 1 520px;
  min-width: 0;
}

.agency-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-700);
}

.agency-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

/* Servicios */
.service-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.service-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-strong);
  font-size: 14px;
  font-weight: 800;
}

.service-group-title .icon {
  color: var(--accent);
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.service:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-hover);
}

.service-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.service .ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.service h5 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.service p {
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-500);
}

/* Industrias */
.industry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.industry {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.industry:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--shadow-hover);
}

.industry:hover .ico {
  transform: scale(1.12) rotate(-6deg);
}

.service:hover .ico,
.industry:hover .ico {
  background: var(--accent);
  color: #fff;
}

.industry h4 {
  font-size: 15px;
  font-weight: 800;
}

.industry p {
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-500);
}

/* Países */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.chip:hover {
  transform: scale(1.06);
  background: var(--accent);
  color: #fff;
}

/* ============================================
   Metodología
   ============================================ */
.method {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 36px;
  align-items: center;
  padding: 40px;
}

.method-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.method-art {
  width: 100%;
  max-width: 460px;
  margin-top: 8px;
  transition: transform 0.5s ease;
}

.method:hover .method-art {
  transform: scale(1.03);
}

.criteria {
  padding: 10px 22px;
}

.criterion {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 4px;
  border-bottom: 1px solid var(--border);
  transition: transform 0.25s ease;
}

.criterion:last-child {
  border-bottom: 0;
}

.criterion:hover {
  transform: translateX(6px);
}

.criterion:hover .ico {
  transform: scale(1.12);
}

.criterion-number {
  flex: none;
  width: 24px;
  padding-top: 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
}

.criterion h3 {
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 800;
}

.criterion p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-500);
}

/* ============================================
   Cómo elegir
   ============================================ */
.choose {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 40px;
}

.choose .section-head {
  max-width: 720px;
}

/* 4 tarjetas por fila (4 + 4 + 2 centradas), todas las filas con la misma altura */
.tips {
  --row-gap: 18px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: var(--row-gap) 22px;
}

.tip:nth-child(9) {
  grid-column: 2;
}

/*
  Línea conectora en "S" que pasa por detrás de las tarjetas.
  Con 3 filas iguales, el centro de la fila 1 queda a (100% - 2 gaps) / 6 del borde
  superior, el de la fila 2 justo en el 50% y el de la fila 3 a la misma distancia del borde inferior.
  ::before → fila 1, curva a la derecha, fila 2
  ::after  → fila 2, curva a la izquierda, fila 3
*/
.tips::before,
.tips::after {
  content: '';
  position: absolute;
  border: 2px solid var(--line-deco);
  pointer-events: none;
}

.tips::before {
  top: calc((100% - 2 * var(--row-gap)) / 6);
  bottom: 50%;
  left: 12%;
  right: -14px;
  border-left: 0;
  border-radius: 0 40px 40px 0;
}

.tips::after {
  top: calc(50% - 2px); /* se superpone al borde inferior de ::before para no duplicar el grosor */
  bottom: calc((100% - 2 * var(--row-gap)) / 6);
  left: -14px;
  right: 30%;
  border-right: 0;
  border-radius: 40px 0 0 40px;
}

.tip {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-height: 96px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.tip:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 14px 28px rgba(75, 29, 143, 0.14);
  border-color: var(--border-hover);
}

.tip .ico {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.tip:hover .ico {
  background: var(--accent);
  color: #fff;
}

.tip h3 {
  margin-bottom: 3px;
  font-size: 14px;
  font-weight: 800;
}

.tip p {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-500);
}

/* ============================================
   FAQ
   ============================================ */
.faq {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  gap: 32px;
  padding: 40px;
  background: var(--tint-500);
}

.faq .section-head {
  gap: 12px;
}

.faq-list {
  overflow: hidden;
  border-radius: 16px;
}

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

.faq-item:last-child {
  border-bottom: 0;
}

.faq-item h3 {
  font: inherit;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, padding 0.2s ease;
}

.faq-question:hover {
  background: var(--tint-100);
  padding-left: 24px;
}

.faq-question:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.faq-question .icon {
  color: var(--accent);
  stroke-width: 2;
  transition: transform 0.3s ease;
}

.faq-item.is-open .faq-question .icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 18px 18px 52px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-600);
  animation: drop 0.3s ease both;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  margin-top: 12px;
  background: var(--footer-bg);
  color: #fff;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 26px;
  padding-bottom: 26px;
}

.logo--light .logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border-color: #fff;
  color: #fff;
}

.logo--light .logo-name {
  font-size: 15px;
}

.logo--light .logo-tagline,
.footer-copy {
  color: var(--footer-muted);
}

.footer-copy {
  font-size: 13px;
}

/* ============================================
   Animaciones
   ============================================ */
@keyframes rise {
  from { opacity: 0; translate: 0 16px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes fade-down {
  from { opacity: 0; translate: 0 -12px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes nudge {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 3px; }
}

/* Entrada inicial */
.site-header {
  animation: fade-down 0.5s ease both;
}

.hero-copy > * {
  animation: rise 0.6s var(--ease-out) both;
}

.hero-copy > :nth-child(2) { animation-delay: 0.08s; }
.hero-copy > :nth-child(3) { animation-delay: 0.16s; }

.hero-art {
  animation: rise 0.8s var(--ease-out) 0.2s both;
}

/* Pista: el primer puesto se puede desplegar */
.rank-list > li:first-child .rank-row:not(.is-open) .rank-toggle {
  animation: nudge 1.2s ease-in-out 1.2s 3;
}

/* Contenido de la ficha: aparece en cascada al desplegar */
.agency-panel .service,
.agency-panel .industry,
.agency-panel .chip {
  animation: rise 0.5s var(--ease-out) both;
  animation-delay: calc(var(--group-delay, 0s) + var(--item-delay, 0s));
}

.service-group:nth-child(2) { --group-delay: 0.06s; }
.service-group:nth-child(3) { --group-delay: 0.12s; }
.service-group:nth-child(4) { --group-delay: 0.18s; }

.service:nth-child(2), .industry:nth-child(2), .chip:nth-child(2) { --item-delay: 0.05s; }
.service:nth-child(3), .industry:nth-child(3), .chip:nth-child(3) { --item-delay: 0.1s; }
.service:nth-child(4), .industry:nth-child(4), .chip:nth-child(4) { --item-delay: 0.15s; }
.service:nth-child(5), .chip:nth-child(5) { --item-delay: 0.2s; }
.chip:nth-child(6) { --item-delay: 0.25s; }

/* Aparición al hacer scroll (navegadores compatibles; en los demás el contenido se ve sin animar) */
@supports (animation-timeline: view()) {
  .reveal {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }

  @keyframes header-shadow {
    from { box-shadow: 0 6px 24px rgba(46, 16, 101, 0.08); }
    to { box-shadow: 0 12px 32px rgba(46, 16, 101, 0.16); }
  }

  .header-bar {
    animation: header-shadow linear both;
    animation-timeline: scroll();
    animation-range: 0 160px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
  .hero,
  .method,
  .faq {
    grid-template-columns: minmax(0, 1fr);
  }

  .service-groups,
  .industry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
  }

  .tip:nth-child(9) {
    grid-column: auto;
  }

  .tips::before,
  .tips::after {
    display: none;
  }
}

@media (max-width: 760px) {
  /* Cifras: dos columnas, ícono arriba y cifra debajo */
  .stat {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 18px 16px;
  }

  .rank-head {
    display: none;
  }

  /* Ranking: cabecera (posición, agencia, valoración, flecha) y debajo los datos en columna a todo el ancho */
  .ranking {
    padding: 28px 16px 16px;
  }

  .rank-row {
    grid-template-columns: 32px minmax(0, 1fr) auto 32px;
    gap: 10px;
    padding: 16px 12px;
  }

  .rank-rating {
    grid-column: 3;
    grid-row: 1;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--tint-200);
    font-size: 13px;
  }

  .rank-toggle-wrap {
    grid-column: 4;
    grid-row: 1;
  }

  /* Datos de la agencia en dos columnas: etiqueta | valor, dentro de un mismo bloque */
  .rank-cell {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    margin: -10px 0 0;
    padding: 8px 12px;
    background: var(--tint-100);
    font-size: 13px;
  }

  .rank-row > .rank-cell:nth-child(3) {
    margin-top: 0;
    padding-top: 12px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }

  .rank-row > .rank-cell:nth-child(5) {
    padding-bottom: 12px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  }

  .rank-label {
    display: block;
    padding-top: 1px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
  }

  /* Criterios: ícono y número en una columna a la izquierda, texto a la derecha */
  .method {
    padding: 28px 16px;
  }

  .criteria {
    padding: 4px 18px;
  }

  .criterion {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 6px 14px;
    padding: 18px 0;
  }

  .criterion .ico {
    grid-column: 1;
    grid-row: 1;
  }

  .criterion-number {
    grid-column: 1;
    grid-row: 2;
    width: auto;
    padding-top: 0;
    font-size: 13px;
    text-align: center;
  }

  .criterion > div {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .criterion:hover {
    transform: none;
  }

  .service-groups,
  .industry-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tips {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-title {
    font-size: 24px;
  }

  .agency-panel-inner {
    padding: 18px;
  }
}
