.article {
  background: #ffffff;
  border: 1px solid #dcfce7;
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 10px 30px -10px rgba(6, 78, 59, 0.05);
  margin: 40px;
}

/* --- Mobile-First Base (.article) --- */

/* Encabezados h2 dentro del artículo */
.article h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-dark);
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

/* Párrafos generales del artículo */
.article p {
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* Listas ordenadas (ol) y desordenadas (ul) directas del artículo */
.article > ol,
.article > ul {
  margin: 0 0 1.5rem 0;
  padding-left: 1.25rem;
  color: var(--text-primary);
}

.article > ol li,
.article > ul li {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.85rem;
  padding-left: 0.25rem;
}

.article > ol li::marker {
  font-weight: 700;
  color: var(--brand-dark);
}

.article > ol li strong,
.article > ul li strong {
  color: var(--text-primary);
}

/* Botón de acción (.btn-primary) */
.article .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--brand);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  text-decoration: none;
  margin-top: 1rem;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
}

.article .btn-primary:hover {
  background-color: var(--brand-dark);
}

.article .btn-primary:active {
  transform: scale(0.98);
}

/* --- Breakpoint: Escritorio / Tablet (min-width: 768px) --- */

@media (min-width: 768px) {
  .article h2 {
    font-size: 1.375rem;
    margin-top: 2.5rem;
  }

  .article p,
  .article > ol li,
  .article > ul li {
    font-size: 1rem;
  }
}

/* --- Estilos Base: Mobile-First (Pantallas pequeñas) --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #2d3748;
}

/* En móvil transformamos las filas en tarjetas */
table,
thead,
tbody,
th,
td,
tr {
  display: block;
}

table thead {
  display: none; /* Ocultar cabecera tabular en móvil */
}

table tbody tr {
  margin-bottom: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
  background-color: #ffffff;
}

table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

table td {
  width: 100%;
  text-align: left;
  padding: 0.4rem 0;
  border: none;
}

/* Etiquetas contextuales para lectura en móvil */
table tbody td:nth-of-type(1)::before {
  content: "Herramienta: ";
  font-weight: 700;
  color: #0f172a;
}

table tbody td:nth-of-type(2)::before {
  content: "Función: ";
  font-weight: 700;
  color: #0f172a;
}

table tbody td:nth-of-type(3)::before {
  content: "Coste: ";
  font-weight: 700;
  color: #0f172a;
}

/* Fila de Total en móvil */
table tbody tr:last-child {
  border-top: 2px solid #0f172a;
  background-color: #f8fafc;
}

table tbody tr:last-child td::before {
  content: ""; /* Desactivar etiqueta genérica para el total */
}

/* --- Breakpoint: Escritorio / Tablet (min-width: 640px) --- */
@media (min-width: 640px) {
  /* Restaurar comportamiento tabular nativo */
  table {
    display: table;
    border-collapse: separate;
    border-spacing: 0;
  }

  table thead {
    display: table-header-group;
  }

  table tbody {
    display: table-row-group;
  }

  table tr {
    display: table-row;
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    padding: 0;
  }

  table th,
  table td {
    display: table-cell;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
  }

  /* Ocultar etiquetas predeterminadas de móvil */
  table tbody td:nth-of-type(1)::before,
  table tbody td:nth-of-type(2)::before,
  table tbody td:nth-of-type(3)::before {
    content: none;
  }

  /* Cabeceras de tabla */
  table thead th {
    color: #0f172a;
    font-weight: 700;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #e2e8f0;
  }

  /* Distribución de columnas */
  table th:nth-child(1),
  table td:nth-child(1) {
    width: 35%;
  }

  table th:nth-child(2),
  table td:nth-child(2) {
    width: 40%;
  }

  table th:nth-child(3),
  table td:nth-child(3) {
    width: 25%;
    text-align: right;
  }

  /* Hover en filas */
  table tbody tr:hover {
    background-color: #f1f5f9;
    transition: background-color 0.2s ease;
  }

  /* Fila de Total */
  table tbody tr:last-child td {
    border-top: 2px solid #0f172a;
    border-bottom: none;
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
    color: #0f172a;
  }
}

/* --- Mobile-First Base (.article .info-box) --- */

.article .info-box {
  background-color: var(--brand-light);
  border: 1px solid #dcfce7;
  border-left: 4px solid var(--brand);
  border-radius: 6px;
  padding: 1.25rem 1rem;
  margin: 1.5rem 0;
  width: 100%;
  box-sizing: border-box;
}

/* Títulos dentro de cajas informativas */
.article .info-box h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  color: var(--brand-dark);
  line-height: 1.3;
}

/* Textos dentro de cajas informativas */
.article .info-box p {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.article .info-box p + p {
  margin-top: 0.75rem;
}

/* Listas internas (.info-list o ul/ol estándar) */
.article .info-box .info-list,
.article .info-box ul,
.article .info-box ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-primary);
}

.article .info-box .info-list li,
.article .info-box ul li,
.article .info-box ol li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.article .info-box .info-list li:last-child,
.article .info-box ul li:last-child,
.article .info-box ol li:last-child {
  margin-bottom: 0;
}

/* Resaltado de negritas */
.article .info-box strong {
  color: var(--brand-dark);
}

/* --- Breakpoint: Escritorio / Tablet (min-width: 768px) --- */

@media (min-width: 768px) {
  .article .info-box {
    padding: 1.5rem 1.75rem;
    margin: 2rem 0;
  }

  .article .info-box h3 {
    font-size: 1.2rem;
  }
}
