/* ========= Pagination (sin Tailwind) ========= */
nav[aria-label="Pagination Navigation"] {
    /* Colores de marca */
    --bg: #ffffff;
    --bg-muted: #f8fafc;
    --fg: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 2px rgba(0,0,0,.06);
  
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: .75rem; /* mt-3 */
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  }
  
  /* Modo oscuro automático si el usuario lo tiene activo */
  @media (prefers-color-scheme: dark) {
    nav[aria-label="Pagination Navigation"] {
      --bg: var(--brand-dark);;
      --bg-muted: var(--brand-dark);;
      --fg: #e5e7eb;
      --muted: #9ca3af;
      --border: var(--brand-dark);;
    }
  }
  
  /* Estructura: móvil muestra prev/next, desktop muestra el paginado completo */
  nav[aria-label="Pagination Navigation"] > div:first-child { display: flex; flex: 1; justify-content: space-between; }
  nav[aria-label="Pagination Navigation"] > div:last-child  { display: none; }
  
  @media (min-width: 640px) {
    nav[aria-label="Pagination Navigation"] > div:first-child { display: none; }
    nav[aria-label="Pagination Navigation"] > div:last-child  { display: flex; flex: 1; align-items: center; justify-content: space-between; }
  }
  
  /* Texto "Showing X to Y of Z results" */
  nav[aria-label="Pagination Navigation"] p {
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.5;
    margin: 0;
  }
  nav[aria-label="Pagination Navigation"] .font-number { font-weight: 600; color: #788788; }
  nav[aria-label="Pagination Navigation"] .font-medium { font-weight: 600; color: #f6f6f6; }
  
  /* Contenedor de botones */
  nav[aria-label="Pagination Navigation"] .inline-flex {
    display: inline-flex;
    border-radius: 2rem;
    overflow: hidden;
    /*box-shadow: var(--shadow);*/
    margin: 0px 1px;
  }
  
  /* Botones base */
  nav[aria-label="Pagination Navigation"] a,
  nav[aria-label="Pagination Navigation"] span[aria-current="page"] > span,
  nav[aria-label="Pagination Navigation"] span[aria-disabled="true"] > span,
  nav[aria-label="Pagination Navigation"] > div:first-child a,
  nav[aria-label="Pagination Navigation"] > div:first-child span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 .8rem;
    font-size: .9rem;
    font-weight: 500;
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--border);
    line-height: 1;
    text-decoration: none;
    transition: transform .08s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
  }
  
  /* Separadores tipo "-ml-px" */
  nav[aria-label="Pagination Navigation"] a + a,
  nav[aria-label="Pagination Navigation"] a + span,
  nav[aria-label="Pagination Navigation"] span + a,
  nav[aria-label="Pagination Navigation"] span + span {
    margin-left: -1px;
  }
  
  /* Bordes redondeados en extremos */
  nav[aria-label="Pagination Navigation"] [aria-label="pagination.previous"] > span,
  nav[aria-label="Pagination Navigation"] a[rel="prev"],
  nav[aria-label="Pagination Navigation"] .inline-flex > *:first-child {
    border-top-left-radius: .6rem;
    border-bottom-left-radius: .6rem;
  }
  nav[aria-label="Pagination Navigation"] [aria-label="pagination.next"],
  nav[aria-label="Pagination Navigation"] .inline-flex > *:last-child {
    border-top-right-radius: .6rem;
    border-bottom-right-radius: .6rem;
  }
  
  /* Hover y active */
  nav[aria-label="Pagination Navigation"] a:hover {
    background: var(--bg-muted);
  }
  nav[aria-label="Pagination Navigation"] a:active {
    transform: translateY(1px);
  }
  
  /* Estado "actual" */
  nav[aria-label="Pagination Navigation"] span[aria-current="page"] > span {
    background: linear-gradient(0deg, rgba(0,0,0,.02), rgba(255,255,255,.02)), var(--bg);
    color: var(--brand);
    border-color: var(--brand);
    position: relative;
    z-index: 1;
    cursor: default;
  }
  
  /* Estado "disabled" (prev en página 1, etc.) */
  nav[aria-label="Pagination Navigation"] span[aria-disabled="true"] > span {
    color: var(--muted);
    background: var(--bg-muted);
    cursor: not-allowed;
  }
  
  /* Flechas (SVG) heredan color del texto */
  nav[aria-label="Pagination Navigation"] svg {
    width: 1.1rem; height: 1.1rem;
  }
  
  /* Enlaces de número: pequeño realce en foco/teclado */
  nav[aria-label="Pagination Navigation"] a:focus {
    outline: 2px solid transparent;
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 35%, transparent);
    position: relative;
    z-index: 2;
  }
  
  /* Variante “primaria” al pasar por encima de números (opcional, sutil) */
  nav[aria-label="Pagination Navigation"] a[aria-label^="Go to page"]:hover {
    border-color: var(--brand);
    color: var(--brand);
  }
  
  /* Botones prev/next resaltados ligeramente */
  nav[aria-label="Pagination Navigation"] a[rel="next"],
  nav[aria-label="Pagination Navigation"] a[rel="prev"],
  nav[aria-label="Pagination Navigation"] > div:first-child a {
    color: var(--muted);
  }
  nav[aria-label="Pagination Navigation"] a[rel="next"]:hover,
  nav[aria-label="Pagination Navigation"] a[rel="prev"]:hover,
  nav[aria-label="Pagination Navigation"] > div:first-child a:hover {
    color: var(--brand);
    border-color: var(--brand);
  }
  
  /* Soporte RTL si tu documento lo usa */
  :root[dir="rtl"] nav[aria-label="Pagination Navigation"] .inline-flex > *:first-child {
    border-radius: 0 .6rem .6rem 0;
  }
  :root[dir="rtl"] nav[aria-label="Pagination Navigation"] .inline-flex > *:last-child {
    border-radius: .6rem 0 0 .6rem;
  }
  
  /* ===== Reemplazar placeholders de paginación vía CSS ===== */

 /* ===== Reemplazo de "pagination.previous/next" SOLO en la fila móvil ===== */
 /* Prev (SPAN deshabilitado en la 1a página) */
 /* ===== Móvil: reemplazar textos por «Anterior» / «Siguiente» sin importar si es <span> o <a> ===== */
nav[aria-label="Pagination Navigation"] > div:nth-of-type(1) > *:first-child,
nav[aria-label="Pagination Navigation"] > div:nth-of-type(1) > *:last-child {
  position: relative;
  color: transparent; /* oculta el literal 'pagination.previous/next' */
  font-size: 0.1rem;
}

/* Primer botón (Anterior) */
nav[aria-label="Pagination Navigation"] > div:nth-of-type(1) > *:first-child::before {
  content: "← Anterior";
  color: var(--fg);
  font-size: 1rem;
  font-weight: 600;
}

/* Último botón (Siguiente) */
nav[aria-label="Pagination Navigation"] > div:nth-of-type(1) > *:last-child::before {
  content: "Siguiente →";
  color: var(--fg);
  font-size: 1rem;
  font-weight: 600;
}

/* Estado deshabilitado (cuando el anterior es <span aria-disabled="true"> en la página 1) */
nav[aria-label="Pagination Navigation"] > div:nth-of-type(1) > *[aria-disabled="true"]::before,
nav[aria-label="Pagination Navigation"] > div:nth-of-type(1) > *.cursor-default::before {
  color: var(--muted);
}

/* Hover/focus SOLO para los que son <a> */
nav[aria-label="Pagination Navigation"] > div:nth-of-type(1) > a:hover::before {
  color: var(--brand-ink);
}
nav[aria-label="Pagination Navigation"] > div:nth-of-type(1) > a:focus {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 35%, transparent);
}

/* RTL opcional: invierte flechas */
:root[dir="rtl"] nav[aria-label="Pagination Navigation"] > div:nth-of-type(1) > *:first-child::before {
  content: "Anterior →";
}
:root[dir="rtl"] nav[aria-label="Pagination Navigation"] > div:nth-of-type(1) > *:last-child::before {
  content: "← Siguiente";
}
